1
2 #ifndef _SPARC_PTRACE_H
3 #define _SPARC_PTRACE_H
4
5 #include <asm/psr.h>
6
7
8
9
10
11 #ifndef __ASSEMBLY__
12
13 struct pt_regs {
14 unsigned long psr;
15 unsigned long pc;
16 unsigned long npc;
17 unsigned long y;
18 unsigned long u_regs[16];
19 };
20
21 #define UREG_G0 0
22 #define UREG_G1 1
23 #define UREG_G2 2
24 #define UREG_G3 3
25 #define UREG_G4 4
26 #define UREG_G5 5
27 #define UREG_G6 6
28 #define UREG_G7 7
29 #define UREG_I0 8
30 #define UREG_I1 9
31 #define UREG_I2 10
32 #define UREG_I3 11
33 #define UREG_I4 12
34 #define UREG_I5 13
35 #define UREG_I6 14
36 #define UREG_I7 15
37 #define UREG_WIM UREG_G0
38 #define UREG_FP UREG_I6
39 #define UREG_RETPC UREG_I7
40
41
42 struct reg_window {
43 unsigned long locals[8];
44 unsigned long ins[8];
45 };
46
47
48
49 struct sparc_stackf {
50 unsigned long locals[8];
51 unsigned long ins[6];
52 struct sparc_stackf *fp;
53 unsigned long callers_pc;
54 char *structptr;
55 unsigned long xargs[6];
56 unsigned long xxargs[1];
57 };
58
59 #define TRACEREG_SZ sizeof(struct pt_regs)
60 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
61 #define REGWIN_SZ sizeof(struct reg_window)
62
63 #ifdef __KERNEL__
64 #define user_mode(regs) (!((regs)->psr & PSR_PS))
65 #define instruction_pointer(regs) ((regs)->pc)
66 extern void show_regs(struct pt_regs *);
67 #endif
68
69 #else
70
71 #define TRACEREG_SZ 0x50
72 #define STACKFRAME_SZ 0x60
73 #define REGWIN_SZ 0x40
74 #endif
75
76
77 #define TASK_STATE 0x000
78 #define TASK_PRIORITY 0x008
79 #define TASK_SIGNAL 0x00c
80 #define TASK_BLOCKED 0x010
81 #define TASK_FLAGS 0x014
82 #define TASK_SAVED_KSTACK 0x054
83 #define TASK_KSTACK_PG 0x058
84
85
86 #define THREAD_UMASK 0x210
87 #define THREAD_SADDR 0x218
88 #define THREAD_SDESC 0x21c
89 #define THREAD_KSP 0x220
90 #define THREAD_KPC 0x224
91 #define THREAD_KPSR 0x228
92 #define THREAD_KWIM 0x22c
93 #define THREAD_REG_WINDOW 0x230
94 #define THREAD_STACK_PTRS 0x430
95 #define THREAD_W_SAVED 0x450
96 #define THREAD_PGD_PTR 0x454
97 #define THREAD_CONTEXT 0x458
98 #define THREAD_FLOAT_REGS 0x460
99 #define THREAD_FSR 0x560
100 #define THREAD_SIGSTK 0x5e8
101
102
103 #define PT_PSR 0x0
104 #define PT_PC 0x4
105 #define PT_NPC 0x8
106 #define PT_Y 0xc
107 #define PT_G0 0x10
108 #define PT_WIM PT_G0
109 #define PT_G1 0x14
110 #define PT_G2 0x18
111 #define PT_G3 0x1c
112 #define PT_G4 0x20
113 #define PT_G5 0x24
114 #define PT_G6 0x28
115 #define PT_G7 0x2c
116 #define PT_I0 0x30
117 #define PT_I1 0x34
118 #define PT_I2 0x38
119 #define PT_I3 0x3c
120 #define PT_I4 0x40
121 #define PT_I5 0x44
122 #define PT_I6 0x48
123 #define PT_FP PT_I6
124 #define PT_I7 0x4c
125
126
127 #define RW_L0 0x00
128 #define RW_L1 0x04
129 #define RW_L2 0x08
130 #define RW_L3 0x0c
131 #define RW_L4 0x10
132 #define RW_L5 0x14
133 #define RW_L6 0x18
134 #define RW_L7 0x1c
135 #define RW_I0 0x20
136 #define RW_I1 0x24
137 #define RW_I2 0x28
138 #define RW_I3 0x2c
139 #define RW_I4 0x30
140 #define RW_I5 0x34
141 #define RW_I6 0x38
142 #define RW_I7 0x3c
143
144
145 #define SF_L0 0x00
146 #define SF_L1 0x04
147 #define SF_L2 0x08
148 #define SF_L3 0x0c
149 #define SF_L4 0x10
150 #define SF_L5 0x14
151 #define SF_L6 0x18
152 #define SF_L7 0x1c
153 #define SF_I0 0x20
154 #define SF_I1 0x24
155 #define SF_I2 0x28
156 #define SF_I3 0x2c
157 #define SF_I4 0x30
158 #define SF_I5 0x34
159 #define SF_FP 0x38
160 #define SF_PC 0x3c
161 #define SF_RETP 0x40
162 #define SF_XARG0 0x44
163 #define SF_XARG1 0x48
164 #define SF_XARG2 0x4c
165 #define SF_XARG3 0x50
166 #define SF_XARG4 0x54
167 #define SF_XARG5 0x58
168 #define SF_XXARG 0x5c
169
170 #endif