1 #ifndef _METAG_PTRACE_H 2 #define _METAG_PTRACE_H 3 4 #include <linux/compiler.h> 5 #include <uapi/asm/ptrace.h> 6 #include <asm/tbx.h> 7 8 #ifndef __ASSEMBLY__ 9 10 /* this struct defines the way the registers are stored on the 11 stack during a system call. */ 12 13 struct pt_regs { 14 TBICTX ctx; 15 TBICTXEXTCB0 extcb0[5]; 16 }; 17 18 #define user_mode(regs) (((regs)->ctx.SaveMask & TBICTX_PRIV_BIT) > 0) 19 20 #define instruction_pointer(regs) ((unsigned long)(regs)->ctx.CurrPC) 21 #define profile_pc(regs) instruction_pointer(regs) 22 23 #define task_pt_regs(task) \ 24 ((struct pt_regs *)(task_stack_page(task) + \ 25 sizeof(struct thread_info))) 26 27 #define current_pt_regs() \ 28 ((struct pt_regs *)((char *)current_thread_info() + \ 29 sizeof(struct thread_info))) 30 31 int syscall_trace_enter(struct pt_regs *regs); 32 void syscall_trace_leave(struct pt_regs *regs); 33 34 /* copy a struct user_gp_regs out to user */ 35 int metag_gp_regs_copyout(const struct pt_regs *regs, 36 unsigned int pos, unsigned int count, 37 void *kbuf, void __user *ubuf); 38 /* copy a struct user_gp_regs in from user */ 39 int metag_gp_regs_copyin(struct pt_regs *regs, 40 unsigned int pos, unsigned int count, 41 const void *kbuf, const void __user *ubuf); 42 /* copy a struct user_cb_regs out to user */ 43 int metag_cb_regs_copyout(const struct pt_regs *regs, 44 unsigned int pos, unsigned int count, 45 void *kbuf, void __user *ubuf); 46 /* copy a struct user_cb_regs in from user */ 47 int metag_cb_regs_copyin(struct pt_regs *regs, 48 unsigned int pos, unsigned int count, 49 const void *kbuf, const void __user *ubuf); 50 /* copy a struct user_rp_state out to user */ 51 int metag_rp_state_copyout(const struct pt_regs *regs, 52 unsigned int pos, unsigned int count, 53 void *kbuf, void __user *ubuf); 54 /* copy a struct user_rp_state in from user */ 55 int metag_rp_state_copyin(struct pt_regs *regs, 56 unsigned int pos, unsigned int count, 57 const void *kbuf, const void __user *ubuf); 58 59 #endif /* __ASSEMBLY__ */ 60 #endif /* _METAG_PTRACE_H */ 61