aboutsummaryrefslogtreecommitdiff
path: root/sim/arm
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-26 21:53:30 +0545
committerMike Frysinger <vapier@gentoo.org>2022-10-31 21:24:39 +0545
commit5b94c3808140206d3b5204a3780f294d590cc458 (patch)
tree4b5bea9bdc30a6ab503bd3d1c289b5e6f20af836 /sim/arm
parentf2462532e24ebfc137598d73ee6541948121f040 (diff)
downloadgdb-5b94c3808140206d3b5204a3780f294d590cc458.zip
gdb-5b94c3808140206d3b5204a3780f294d590cc458.tar.gz
gdb-5b94c3808140206d3b5204a3780f294d590cc458.tar.bz2
sim: common: change sim_read & sim_write 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/arm')
-rw-r--r--sim/arm/wrapper.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index c97bae8..38a1f27 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -153,15 +153,16 @@ ARMul_ConsolePrint (ARMul_State * state,
int
sim_write (SIM_DESC sd ATTRIBUTE_UNUSED,
SIM_ADDR addr,
- const unsigned char * buffer,
+ const void * buffer,
int size)
{
int i;
+ const unsigned char * data = buffer;
init ();
for (i = 0; i < size; i++)
- ARMul_SafeWriteByte (state, addr + i, buffer[i]);
+ ARMul_SafeWriteByte (state, addr + i, data[i]);
return size;
}
@@ -169,15 +170,16 @@ sim_write (SIM_DESC sd ATTRIBUTE_UNUSED,
int
sim_read (SIM_DESC sd ATTRIBUTE_UNUSED,
SIM_ADDR addr,
- unsigned char * buffer,
+ void * buffer,
int size)
{
int i;
+ unsigned char * data = buffer;
init ();
for (i = 0; i < size; i++)
- buffer[i] = ARMul_SafeReadByte (state, addr + i);
+ data[i] = ARMul_SafeReadByte (state, addr + i);
return size;
}