aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libsandbox/trace/linux/powerpc.c')
-rw-r--r--libsandbox/trace/linux/powerpc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libsandbox/trace/linux/powerpc.c b/libsandbox/trace/linux/powerpc.c
new file mode 100644
index 0000000..6e9152c
--- /dev/null
+++ b/libsandbox/trace/linux/powerpc.c
@@ -0,0 +1,30 @@
+/* 32-bit & 64-bit systems use the same syscall table, so handling
+ * multiple personalities is simple -- nothing to do!
+ */
+
+#define trace_reg_sysnum gpr[0]
+
+static long trace_raw_ret(void *vregs)
+{
+ trace_regs *regs = vregs;
+ return regs->gpr[3];
+}
+
+static void trace_set_ret(void *vregs, int err)
+{
+ trace_regs *regs = vregs;
+ regs->gpr[0] = -1;
+ regs->gpr[3] = err;
+ trace_set_regs(regs);
+}
+
+static unsigned long trace_arg(void *vregs, int num)
+{
+ trace_regs *regs = vregs;
+ if (num == 1)
+ return regs->orig_gpr3;
+ if (num < 7)
+ return regs->gpr[3 + num - 1];
+ else
+ return -1;
+}