xref: /openbmc/u-boot/arch/x86/include/asm/ptrace.h (revision 7ca6f363)
1 #ifndef _I386_PTRACE_H
2 #define _I386_PTRACE_H
3 
4 #include <asm/types.h>
5 
6 #define EBX 0
7 #define ECX 1
8 #define EDX 2
9 #define ESI 3
10 #define EDI 4
11 #define EBP 5
12 #define EAX 6
13 #define DS 7
14 #define ES 8
15 #define FS 9
16 #define GS 10
17 #define ORIG_EAX 11
18 #define EIP 12
19 #define CS  13
20 #define EFL 14
21 #define UESP 15
22 #define SS   16
23 #define FRAME_SIZE 17
24 
25 /* this struct defines the way the registers are stored on the
26    stack during a system call. */
27 
28 struct pt_regs {
29 	long ebx;
30 	long ecx;
31 	long edx;
32 	long esi;
33 	long edi;
34 	long ebp;
35 	long eax;
36 	int  xds;
37 	int  xes;
38 	int  xfs;
39 	int  xgs;
40 	long orig_eax;
41 	long eip;
42 	int  xcs;
43 	long eflags;
44 	long esp;
45 	int  xss;
46 }  __attribute__ ((packed));
47 
48 struct irq_regs {
49 	/* Pushed by irq_common_entry */
50 	long ebx;
51 	long ecx;
52 	long edx;
53 	long esi;
54 	long edi;
55 	long ebp;
56 	long esp;
57 	long eax;
58 	long xds;
59 	long xes;
60 	long xfs;
61 	long xgs;
62 	long xss;
63 	/* Pushed by vector handler (irq_<num>) */
64 	long irq_id;
65 	/* Pushed by cpu in response to interrupt */
66 	long eip;
67 	long xcs;
68 	long eflags;
69 }  __attribute__ ((packed));
70 
71 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
72 #define PTRACE_GETREGS            12
73 #define PTRACE_SETREGS            13
74 #define PTRACE_GETFPREGS          14
75 #define PTRACE_SETFPREGS          15
76 #define PTRACE_GETFPXREGS         18
77 #define PTRACE_SETFPXREGS         19
78 
79 #define PTRACE_SETOPTIONS         21
80 
81 /* options set using PTRACE_SETOPTIONS */
82 #define PTRACE_O_TRACESYSGOOD     0x00000001
83 
84 #ifdef __KERNEL__
85 #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs))
86 #define instruction_pointer(regs) ((regs)->eip)
87 extern void show_regs(struct pt_regs *);
88 #endif
89 
90 #endif
91