From 4a0e1ceaed41df14fa3a4870c00c334a6dd8384f Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Tue, 9 Sep 2008 16:00:58 -0400 Subject: Add ia64 utrace support --- runtime/syscall.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'runtime/syscall.h') diff --git a/runtime/syscall.h b/runtime/syscall.h index 24e93463..8416fd1d 100644 --- a/runtime/syscall.h +++ b/runtime/syscall.h @@ -66,7 +66,15 @@ #define MUNMAP_SYSCALL_NO(tsk) 91 #define MREMAP_SYSCALL_NO(tsk) 163 #endif - + +#if defined(__ia64__) +#define MMAP_SYSCALL_NO(tsk) 1151 +#define MMAP2_SYSCALL_NO(tsk) 1172 +#define MPROTECT_SYSCALL_NO(tsk) 1155 +#define MUNMAP_SYSCALL_NO(tsk) 1152 +#define MREMAP_SYSCALL_NO(tsk) 1156 +#endif + #if !defined(MMAP_SYSCALL_NO) || !defined(MMAP2_SYSCALL_NO) \ || !defined(MPROTECT_SYSCALL_NO) || !defined(MUNMAP_SYSCALL_NO) \ || !defined(MREMAP_SYSCALL_NO) @@ -95,6 +103,14 @@ __stp_user_syscall_nr(struct pt_regs *regs) } #endif +#if defined(__ia64__) +static inline unsigned long +__stp_user_syscall_nr(struct pt_regs *regs) +{ + return regs->r15; +} +#endif + #if defined(__i386__) || defined(__x86_64__) static inline long * __stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs) @@ -129,6 +145,14 @@ __stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs) } #endif +#if defined(__ia64__) +static inline long * +__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs) +{ + return ®s->r8; +} +#endif + #if defined(__i386__) || defined(__x86_64__) static inline long * __stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, @@ -211,4 +235,25 @@ __stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, } #endif +#if defined(__ia64__) +static inline long * +__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, + unsigned int n) +{ + struct ia64_stap_get_arbsp_param pa; + if (n > 5) { + _stp_error("syscall arg > 5"); + return NULL; + } + + pa.ip = regs->cr_iip; + unw_init_running(ia64_stap_get_arbsp, &pa); + if (pa.address == 0) + return NULL; + + return ia64_rse_skip_regs(pa.address, n); + +} +#endif + #endif /* _SYSCALL_H_ */ -- cgit From 901a409a01da22778ea15f7b9f938885bdc38847 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Tue, 9 Sep 2008 16:01:37 -0400 Subject: Utrace on ia64 fast fetch-register support --- runtime/syscall.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'runtime/syscall.h') diff --git a/runtime/syscall.h b/runtime/syscall.h index 8416fd1d..24fc7b1c 100644 --- a/runtime/syscall.h +++ b/runtime/syscall.h @@ -236,23 +236,18 @@ __stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, #endif #if defined(__ia64__) +#define __stp_user_syscall_arg(task, regs, n) \ + ____stp_user_syscall_arg(task, regs, n, &c->unwaddr) + static inline long * -__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, - unsigned int n) +____stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs, + unsigned int n, unsigned long **cache) { - struct ia64_stap_get_arbsp_param pa; if (n > 5) { _stp_error("syscall arg > 5"); return NULL; } - - pa.ip = regs->cr_iip; - unw_init_running(ia64_stap_get_arbsp, &pa); - if (pa.address == 0) - return NULL; - - return ia64_rse_skip_regs(pa.address, n); - + return __ia64_fetch_register(n + 32, regs, cache); } #endif -- cgit