aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-syscall.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-06-15 19:22:38 +0545
committerMike Frysinger <vapier@gentoo.org>2015-06-17 13:19:51 -0400
commit7d5c6c43ca8a5dd5491f4a58e977ec5501386ee3 (patch)
treebc347f539bd5eb379bd6b8ce9adef4cdff2a9248 /sim/common/sim-syscall.h
parent61a0c964e611eaf72489c3049ba206b2f91ea4a9 (diff)
downloadgdb-7d5c6c43ca8a5dd5491f4a58e977ec5501386ee3.zip
gdb-7d5c6c43ca8a5dd5491f4a58e977ec5501386ee3.tar.gz
gdb-7d5c6c43ca8a5dd5491f4a58e977ec5501386ee3.tar.bz2
sim: syscall: add common sim_syscall helpers
Many ports have the same sim syscall logic, so add some helpers to handle all the common details. The arches still have to deal with the unpacking and packing of the syscall arguments, but the rest of the sim<->callback glue is now shared.
Diffstat (limited to 'sim/common/sim-syscall.h')
-rw-r--r--sim/common/sim-syscall.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sim/common/sim-syscall.h b/sim/common/sim-syscall.h
index 3f231fe..7e74661 100644
--- a/sim/common/sim-syscall.h
+++ b/sim/common/sim-syscall.h
@@ -20,6 +20,21 @@
#ifndef SIM_SYSCALL_H
#define SIM_SYSCALL_H
+/* Perform a syscall on the behalf of the target program. The error/result are
+ normalized into a single value (like a lot of operating systems do). If you
+ want the split values, see the other function below.
+
+ Note: While cb_syscall requires you handle the exit syscall yourself, that is
+ not the case with these helpers.
+
+ Note: Types here match the gdb callback interface. */
+long sim_syscall (SIM_CPU *, int func, long arg1, long arg2, long arg3,
+ long arg4);
+
+/* Same as sim_syscall, but return the split values by referenced. */
+void sim_syscall_multi (SIM_CPU *, int func, long arg1, long arg2, long arg3,
+ long arg4, long *result, long *result2, int *errcode);
+
/* Simple memory callbacks for cb_syscall's read_mem/write_mem that assume
cb_syscall's p1 and p2 are set to the SIM_DESC and SIM_CPU respectively. */
int sim_syscall_read_mem (host_callback *, struct cb_syscall *, unsigned long,