Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _ASM_X86_PTRACE_ABI_H
0003 #define _ASM_X86_PTRACE_ABI_H
0004 
0005 #ifdef __i386__
0006 
0007 #define EBX 0
0008 #define ECX 1
0009 #define EDX 2
0010 #define ESI 3
0011 #define EDI 4
0012 #define EBP 5
0013 #define EAX 6
0014 #define DS 7
0015 #define ES 8
0016 #define FS 9
0017 #define GS 10
0018 #define ORIG_EAX 11
0019 #define EIP 12
0020 #define CS  13
0021 #define EFL 14
0022 #define UESP 15
0023 #define SS   16
0024 #define FRAME_SIZE 17
0025 
0026 #else /* __i386__ */
0027 
0028 #if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
0029 /*
0030  * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
0031  * unless syscall needs a complete, fully filled "struct pt_regs".
0032  */
0033 #define R15 0
0034 #define R14 8
0035 #define R13 16
0036 #define R12 24
0037 #define RBP 32
0038 #define RBX 40
0039 /* These regs are callee-clobbered. Always saved on kernel entry. */
0040 #define R11 48
0041 #define R10 56
0042 #define R9 64
0043 #define R8 72
0044 #define RAX 80
0045 #define RCX 88
0046 #define RDX 96
0047 #define RSI 104
0048 #define RDI 112
0049 /*
0050  * On syscall entry, this is syscall#. On CPU exception, this is error code.
0051  * On hw interrupt, it's IRQ number:
0052  */
0053 #define ORIG_RAX 120
0054 /* Return frame for iretq */
0055 #define RIP 128
0056 #define CS 136
0057 #define EFLAGS 144
0058 #define RSP 152
0059 #define SS 160
0060 #endif /* __ASSEMBLY__ */
0061 
0062 /* top of stack page */
0063 #define FRAME_SIZE 168
0064 
0065 #endif /* !__i386__ */
0066 
0067 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
0068 #define PTRACE_GETREGS            12
0069 #define PTRACE_SETREGS            13
0070 #define PTRACE_GETFPREGS          14
0071 #define PTRACE_SETFPREGS          15
0072 #define PTRACE_GETFPXREGS         18
0073 #define PTRACE_SETFPXREGS         19
0074 
0075 #define PTRACE_OLDSETOPTIONS      21
0076 
0077 /* only useful for access 32bit programs / kernels */
0078 #define PTRACE_GET_THREAD_AREA    25
0079 #define PTRACE_SET_THREAD_AREA    26
0080 
0081 #ifdef __x86_64__
0082 # define PTRACE_ARCH_PRCTL    30
0083 #endif
0084 
0085 #define PTRACE_SYSEMU         31
0086 #define PTRACE_SYSEMU_SINGLESTEP  32
0087 
0088 #define PTRACE_SINGLEBLOCK  33  /* resume execution until next branch */
0089 
0090 #ifndef __ASSEMBLY__
0091 #include <linux/types.h>
0092 #endif
0093 
0094 #endif /* _ASM_X86_PTRACE_ABI_H */