Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-sh / ptrace.h
blob792fc35bd6245c8551909a6dbf57b385b761fea6
1 #ifndef __ASM_SH_PTRACE_H
2 #define __ASM_SH_PTRACE_H
4 #include <asm/ubc.h>
6 /*
7 * Copyright (C) 1999, 2000 Niibe Yutaka
9 */
12 * GCC defines register number like this:
13 * -----------------------------
14 * 0 - 15 are integer registers
15 * 17 - 22 are control/special registers
16 * 24 - 39 fp registers
17 * 40 - 47 xd registers
18 * 48 - fpscr register
19 * -----------------------------
21 * We follows above, except:
22 * 16 --- program counter (PC)
23 * 22 --- syscall #
24 * 23 --- floating point communication register
26 #define REG_REG0 0
27 #define REG_REG15 15
29 #define REG_PC 16
31 #define REG_PR 17
32 #define REG_SR 18
33 #define REG_GBR 19
34 #define REG_MACH 20
35 #define REG_MACL 21
37 #define REG_SYSCALL 22
39 #define REG_FPREG0 23
40 #define REG_FPREG15 38
41 #define REG_XFREG0 39
42 #define REG_XFREG15 54
44 #define REG_FPSCR 55
45 #define REG_FPUL 56
47 /* options set using PTRACE_SETOPTIONS */
48 #define PTRACE_O_TRACESYSGOOD 0x00000001
51 * This struct defines the way the registers are stored on the
52 * kernel stack during a system call or other kernel entry.
54 struct pt_regs {
55 unsigned long regs[16];
56 unsigned long pc;
57 unsigned long pr;
58 unsigned long sr;
59 unsigned long gbr;
60 unsigned long mach;
61 unsigned long macl;
62 long tra;
66 * This struct defines the way the DSP registers are stored on the
67 * kernel stack during a system call or other kernel entry.
69 struct pt_dspregs {
70 unsigned long a1;
71 unsigned long a0g;
72 unsigned long a1g;
73 unsigned long m0;
74 unsigned long m1;
75 unsigned long a0;
76 unsigned long x0;
77 unsigned long x1;
78 unsigned long y0;
79 unsigned long y1;
80 unsigned long dsr;
81 unsigned long rs;
82 unsigned long re;
83 unsigned long mod;
86 #define PTRACE_GETDSPREGS 55
87 #define PTRACE_SETDSPREGS 56
89 #ifdef __KERNEL__
90 #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
91 #define instruction_pointer(regs) ((regs)->pc)
92 extern void show_regs(struct pt_regs *);
94 #ifdef CONFIG_SH_DSP
95 #define task_pt_regs(task) \
96 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
97 - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1)
98 #else
99 #define task_pt_regs(task) \
100 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
101 - sizeof(unsigned long)) - 1)
102 #endif
104 static inline unsigned long profile_pc(struct pt_regs *regs)
106 unsigned long pc = instruction_pointer(regs);
108 if (pc >= 0xa0000000UL && pc < 0xc0000000UL)
109 pc -= 0x20000000;
110 return pc;
112 #endif
114 #endif /* __ASM_SH_PTRACE_H */