mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
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.
This commit is contained in:
@ -329,23 +329,25 @@ sim_fetch_register(SIM_DESC sd, int regno, unsigned char *buf, int length)
|
||||
}
|
||||
|
||||
int
|
||||
sim_write (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
|
||||
sim_write (SIM_DESC sd, SIM_ADDR mem, const void *buffer, int length)
|
||||
{
|
||||
int i, len;
|
||||
const unsigned char *data = buffer;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
sis_memory_write ((mem + i) ^ EBT, &buf[i], 1);
|
||||
sis_memory_write ((mem + i) ^ EBT, &data[i], 1);
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
int
|
||||
sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
|
||||
sim_read (SIM_DESC sd, SIM_ADDR mem, void *buffer, int length)
|
||||
{
|
||||
int i, len;
|
||||
unsigned char *data = buffer;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
sis_memory_read ((mem + i) ^ EBT, &buf[i], 1);
|
||||
sis_memory_read ((mem + i) ^ EBT, &data[i], 1);
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
Reference in New Issue
Block a user