diff options
author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-04-14 19:55:32 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@dabbelt.com> | 2017-04-14 19:55:32 -0700 |
commit | 4af702c9c43b7d904d3de42147777aca96bf3b84 (patch) | |
tree | f16476b7f332dc9edf8ce6b1f354930ab9d82fbd | |
parent | 763e5cb44c2e8d40b147d0585e146e5ce6be6411 (diff) | |
download | riscv-openocd-newprogram.zip riscv-openocd-newprogram.tar.gz riscv-openocd-newprogram.tar.bz2 |
stwnewprogram
-rw-r--r-- | src/target/riscv/program.c | 3 | ||||
-rw-r--r-- | src/target/riscv/riscv-013.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/target/riscv/program.c b/src/target/riscv/program.c index 5bdee2f..182b1e3 100644 --- a/src/target/riscv/program.c +++ b/src/target/riscv/program.c @@ -111,6 +111,9 @@ riscv_addr_t riscv_program_alloc_data(struct riscv_program *p, size_t bytes) } LOG_DEBUG("allocated %d bytes at 0x%08lx", bytes, addr); + p->data_count = + + riscv_debug_buffer_size(p->target) + - (addr - riscv_debug_buffer_addr(p->target)) / sizeof(p->debug_buffer[0]); return addr; } diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index c71597f..6508629 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -1234,8 +1234,8 @@ static int read_memory(struct target *target, uint32_t address, struct riscv_program program; riscv_program_init(&program, target); - riscv_addr_t r_addr = riscv_program_alloc_x(&program); riscv_addr_t r_data = riscv_program_alloc_w(&program); + riscv_addr_t r_addr = riscv_program_alloc_x(&program); riscv_program_lx(&program, GDB_REGNO_S0, r_addr); switch (size) { case 1: @@ -1338,8 +1338,8 @@ static int write_memory(struct target *target, uint32_t address, struct riscv_program program; riscv_program_init(&program, target); - riscv_addr_t r_addr = riscv_program_alloc_x(&program); riscv_addr_t r_data = riscv_program_alloc_w(&program); + riscv_addr_t r_addr = riscv_program_alloc_x(&program); riscv_program_lx(&program, GDB_REGNO_S0, r_addr); riscv_program_lw(&program, GDB_REGNO_S1, r_data); @@ -1707,8 +1707,6 @@ static void riscv013_step_or_resume_current_hart(struct target *target, bool ste continue; if (step && get_field(dmstatus, DMI_DMSTATUS_ALLHALTED) == 0) continue; - if (!step && get_field(dmstatus, DMI_DMSTATUS_ALLRUNNING) == 0) - continue; dmcontrol = set_field(dmcontrol, DMI_DMCONTROL_RESUMEREQ, 0); dmi_write(target, DMI_DMCONTROL, dmcontrol); |