aboutsummaryrefslogtreecommitdiff
path: root/sim/m32r/traps-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/m32r/traps-linux.c')
-rw-r--r--sim/m32r/traps-linux.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/sim/m32r/traps-linux.c b/sim/m32r/traps-linux.c
index ba3da54..4b6384e 100644
--- a/sim/m32r/traps-linux.c
+++ b/sim/m32r/traps-linux.c
@@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-main.h"
+#include "sim-syscall.h"
#include "syscall.h"
#include "targ-vals.h"
#include <dirent.h>
@@ -113,28 +114,6 @@ m32r_core_signal (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia,
transfer, sig);
}
-/* 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);
-}
-
/* Translate target's address to host's address. */
static void *
@@ -249,8 +228,8 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
s.p1 = (PTR) sd;
s.p2 = (PTR) current_cpu;
- s.read_mem = syscall_read_mem;
- s.write_mem = syscall_write_mem;
+ s.read_mem = sim_syscall_read_mem;
+ s.write_mem = sim_syscall_write_mem;
cb_syscall (cb, &s);
m32rbf_h_gr_set (current_cpu, 2, s.errcode);
m32rbf_h_gr_set (current_cpu, 0, s.result);
@@ -290,8 +269,8 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
s.p1 = (PTR) sd;
s.p2 = (PTR) current_cpu;
- s.read_mem = syscall_read_mem;
- s.write_mem = syscall_write_mem;
+ s.read_mem = sim_syscall_read_mem;
+ s.write_mem = sim_syscall_write_mem;
result = 0;
result2 = 0;