X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fhla_target.c;h=dc81ee89a6d39955808867fd3318188fe853e93d;hp=078ac647942ec4aad870f8e7bf0df3155d90cefb;hb=3a32dff0895b7f85d29d5f58a21f17851f0a220e;hpb=83f1c6f9169bdae920ce18108590d8dffad99126 diff --git a/src/target/hla_target.c b/src/target/hla_target.c index 078ac64794..dc81ee89a6 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -157,18 +157,6 @@ static int adapter_store_core_reg_u32(struct target *target, LOG_DEBUG("%s", __func__); -#ifdef ARMV7_GDB_HACKS - /* If the LR register is being modified, make sure it will put us - * in "thumb" mode, or an INVSTATE exception will occur. This is a - * hack to deal with the fact that gdb will sometimes "forge" - * return addresses, and doesn't set the LSB correctly (i.e., when - * printing expressions containing function calls, it sets LR = 0.) - * Valid exception return codes have bit 0 set too. - */ - if (num == ARMV7M_R14) - value |= 0x01; -#endif - /* NOTE: we "know" here that the register identifiers used * in the v7m header match the Cortex-M3 Debug Core Register * Selector values for R0..R15, xPSR, MSP, and PSP. @@ -271,8 +259,8 @@ static int adapter_examine_debug_reason(struct target *target) static int hl_dcc_read(struct hl_interface_s *hl_if, uint8_t *value, uint8_t *ctrl) { uint16_t dcrdr; - int retval = hl_if->layout->api->read_mem8(hl_if->fd, - DCB_DCRDR, sizeof(dcrdr), (uint8_t *)&dcrdr); + int retval = hl_if->layout->api->read_mem(hl_if->fd, + DCB_DCRDR, 1, sizeof(dcrdr), (uint8_t *)&dcrdr); if (retval == ERROR_OK) { *ctrl = (uint8_t)dcrdr; *value = (uint8_t)(dcrdr >> 8); @@ -284,8 +272,7 @@ static int hl_dcc_read(struct hl_interface_s *hl_if, uint8_t *value, uint8_t *ct * to signify we have read data */ /* atomically clear just the byte containing the busy bit */ static const uint8_t zero; - retval = hl_if->layout->api->write_mem8( - hl_if->fd, DCB_DCRDR, 1, &zero); + retval = hl_if->layout->api->write_mem(hl_if->fd, DCB_DCRDR, 1, 1, &zero); } } return retval; @@ -796,13 +783,7 @@ static int adapter_read_memory(struct target *target, uint32_t address, else c = count; - if (size != 4) - res = adapter->layout->api->read_mem8(adapter->fd, - address, c, buffer); - else - res = adapter->layout->api->read_mem32(adapter->fd, - address, c, buffer); - + res = adapter->layout->api->read_mem(adapter->fd, address, size, c, buffer); if (res != ERROR_OK) return res; @@ -844,13 +825,7 @@ static int adapter_write_memory(struct target *target, uint32_t address, else c = count; - if (size != 4) - res = adapter->layout->api->write_mem8(adapter->fd, - address, c, buffer); - else - res = adapter->layout->api->write_mem32(adapter->fd, - address, c, buffer); - + res = adapter->layout->api->write_mem(adapter->fd, address, size, c, buffer); if (res != ERROR_OK) return res;