From 91e544d66c6a7cb567908b14ba473330e5aef853 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Wed, 30 May 2018 17:48:48 -0700 Subject: [PATCH] Invalidate the register cache more often --- src/target/riscv/riscv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 123d8de03..f60e2433e 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1627,6 +1627,8 @@ int riscv_halt_all_harts(struct target *target) riscv_halt_one_hart(target, i); } + riscv_invalidate_register_cache(target); + return ERROR_OK; } @@ -1752,6 +1754,7 @@ int riscv_set_current_hartid(struct target *target, int hartid) if (!target_was_examined(target)) return ERROR_OK; +#if 0 /* Avoid invalidating the register cache all the time. */ if (r->registers_initialized && (!riscv_rtos_enabled(target) || (previous_hartid == hartid)) @@ -1759,6 +1762,7 @@ int riscv_set_current_hartid(struct target *target, int hartid) return ERROR_OK; } else LOG_DEBUG("Initializing registers: xlen=%d", riscv_xlen(target)); +#endif riscv_invalidate_register_cache(target); return ERROR_OK;