diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 19:09:44 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 19:09:44 -0400 |
commit | f15cbe6f1a4b4d9df59142fc8e4abb973302cf44 (patch) | |
tree | 774d7b11abaaf33561ab8268bf51ddd9ceb79025 /arch/sh/include/asm/ptrace.h | |
parent | 25326277d8d1393d1c66240e6255aca780f9e3eb (diff) |
sh: migrate to arch/sh/include/
This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac.
Most of the moving about was done with Sam's directions at:
http://marc.info/?l=linux-sh&m=121724823706062&w=2
with subsequent hacking and fixups entirely my fault.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/ptrace.h')
-rw-r--r-- | arch/sh/include/asm/ptrace.h | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h new file mode 100644 index 000000000000..643ab5a7cf3b --- /dev/null +++ b/arch/sh/include/asm/ptrace.h | |||
@@ -0,0 +1,130 @@ | |||
1 | #ifndef __ASM_SH_PTRACE_H | ||
2 | #define __ASM_SH_PTRACE_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 1999, 2000 Niibe Yutaka | ||
6 | * | ||
7 | */ | ||
8 | #if defined(__SH5__) | ||
9 | struct pt_regs { | ||
10 | unsigned long long pc; | ||
11 | unsigned long long sr; | ||
12 | unsigned long long syscall_nr; | ||
13 | unsigned long long regs[63]; | ||
14 | unsigned long long tregs[8]; | ||
15 | unsigned long long pad[2]; | ||
16 | }; | ||
17 | #else | ||
18 | /* | ||
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 | ||
25 | * 48 - fpscr register | ||
26 | * ----------------------------- | ||
27 | * | ||
28 | * We follows above, except: | ||
29 | * 16 --- program counter (PC) | ||
30 | * 22 --- syscall # | ||
31 | * 23 --- floating point communication register | ||
32 | */ | ||
33 | #define REG_REG0 0 | ||
34 | #define REG_REG15 15 | ||
35 | |||
36 | #define REG_PC 16 | ||
37 | |||
38 | #define REG_PR 17 | ||
39 | #define REG_SR 18 | ||
40 | #define REG_GBR 19 | ||
41 | #define REG_MACH 20 | ||
42 | #define REG_MACL 21 | ||
43 | |||
44 | #define REG_SYSCALL 22 | ||
45 | |||
46 | #define REG_FPREG0 23 | ||
47 | #define REG_FPREG15 38 | ||
48 | #define REG_XFREG0 39 | ||
49 | #define REG_XFREG15 54 | ||
50 | |||
51 | #define REG_FPSCR 55 | ||
52 | #define REG_FPUL 56 | ||
53 | |||
54 | /* | ||
55 | * This struct defines the way the registers are stored on the | ||
56 | * kernel stack during a system call or other kernel entry. | ||
57 | */ | ||
58 | struct pt_regs { | ||
59 | unsigned long regs[16]; | ||
60 | unsigned long pc; | ||
61 | unsigned long pr; | ||
62 | unsigned long sr; | ||
63 | unsigned long gbr; | ||
64 | unsigned long mach; | ||
65 | unsigned long macl; | ||
66 | long tra; | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * This struct defines the way the DSP registers are stored on the | ||
71 | * kernel stack during a system call or other kernel entry. | ||
72 | */ | ||
73 | struct pt_dspregs { | ||
74 | unsigned long a1; | ||
75 | unsigned long a0g; | ||
76 | unsigned long a1g; | ||
77 | unsigned long m0; | ||
78 | unsigned long m1; | ||
79 | unsigned long a0; | ||
80 | unsigned long x0; | ||
81 | unsigned long x1; | ||
82 | unsigned long y0; | ||
83 | unsigned long y1; | ||
84 | unsigned long dsr; | ||
85 | unsigned long rs; | ||
86 | unsigned long re; | ||
87 | unsigned long mod; | ||
88 | }; | ||
89 | |||
90 | #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */ | ||
91 | |||
92 | #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ | ||
93 | #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ | ||
94 | |||
95 | #define PTRACE_GETDSPREGS 55 | ||
96 | #define PTRACE_SETDSPREGS 56 | ||
97 | #endif | ||
98 | |||
99 | #ifdef __KERNEL__ | ||
100 | #include <asm/addrspace.h> | ||
101 | |||
102 | #define user_mode(regs) (((regs)->sr & 0x40000000)==0) | ||
103 | #define instruction_pointer(regs) ((unsigned long)(regs)->pc) | ||
104 | |||
105 | extern void show_regs(struct pt_regs *); | ||
106 | |||
107 | #ifdef CONFIG_SH_DSP | ||
108 | #define task_pt_regs(task) \ | ||
109 | ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ | ||
110 | - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1) | ||
111 | #else | ||
112 | #define task_pt_regs(task) \ | ||
113 | ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ | ||
114 | - sizeof(unsigned long)) - 1) | ||
115 | #endif | ||
116 | |||
117 | static inline unsigned long profile_pc(struct pt_regs *regs) | ||
118 | { | ||
119 | unsigned long pc = instruction_pointer(regs); | ||
120 | |||
121 | #ifdef P2SEG | ||
122 | if (pc >= P2SEG && pc < P3SEG) | ||
123 | pc -= 0x20000000; | ||
124 | #endif | ||
125 | |||
126 | return pc; | ||
127 | } | ||
128 | #endif /* __KERNEL__ */ | ||
129 | |||
130 | #endif /* __ASM_SH_PTRACE_H */ | ||