Skip to content

Commit

Permalink
Merge pull request #906 from MarekVCodasip/zero-no-cache
Browse files Browse the repository at this point in the history
target/riscv: Don't write to zero.
  • Loading branch information
timsifive authored Aug 30, 2023
2 parents 5efea16 + 0b914fe commit 699eeca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/target/riscv/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4753,6 +4753,9 @@ unsigned int riscv_count_harts(struct target *target)
*/
static bool gdb_regno_cacheable(enum gdb_regno regno, bool is_write)
{
if (regno == GDB_REGNO_ZERO)
return !is_write;

/* GPRs, FPRs, vector registers are just normal data stores. */
if (regno <= GDB_REGNO_XPR31 ||
(regno >= GDB_REGNO_FPR0 && regno <= GDB_REGNO_FPR31) ||
Expand Down

0 comments on commit 699eeca

Please sign in to comment.