summaryrefslogtreecommitdiff
path: root/sim/m32r
diff options
context:
space:
mode:
Diffstat (limited to 'sim/m32r')
-rw-r--r--sim/m32r/ChangeLog6
-rw-r--r--sim/m32r/traps-linux.c37
-rw-r--r--sim/m32r/traps.c35
3 files changed, 35 insertions, 43 deletions
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index b915747f6b4..43aa13d0e7b 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,5 +1,11 @@
2015-06-17 Mike Frysinger <vapier@gentoo.org>
+ * traps.c (m32r_trap): Replace call to cb_syscall with
+ sim_syscall_multi.
+ * traps-linux.c (m32r_trap): Likewise.
+
+2015-06-17 Mike Frysinger <vapier@gentoo.org>
+
* traps-linux.c: Include sim-syscall.h.
(syscall_read_mem, syscall_write_mem): Delete.
(m32r_trap): Change syscall_read_mem/syscall_write_mem
diff --git a/sim/m32r/traps-linux.c b/sim/m32r/traps-linux.c
index 4b6384e48d6..8fee2a04b54 100644
--- a/sim/m32r/traps-linux.c
+++ b/sim/m32r/traps-linux.c
@@ -213,28 +213,21 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
{
case TRAP_ELF_SYSCALL :
{
- CB_SYSCALL s;
-
- CB_SYSCALL_INIT (&s);
- s.func = m32rbf_h_gr_get (current_cpu, 0);
- s.arg1 = m32rbf_h_gr_get (current_cpu, 1);
- s.arg2 = m32rbf_h_gr_get (current_cpu, 2);
- s.arg3 = m32rbf_h_gr_get (current_cpu, 3);
-
- if (s.func == TARGET_SYS_exit)
- {
- sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, s.arg1);
- }
-
- s.p1 = (PTR) sd;
- s.p2 = (PTR) current_cpu;
- 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);
- m32rbf_h_gr_set (current_cpu, 1, s.result2);
- break;
+ long result, result2;
+ int errcode;
+
+ sim_syscall_multi (current_cpu,
+ m32rbf_h_gr_get (current_cpu, 0),
+ m32rbf_h_gr_get (current_cpu, 1),
+ m32rbf_h_gr_get (current_cpu, 2),
+ m32rbf_h_gr_get (current_cpu, 3),
+ m32rbf_h_gr_get (current_cpu, 4),
+ &result, &result2, &errcode);
+
+ m32rbf_h_gr_set (current_cpu, 2, errcode);
+ m32rbf_h_gr_set (current_cpu, 0, result);
+ m32rbf_h_gr_set (current_cpu, 1, result2);
+ break;
}
case TRAP_LINUX_SYSCALL :
diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c
index 869b5966431..225c37fb2fc 100644
--- a/sim/m32r/traps.c
+++ b/sim/m32r/traps.c
@@ -129,27 +129,20 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
{
case TRAP_SYSCALL :
{
- CB_SYSCALL s;
-
- CB_SYSCALL_INIT (&s);
- s.func = m32rbf_h_gr_get (current_cpu, 0);
- s.arg1 = m32rbf_h_gr_get (current_cpu, 1);
- s.arg2 = m32rbf_h_gr_get (current_cpu, 2);
- s.arg3 = m32rbf_h_gr_get (current_cpu, 3);
-
- if (s.func == TARGET_SYS_exit)
- {
- sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, s.arg1);
- }
-
- s.p1 = (PTR) sd;
- s.p2 = (PTR) current_cpu;
- 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);
- m32rbf_h_gr_set (current_cpu, 1, s.result2);
+ long result, result2;
+ int errcode;
+
+ sim_syscall_multi (current_cpu,
+ m32rbf_h_gr_get (current_cpu, 0),
+ m32rbf_h_gr_get (current_cpu, 1),
+ m32rbf_h_gr_get (current_cpu, 2),
+ m32rbf_h_gr_get (current_cpu, 3),
+ m32rbf_h_gr_get (current_cpu, 4),
+ &result, &result2, &errcode);
+
+ m32rbf_h_gr_set (current_cpu, 2, errcode);
+ m32rbf_h_gr_set (current_cpu, 0, result);
+ m32rbf_h_gr_set (current_cpu, 1, result2);
break;
}