aboutsummaryrefslogtreecommitdiff
path: root/sim/msp430
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-06-15 21:09:21 +0545
committerMike Frysinger <vapier@gentoo.org>2015-06-17 13:19:51 -0400
commit61a0c964e611eaf72489c3049ba206b2f91ea4a9 (patch)
tree386585a4f8d371d56225e968649dba301ec27801 /sim/msp430
parent6362a3f8757bfce133b724df2077573433823ad4 (diff)
downloadgdb-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/msp430')
-rw-r--r--sim/msp430/ChangeLog7
-rw-r--r--sim/msp430/msp430-sim.c25
2 files changed, 10 insertions, 22 deletions
diff --git a/sim/msp430/ChangeLog b/sim/msp430/ChangeLog
index 7f8fed6..d26f3f4 100644
--- a/sim/msp430/ChangeLog
+++ b/sim/msp430/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * msp430-sim.c: Include sim-syscall.h.
+ (syscall_read_mem, syscall_write_mem): Delete.
+ (maybe_perform_syscall): 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/msp430/msp430-sim.c b/sim/msp430/msp430-sim.c
index b652f08..650584a 100644
--- a/sim/msp430/msp430-sim.c
+++ b/sim/msp430/msp430-sim.c
@@ -29,6 +29,7 @@
#include "bfd.h"
#include "opcode/msp430-decode.h"
#include "sim-main.h"
+#include "sim-syscall.h"
#include "dis-asm.h"
#include "targ-vals.h"
#include "trace.h"
@@ -949,26 +950,6 @@ binary_to_bcd (int v)
return r;
}
-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);
-}
-
static const char *
cond_string (int cond)
{
@@ -1089,8 +1070,8 @@ maybe_perform_syscall (SIM_DESC sd, int call_addr)
sc.p1 = sd;
sc.p2 = MSP430_CPU (sd);
- 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);