From: Mike Frysinger Date: Sat, 24 Apr 2021 18:02:07 +0000 (-0400) Subject: sim: callback: inline PTR define X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=64654371d6324794d11131fc95c1bc4caaaf173d;p=binutils-gdb.git sim: callback: inline PTR define We require C11 now, so no need for these pre-ANSI C hacks. PTR is simply void*, so use that directly. --- diff --git a/include/sim/ChangeLog b/include/sim/ChangeLog index 3098bb9518f..a70d8f06cf2 100644 --- a/include/sim/ChangeLog +++ b/include/sim/ChangeLog @@ -1,3 +1,8 @@ +2021-05-14 Mike Frysinger + + * callback.h (p1, p2): Change PTR to void*. + (cb_host_to_target_stat): Likewise. + 2021-05-14 Mike Frysinger * callback.h (error): Replace __attribute__ with ATTRIBUTE_NORETURN. diff --git a/include/sim/callback.h b/include/sim/callback.h index d8dfd81a64c..87a61df0855 100644 --- a/include/sim/callback.h +++ b/include/sim/callback.h @@ -249,8 +249,8 @@ typedef struct cb_syscall { int errcode; /* Working space to be used by memory read/write callbacks. */ - PTR p1; - PTR p2; + void *p1; + void *p2; long x1,x2; /* Callbacks for reading/writing memory (e.g. for read/write syscalls). @@ -320,7 +320,7 @@ const char *cb_target_str_signal (host_callback *, int); /* Translate host stat struct to target. If stat struct ptr is NULL, just compute target stat struct size. Result is size of target stat struct or 0 if error. */ -int cb_host_to_target_stat (host_callback *, const struct stat *, PTR); +int cb_host_to_target_stat (host_callback *, const struct stat *, void *); /* Translate a value to target endian. */ void cb_store_target_endian (host_callback *, char *, int, long); diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index fb0f8a851c6..ac804647c17 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2021-05-14 Mike Frysinger + + * callback.c (cb_host_to_target_stat): Change PTR to void*. + * sim-syscall.c (sim_syscall_multi): Delete (PTR) casts. + 2021-05-14 Mike Frysinger * Make-common.in (callback_h, remote_sim_h): Update path. diff --git a/sim/common/callback.c b/sim/common/callback.c index 9e6d456e537..1b53823c418 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -946,7 +946,7 @@ cb_store_target_endian (host_callback *cb, char *p, int size, long val) or zero if an error occurred during the translation. */ int -cb_host_to_target_stat (host_callback *cb, const struct stat *hs, PTR ts) +cb_host_to_target_stat (host_callback *cb, const struct stat *hs, void *ts) { const char *m = cb->stat_map; char *p; diff --git a/sim/common/sim-syscall.c b/sim/common/sim-syscall.c index e91453d5ba1..9dbc71ac9fb 100644 --- a/sim/common/sim-syscall.c +++ b/sim/common/sim-syscall.c @@ -71,8 +71,8 @@ sim_syscall_multi (SIM_CPU *cpu, int func, long arg1, long arg2, long arg3, sc.arg3 = arg3; sc.arg4 = arg4; - sc.p1 = (PTR) sd; - sc.p2 = (PTR) cpu; + sc.p1 = sd; + sc.p2 = cpu; sc.read_mem = sim_syscall_read_mem; sc.write_mem = sim_syscall_write_mem;