blob: bc16115af39b9e66c048b5e0237180f505535b77 [file] [log] [blame]
David Howellsaf170c52012-12-14 22:37:13 +00001#ifndef _UAPI_ASM_X86_PTRACE_H
2#define _UAPI_ASM_X86_PTRACE_H
3
4#include <linux/compiler.h> /* For __user */
5#include <asm/ptrace-abi.h>
6#include <asm/processor-flags.h>
7
8
9#ifndef __ASSEMBLY__
10
11#ifdef __i386__
12/* this struct defines the way the registers are stored on the
13 stack during a system call. */
14
15#ifndef __KERNEL__
16
17struct pt_regs {
18 long ebx;
19 long ecx;
20 long edx;
21 long esi;
22 long edi;
23 long ebp;
24 long eax;
25 int xds;
26 int xes;
27 int xfs;
28 int xgs;
29 long orig_eax;
30 long eip;
31 int xcs;
32 long eflags;
33 long esp;
34 int xss;
35};
36
37#endif /* __KERNEL__ */
38
39#else /* __i386__ */
40
41#ifndef __KERNEL__
42
43struct pt_regs {
Denys Vlasenkoe90e1472015-02-26 14:40:28 -080044/*
45 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
46 * unless syscall needs a complete, fully filled "struct pt_regs".
47 */
David Howellsaf170c52012-12-14 22:37:13 +000048 unsigned long r15;
49 unsigned long r14;
50 unsigned long r13;
51 unsigned long r12;
52 unsigned long rbp;
53 unsigned long rbx;
Denys Vlasenkoe90e1472015-02-26 14:40:28 -080054/* These regs are callee-clobbered. Always saved on kernel entry. */
David Howellsaf170c52012-12-14 22:37:13 +000055 unsigned long r11;
56 unsigned long r10;
57 unsigned long r9;
58 unsigned long r8;
59 unsigned long rax;
60 unsigned long rcx;
61 unsigned long rdx;
62 unsigned long rsi;
63 unsigned long rdi;
Denys Vlasenkoe90e1472015-02-26 14:40:28 -080064/*
65 * On syscall entry, this is syscall#. On CPU exception, this is error code.
66 * On hw interrupt, it's IRQ number:
67 */
David Howellsaf170c52012-12-14 22:37:13 +000068 unsigned long orig_rax;
Denys Vlasenkoe90e1472015-02-26 14:40:28 -080069/* Return frame for iretq */
David Howellsaf170c52012-12-14 22:37:13 +000070 unsigned long rip;
71 unsigned long cs;
72 unsigned long eflags;
73 unsigned long rsp;
74 unsigned long ss;
75/* top of stack page */
76};
77
78#endif /* __KERNEL__ */
79#endif /* !__i386__ */
80
81
82
83#endif /* !__ASSEMBLY__ */
84
85#endif /* _UAPI_ASM_X86_PTRACE_H */