sim: syscall: unify memory helpers
[deliverable/binutils-gdb.git] / sim / bfin / interp.c
index 69b5e96d627976f8ffab0502f141d9acb4bfc047..07030da0036504ffd564f031f5aa2d3d4349a818 100644 (file)
@@ -32,6 +32,7 @@
 #include "gdb/callback.h"
 #include "gdb/signals.h"
 #include "sim-main.h"
+#include "sim-syscall.h"
 #include "sim-hw.h"
 
 #include "targ-vals.h"
@@ -125,32 +126,6 @@ count_argc (const char * const *argv)
   return i;
 }
 
-/* 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;
-
-  TRACE_CORE (cpu, "DBUS FETCH (syscall) %i bytes @ 0x%08lx", bytes, taddr);
-
-  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;
-
-  TRACE_CORE (cpu, "DBUS STORE (syscall) %i bytes @ 0x%08lx", bytes, taddr);
-
-  return sim_core_write_buffer (sd, cpu, write_map, buf, taddr, bytes);
-}
-
 /* Simulate a monitor trap, put the result into r0 and errno into r1
    return offset by which to adjust pc.  */
 
@@ -192,8 +167,8 @@ bfin_syscall (SIM_CPU *cpu)
     }
   sc.p1 = (PTR) sd;
   sc.p2 = (PTR) cpu;
-  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;
 
   /* Common cb_syscall() handles most functions.  */
   switch (cb_target_to_host_syscall (cb, sc.func))
This page took 0.029565 seconds and 4 git commands to generate.