Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_ASM_X86_PTRACE_H
0003 #define _UAPI_ASM_X86_PTRACE_H
0004 
0005 #include <linux/compiler.h> /* For __user */
0006 #include <asm/ptrace-abi.h>
0007 #include <asm/processor-flags.h>
0008 
0009 
0010 #ifndef __ASSEMBLY__
0011 
0012 #ifdef __i386__
0013 /* this struct defines the way the registers are stored on the
0014    stack during a system call. */
0015 
0016 #ifndef __KERNEL__
0017 
0018 struct pt_regs {
0019     long ebx;
0020     long ecx;
0021     long edx;
0022     long esi;
0023     long edi;
0024     long ebp;
0025     long eax;
0026     int  xds;
0027     int  xes;
0028     int  xfs;
0029     int  xgs;
0030     long orig_eax;
0031     long eip;
0032     int  xcs;
0033     long eflags;
0034     long esp;
0035     int  xss;
0036 };
0037 
0038 #endif /* __KERNEL__ */
0039 
0040 #else /* __i386__ */
0041 
0042 #ifndef __KERNEL__
0043 
0044 struct pt_regs {
0045 /*
0046  * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
0047  * unless syscall needs a complete, fully filled "struct pt_regs".
0048  */
0049     unsigned long r15;
0050     unsigned long r14;
0051     unsigned long r13;
0052     unsigned long r12;
0053     unsigned long rbp;
0054     unsigned long rbx;
0055 /* These regs are callee-clobbered. Always saved on kernel entry. */
0056     unsigned long r11;
0057     unsigned long r10;
0058     unsigned long r9;
0059     unsigned long r8;
0060     unsigned long rax;
0061     unsigned long rcx;
0062     unsigned long rdx;
0063     unsigned long rsi;
0064     unsigned long rdi;
0065 /*
0066  * On syscall entry, this is syscall#. On CPU exception, this is error code.
0067  * On hw interrupt, it's IRQ number:
0068  */
0069     unsigned long orig_rax;
0070 /* Return frame for iretq */
0071     unsigned long rip;
0072     unsigned long cs;
0073     unsigned long eflags;
0074     unsigned long rsp;
0075     unsigned long ss;
0076 /* top of stack page */
0077 };
0078 
0079 #endif /* __KERNEL__ */
0080 #endif /* !__i386__ */
0081 
0082 
0083 
0084 #endif /* !__ASSEMBLY__ */
0085 
0086 #endif /* _UAPI_ASM_X86_PTRACE_H */