diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-06-15 21:09:21 +0545 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-06-17 13:19:51 -0400 |
commit | 61a0c964e611eaf72489c3049ba206b2f91ea4a9 (patch) | |
tree | 386585a4f8d371d56225e968649dba301ec27801 /sim/mcore | |
parent | 6362a3f8757bfce133b724df2077573433823ad4 (diff) | |
download | gdb-61a0c964e611eaf72489c3049ba206b2f91ea4a9.zip gdb-61a0c964e611eaf72489c3049ba206b2f91ea4a9.tar.gz gdb-61a0c964e611eaf72489c3049ba206b2f91ea4a9.tar.bz2 |
sim: syscall: unify memory helpers
Almost every port implements these two callbacks in the same way, so
unify them in the common layer.
Diffstat (limited to 'sim/mcore')
-rw-r--r-- | sim/mcore/ChangeLog | 7 | ||||
-rw-r--r-- | sim/mcore/interp.c | 27 |
2 files changed, 10 insertions, 24 deletions
diff --git a/sim/mcore/ChangeLog b/sim/mcore/ChangeLog index 1b47b5e..389983d 100644 --- a/sim/mcore/ChangeLog +++ b/sim/mcore/ChangeLog @@ -1,3 +1,10 @@ +2015-06-17 Mike Frysinger <vapier@gentoo.org> + + * interp.c: Include sim-syscall.h. + (syscall_read_mem, syscall_write_mem): Delete. + (m32r_trap): Change syscall_read_mem/syscall_write_mem + to sim_syscall_read_mem/sim_syscall_write_mem. + 2015-06-12 Mike Frysinger <vapier@gentoo.org> * configure: Regenerate. diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c index c13dbd8..e77535b 100644 --- a/sim/mcore/interp.c +++ b/sim/mcore/interp.c @@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "sim-main.h" #include "sim-base.h" +#include "sim-syscall.h" #include "sim-options.h" #define target_big_endian (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN) @@ -197,28 +198,6 @@ set_initial_gprs (SIM_CPU *scpu) cpu.gr[PARM4] = cpu.gr[0]; } -/* Read/write functions for system call interface. */ - -static int -syscall_read_mem (host_callback *cb, struct cb_syscall *sc, - unsigned long taddr, char *buf, int bytes) -{ - SIM_DESC sd = (SIM_DESC) sc->p1; - SIM_CPU *cpu = (SIM_CPU *) sc->p2; - - return sim_core_read_buffer (sd, cpu, read_map, buf, taddr, bytes); -} - -static int -syscall_write_mem (host_callback *cb, struct cb_syscall *sc, - unsigned long taddr, const char *buf, int bytes) -{ - SIM_DESC sd = (SIM_DESC) sc->p1; - SIM_CPU *cpu = (SIM_CPU *) sc->p2; - - return sim_core_write_buffer (sd, cpu, write_map, buf, taddr, bytes); -} - /* Simulate a monitor trap. */ static void @@ -237,8 +216,8 @@ handle_trap1 (SIM_DESC sd) sc.p1 = (PTR) sd; sc.p2 = (PTR) STATE_CPU (sd, 0); - sc.read_mem = syscall_read_mem; - sc.write_mem = syscall_write_mem; + sc.read_mem = sim_syscall_read_mem; + sc.write_mem = sim_syscall_write_mem; cb_syscall (cb, &sc); |