aboutsummaryrefslogtreecommitdiff
path: root/src/adiv5.c
diff options
context:
space:
mode:
authorGareth McMullin2012-07-05 22:08:01 +1200
committerGareth McMullin2012-07-05 22:08:01 +1200
commit234d54c5a5bb270738895eaf0f29ca92f4590206 (patch)
tree909ec158ecfca057ce408de4643c056e522bf1b4 /src/adiv5.c
parent0433d3d12a2c07c4685e5c42dc6c7e8420defe42 (diff)
Correct stepping over programmed breakpoints.
Fixes issue #2.
Diffstat (limited to 'src/adiv5.c')
-rw-r--r--src/adiv5.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/adiv5.c b/src/adiv5.c
index 0adc97b..13ea449 100644
--- a/src/adiv5.c
+++ b/src/adiv5.c
@@ -276,6 +276,17 @@ void adiv5_ap_mem_write(ADIv5_AP_t *ap, uint32_t addr, uint32_t value)
adiv5_ap_write(ap, ADIV5_AP_DRW, value);
}
+uint16_t adiv5_ap_mem_read_halfword(ADIv5_AP_t *ap, uint32_t addr)
+{
+ adiv5_ap_write(ap, ADIV5_AP_CSW, 0xA2000051);
+ adiv5_ap_write(ap, ADIV5_AP_TAR, addr);
+ uint32_t v = adiv5_ap_read(ap, ADIV5_AP_DRW);
+ if (addr & 2)
+ return v >> 16;
+ else
+ return v & 0xFFFF;
+}
+
void adiv5_ap_mem_write_halfword(ADIv5_AP_t *ap, uint32_t addr, uint16_t value)
{
uint32_t v = value;