Merge pull request #906 from MarekVCodasip/zero-no-cache

target/riscv: Don't write to zero.
This commit is contained in:
Tim Newsome 2023-08-30 10:59:54 -07:00 committed by GitHub
commit 699eecaab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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) ||