summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/syscall.h48
2 files changed, 50 insertions, 3 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 1ad5aa20..6da5814c 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-24 David Smith <dsmith@redhat.com>
+
+ From: Srinivasa DS <srinivasa@in.ibm.com>
+ * syscall.h: Added powerpc support.
+
2008-06-23 David Smith <dsmith@redhat.com>
* task_finder.c (__stp_utrace_task_finder_target_quiesce): Fixed
diff --git a/runtime/syscall.h b/runtime/syscall.h
index 36fed2ff..3d1034e6 100644
--- a/runtime/syscall.h
+++ b/runtime/syscall.h
@@ -49,6 +49,13 @@
# endif
#endif
+#if defined(__powerpc__)
+#define MMAP_SYSCALL_NO(tsk) 90
+#define MPROTECT_SYSCALL_NO(tsk) 125
+#define MUNMAP_SYSCALL_NO(tsk) 91
+#define MREMAP_SYSCALL_NO(tsk) 163
+#endif
+
#if !defined(MMAP_SYSCALL_NO) || !defined(MPROTECT_SYSCALL_NO) \
|| !defined(MUNMAP_SYSCALL_NO) || !defined(MREMAP_SYSCALL_NO)
#error "Unimplemented architecture"
@@ -59,12 +66,20 @@ static inline unsigned long
__stp_user_syscall_nr(struct pt_regs *regs)
{
#if defined(STAPCONF_X86_UNIREGS)
- return regs->orig_ax;
+ return regs->orig_ax;
#elif defined(__x86_64__)
- return regs->orig_rax;
+ return regs->orig_rax;
#elif defined (__i386__)
- return regs->orig_eax;
+ return regs->orig_eax;
+#endif
+}
#endif
+
+#if defined(__powerpc__)
+static inline unsigned long
+__stp_user_syscall_nr(struct pt_regs *regs)
+{
+ return regs->gpr[0];
}
#endif
@@ -94,6 +109,14 @@ __stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
}
#endif
+#if defined(__powerpc__)
+static inline long *
+__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
+{
+ return &regs->gpr[3];
+}
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
static inline long *
__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
@@ -157,4 +180,23 @@ __stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
}
#endif
+#if defined(__powerpc__)
+static inline long *
+__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
+ unsigned int n)
+{
+ switch (n) {
+ case 0: return &regs->gpr[3];
+ case 1: return &regs->gpr[4];
+ case 2: return &regs->gpr[5];
+ case 3: return &regs->gpr[6];
+ case 4: return &regs->gpr[7];
+ case 5: return &regs->gpr[8];
+ default:
+ _stp_error("syscall arg > 5");
+ return NULL;
+ }
+}
+#endif
+
#endif /* _SYSCALL_H_ */