From ee1cffd3883c1d846ad58c1fb86559bb2f930361 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 31 Oct 2022 21:43:10 +0545 Subject: 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. --- sim/m32r/m32r.c | 4 ++-- sim/m32r/m32r2.c | 4 ++-- sim/m32r/m32rx.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sim/m32r') diff --git a/sim/m32r/m32r.c b/sim/m32r/m32r.c index f8573690aac..478a45c2586 100644 --- a/sim/m32r/m32r.c +++ b/sim/m32r/m32r.c @@ -58,7 +58,7 @@ m32r_decode_gdb_ctrl_regnum (int gdb_regnum) /* The contents of BUF are in target byte order. */ int -m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len) +m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len) { int size = m32rbf_register_size (rn); if (len != size) @@ -98,7 +98,7 @@ m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len /* The contents of BUF are in target byte order. */ int -m32rbf_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len) +m32rbf_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len) { int size = m32rbf_register_size (rn); if (len != size) diff --git a/sim/m32r/m32r2.c b/sim/m32r/m32r2.c index a057a4c0e3f..8881bc68081 100644 --- a/sim/m32r/m32r2.c +++ b/sim/m32r/m32r2.c @@ -30,7 +30,7 @@ /* The contents of BUF are in target byte order. */ int -m32r2f_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len) +m32r2f_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len) { return m32rbf_fetch_register (current_cpu, rn, buf, len); } @@ -38,7 +38,7 @@ m32r2f_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len /* The contents of BUF are in target byte order. */ int -m32r2f_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len) +m32r2f_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len) { return m32rbf_store_register (current_cpu, rn, buf, len); } diff --git a/sim/m32r/m32rx.c b/sim/m32r/m32rx.c index deafcbed446..e5724c5410d 100644 --- a/sim/m32r/m32rx.c +++ b/sim/m32r/m32rx.c @@ -30,7 +30,7 @@ along with this program. If not, see . */ /* The contents of BUF are in target byte order. */ int -m32rxf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len) +m32rxf_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len) { return m32rbf_fetch_register (current_cpu, rn, buf, len); } @@ -38,7 +38,7 @@ m32rxf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len /* The contents of BUF are in target byte order. */ int -m32rxf_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len) +m32rxf_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len) { return m32rbf_store_register (current_cpu, rn, buf, len); } -- cgit v1.2.1