diff options
author | David Smith <dsmith@redhat.com> | 2008-06-24 08:33:51 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2008-06-24 08:33:51 -0500 |
commit | 8548f326bbbc5c99d692757618f4a7260b552de9 (patch) | |
tree | 823f9fcfe637290c0eda62427ec990a370f54ad0 /runtime/syscall.h | |
parent | 57286c7da57d75173149c733b00474d256af6b36 (diff) | |
download | systemtap-steved-8548f326bbbc5c99d692757618f4a7260b552de9.tar.gz systemtap-steved-8548f326bbbc5c99d692757618f4a7260b552de9.tar.xz systemtap-steved-8548f326bbbc5c99d692757618f4a7260b552de9.zip |
Added powerpc support to runtime/syscall.h.
2008-06-24 David Smith <dsmith@redhat.com>
From: Srinivasa DS <srinivasa@in.ibm.com>
* syscall.h: Added powerpc support.
Diffstat (limited to 'runtime/syscall.h')
-rw-r--r-- | runtime/syscall.h | 48 |
1 files changed, 45 insertions, 3 deletions
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 ®s->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 ®s->gpr[3]; + case 1: return ®s->gpr[4]; + case 2: return ®s->gpr[5]; + case 3: return ®s->gpr[6]; + case 4: return ®s->gpr[7]; + case 5: return ®s->gpr[8]; + default: + _stp_error("syscall arg > 5"); + return NULL; + } +} +#endif + #endif /* _SYSCALL_H_ */ |