aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-10 23:01:46 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-11 00:49:56 -0500
commit20617191e4813ac5dec0ca46931253f46b1719a3 (patch)
tree9877cd859a990218781d2de9b5819ce0a78eef09 /sim/ppc
parentc3c79ac5c456cc45bd658eec47a2d96166ba8c41 (diff)
downloadfsf-binutils-gdb-20617191e4813ac5dec0ca46931253f46b1719a3.zip
fsf-binutils-gdb-20617191e4813ac5dec0ca46931253f46b1719a3.tar.gz
fsf-binutils-gdb-20617191e4813ac5dec0ca46931253f46b1719a3.tar.bz2
sim: ppc: return register error when unhandled
We don't want to fallthru and use cooked_buf when we haven't initialized it to anything. Returning 0 indicates the register wasn't recognized.
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/psim.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index a08d389..645e29a 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -889,8 +889,7 @@ psim_read_register(psim *system,
default:
printf_filtered("psim_read_register(processor=%p,buf=%p,reg=%s) %s\n",
processor, buf, reg, "read of this register unimplemented");
- break;
-
+ return 0;
}
/* the PSIM internal values are in host order. To fetch raw data,
@@ -1077,8 +1076,7 @@ psim_write_register(psim *system,
printf_filtered("psim_write_register(processor=%p,cooked_buf=%p,reg=%s) %s\n",
processor, cooked_buf, reg,
"read of this register unimplemented");
- break;
-
+ return 0;
}
return description.size;