1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef __ASM_OPENRISC_PTRACE_H
17#define __ASM_OPENRISC_PTRACE_H
18
19#include <asm/spr-defs.h>
20
21#ifndef __ASSEMBLY__
22
23
24
25struct user_regs_struct {
26
27 unsigned long gpr[32];
28 unsigned long pc;
29 unsigned long sr;
30 unsigned long pad1;
31 unsigned long pad2;
32};
33#endif
34
35#ifdef __KERNEL__
36
37
38
39
40
41
42
43
44
45#ifndef __ASSEMBLY__
46
47
48
49
50
51
52
53
54
55struct pt_regs {
56 union {
57 struct {
58
59 long sr;
60 long sp;
61 };
62 struct {
63
64 long offset[2];
65 long gprs[30];
66 };
67 struct {
68
69 long gpr[32];
70 };
71 };
72 long pc;
73 long orig_gpr11;
74 long syscallno;
75 long dummy;
76};
77#endif
78
79
80#define STACK_FRAME_OVERHEAD 128
81
82#define instruction_pointer(regs) ((regs)->pc)
83#define user_mode(regs) (((regs)->sr & SPR_SR_SM) == 0)
84#define user_stack_pointer(regs) ((unsigned long)(regs)->sp)
85#define profile_pc(regs) instruction_pointer(regs)
86
87
88
89
90#define PT_SR 0
91#define PT_SP 4
92#define PT_GPR2 8
93#define PT_GPR3 12
94#define PT_GPR4 16
95#define PT_GPR5 20
96#define PT_GPR6 24
97#define PT_GPR7 28
98#define PT_GPR8 32
99#define PT_GPR9 36
100#define PT_GPR10 40
101#define PT_GPR11 44
102#define PT_GPR12 48
103#define PT_GPR13 52
104#define PT_GPR14 56
105#define PT_GPR15 60
106#define PT_GPR16 64
107#define PT_GPR17 68
108#define PT_GPR18 72
109#define PT_GPR19 76
110#define PT_GPR20 80
111#define PT_GPR21 84
112#define PT_GPR22 88
113#define PT_GPR23 92
114#define PT_GPR24 96
115#define PT_GPR25 100
116#define PT_GPR26 104
117#define PT_GPR27 108
118#define PT_GPR28 112
119#define PT_GPR29 116
120#define PT_GPR30 120
121#define PT_GPR31 124
122#define PT_PC 128
123#define PT_ORIG_GPR11 132
124#define PT_SYSCALLNO 136
125
126#endif
127
128#endif
129