1 #ifndef __ASM_SH_PTRACE_H
2 #define __ASM_SH_PTRACE_H
5 * Copyright (C) 1999, 2000 Niibe Yutaka
10 unsigned long long pc
;
11 unsigned long long sr
;
13 unsigned long long regs
[63];
14 unsigned long long tregs
[8];
15 unsigned long long pad
[2];
19 * GCC defines register number like this:
20 * -----------------------------
21 * 0 - 15 are integer registers
22 * 17 - 22 are control/special registers
23 * 24 - 39 fp registers
24 * 40 - 47 xd registers
26 * -----------------------------
28 * We follows above, except:
29 * 16 --- program counter (PC)
31 * 23 --- floating point communication register
44 #define REG_SYSCALL 22
47 #define REG_FPREG15 38
49 #define REG_XFREG15 54
55 * This struct defines the way the registers are stored on the
56 * kernel stack during a system call or other kernel entry.
59 unsigned long regs
[16];
70 * This struct defines the way the DSP registers are stored on the
71 * kernel stack during a system call or other kernel entry.
91 #define PTRACE_GETREGS 12 /* General registers */
92 #define PTRACE_SETREGS 13
94 #define PTRACE_GETFPREGS 14 /* FPU registers */
95 #define PTRACE_SETFPREGS 15
97 #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
99 #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
100 #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
102 #define PTRACE_GETDSPREGS 55 /* DSP registers */
103 #define PTRACE_SETDSPREGS 56
106 #include <asm/addrspace.h>
108 #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
109 #define instruction_pointer(regs) ((unsigned long)(regs)->pc)
111 extern void show_regs(struct pt_regs
*);
114 * These are defined as per linux/ptrace.h.
118 #define arch_has_single_step() (1)
119 extern void user_enable_single_step(struct task_struct
*);
120 extern void user_disable_single_step(struct task_struct
*);
122 #define task_pt_regs(task) \
123 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1)
125 static inline unsigned long profile_pc(struct pt_regs
*regs
)
127 unsigned long pc
= instruction_pointer(regs
);
130 if (pc
>= P2SEG
&& pc
< P3SEG
)
136 #endif /* __KERNEL__ */
138 #endif /* __ASM_SH_PTRACE_H */