1 #ifndef _METAG_PTRACE_H
2 #define _METAG_PTRACE_H
4 #include <linux/compiler.h>
5 #include <uapi/asm/ptrace.h>
10 /* this struct defines the way the registers are stored on the
11 stack during a system call. */
15 TBICTXEXTCB0 extcb0[5];
18 #define user_mode(regs) (((regs)->ctx.SaveMask & TBICTX_PRIV_BIT) > 0)
20 #define instruction_pointer(regs) ((unsigned long)(regs)->ctx.CurrPC)
21 #define profile_pc(regs) instruction_pointer(regs)
23 #define task_pt_regs(task) \
24 ((struct pt_regs *)(task_stack_page(task) + \
25 sizeof(struct thread_info)))
27 #define current_pt_regs() \
28 ((struct pt_regs *)((char *)current_thread_info() + \
29 sizeof(struct thread_info)))
31 int syscall_trace_enter(struct pt_regs *regs);
32 void syscall_trace_leave(struct pt_regs *regs);
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);
59 #endif /* __ASSEMBLY__ */
60 #endif /* _METAG_PTRACE_H */