aboutsummaryrefslogtreecommitdiff
path: root/sim/or1k
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-31 21:43:10 +0545
committerMike Frysinger <vapier@gentoo.org>2022-11-02 20:31:10 +0545
commitee1cffd3883c1d846ad58c1fb86559bb2f930361 (patch)
tree650a83e14dc8dcb5e061093643102eca8163b461 /sim/or1k
parent26f228db710f54b54aea4d9a05214add0cf9f541 (diff)
downloadgdb-ee1cffd3883c1d846ad58c1fb86559bb2f930361.zip
gdb-ee1cffd3883c1d846ad58c1fb86559bb2f930361.tar.gz
gdb-ee1cffd3883c1d846ad58c1fb86559bb2f930361.tar.bz2
sim: common: change sim_{fetch,store}_register helpers to use void* buffers
When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
Diffstat (limited to 'sim/or1k')
-rw-r--r--sim/or1k/or1k-sim.h5
-rw-r--r--sim/or1k/or1k.c6
2 files changed, 4 insertions, 7 deletions
diff --git a/sim/or1k/or1k-sim.h b/sim/or1k/or1k-sim.h
index 045f171..4172720 100644
--- a/sim/or1k/or1k-sim.h
+++ b/sim/or1k/or1k-sim.h
@@ -68,10 +68,9 @@ void or1k32bf_nop (sim_cpu *current_cpu, USI uimm16);
USI or1k32bf_mfspr (sim_cpu *current_cpu, USI addr);
void or1k32bf_mtspr (sim_cpu *current_cpu, USI addr, USI val);
-int or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf,
+int or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, void *buf, int len);
+int or1k32bf_store_register (sim_cpu *current_cpu, int rn, const void *buf,
int len);
-int or1k32bf_store_register (sim_cpu *current_cpu, int rn,
- const unsigned char *buf, int len);
int or1k32bf_model_or1200_u_exec (sim_cpu *current_cpu, const IDESC *idesc,
int unit_num, int referenced);
int or1k32bf_model_or1200nd_u_exec (sim_cpu *current_cpu, const IDESC *idesc,
diff --git a/sim/or1k/or1k.c b/sim/or1k/or1k.c
index 488d756..1d2d51f 100644
--- a/sim/or1k/or1k.c
+++ b/sim/or1k/or1k.c
@@ -31,8 +31,7 @@
#include <string.h>
int
-or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf,
- int len)
+or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, void *buf, int len)
{
if (rn < 32)
SETTWI (buf, GET_H_GPR (rn));
@@ -55,8 +54,7 @@ or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf,
}
int
-or1k32bf_store_register (sim_cpu *current_cpu, int rn, const unsigned char *buf,
- int len)
+or1k32bf_store_register (sim_cpu *current_cpu, int rn, const void *buf, int len)
{
if (rn < 32)
SET_H_GPR (rn, GETTWI (buf));