2016-01-20 05:19:53 +01:00
|
|
|
#ifndef _UAPI_ASM_X86_PTRACE_H
|
|
|
|
#define _UAPI_ASM_X86_PTRACE_H
|
|
|
|
|
|
|
|
#include <linux/compiler.h> /* For __user */
|
|
|
|
#include <asm/ptrace-abi.h>
|
|
|
|
#include <asm/processor-flags.h>
|
2014-12-27 16:42:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
2016-01-20 05:19:53 +01:00
|
|
|
|
2014-12-27 16:42:08 +01:00
|
|
|
#ifdef __i386__
|
2016-01-20 05:19:53 +01:00
|
|
|
/* this struct defines the way the registers are stored on the
|
|
|
|
stack during a system call. */
|
|
|
|
|
|
|
|
#ifndef __KERNEL__
|
2014-12-27 16:42:08 +01:00
|
|
|
|
|
|
|
struct pt_regs {
|
2016-01-20 05:19:53 +01:00
|
|
|
long ebx;
|
|
|
|
long ecx;
|
|
|
|
long edx;
|
|
|
|
long esi;
|
|
|
|
long edi;
|
|
|
|
long ebp;
|
|
|
|
long eax;
|
|
|
|
int xds;
|
|
|
|
int xes;
|
|
|
|
int xfs;
|
|
|
|
int xgs;
|
|
|
|
long orig_eax;
|
|
|
|
long eip;
|
|
|
|
int xcs;
|
|
|
|
long eflags;
|
|
|
|
long esp;
|
|
|
|
int xss;
|
2014-12-27 16:42:08 +01:00
|
|
|
};
|
|
|
|
|
2016-01-20 05:19:53 +01:00
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
|
2014-12-27 16:42:08 +01:00
|
|
|
#else /* __i386__ */
|
|
|
|
|
2016-01-20 05:19:53 +01:00
|
|
|
#ifndef __KERNEL__
|
|
|
|
|
2014-12-27 16:42:08 +01:00
|
|
|
struct pt_regs {
|
2016-01-20 05:19:53 +01:00
|
|
|
/*
|
|
|
|
* C ABI says these regs are callee-preserved. They aren't saved on kernel entry
|
|
|
|
* unless syscall needs a complete, fully filled "struct pt_regs".
|
|
|
|
*/
|
2014-12-27 16:42:08 +01:00
|
|
|
unsigned long r15;
|
|
|
|
unsigned long r14;
|
|
|
|
unsigned long r13;
|
|
|
|
unsigned long r12;
|
2016-01-20 05:19:53 +01:00
|
|
|
unsigned long rbp;
|
|
|
|
unsigned long rbx;
|
|
|
|
/* These regs are callee-clobbered. Always saved on kernel entry. */
|
2014-12-27 16:42:08 +01:00
|
|
|
unsigned long r11;
|
|
|
|
unsigned long r10;
|
|
|
|
unsigned long r9;
|
|
|
|
unsigned long r8;
|
2016-01-20 05:19:53 +01:00
|
|
|
unsigned long rax;
|
|
|
|
unsigned long rcx;
|
|
|
|
unsigned long rdx;
|
|
|
|
unsigned long rsi;
|
|
|
|
unsigned long rdi;
|
|
|
|
/*
|
|
|
|
* On syscall entry, this is syscall#. On CPU exception, this is error code.
|
|
|
|
* On hw interrupt, it's IRQ number:
|
|
|
|
*/
|
|
|
|
unsigned long orig_rax;
|
|
|
|
/* Return frame for iretq */
|
|
|
|
unsigned long rip;
|
2014-12-27 16:42:08 +01:00
|
|
|
unsigned long cs;
|
2016-01-20 05:19:53 +01:00
|
|
|
unsigned long eflags;
|
|
|
|
unsigned long rsp;
|
2014-12-27 16:42:08 +01:00
|
|
|
unsigned long ss;
|
|
|
|
/* top of stack page */
|
|
|
|
};
|
|
|
|
|
2016-01-20 05:19:53 +01:00
|
|
|
#endif /* __KERNEL__ */
|
2014-12-27 16:42:08 +01:00
|
|
|
#endif /* !__i386__ */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
2016-01-20 05:19:53 +01:00
|
|
|
|
|
|
|
#endif /* _UAPI_ASM_X86_PTRACE_H */
|