/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1#ifndef _UAPI_ASM_X86_PTRACE_H2#define _UAPI_ASM_X86_PTRACE_H34#include <linux/compiler.h> /* For __user */5#include <asm/ptrace-abi.h>6#include <asm/processor-flags.h>789#ifndef __ASSEMBLER__1011#ifdef __i386__12/* this struct defines the way the registers are stored on the13stack during a system call. */1415#ifndef __KERNEL__1617struct pt_regs {18long ebx;19long ecx;20long edx;21long esi;22long edi;23long ebp;24long eax;25int xds;26int xes;27int xfs;28int xgs;29long orig_eax;30long eip;31int xcs;32long eflags;33long esp;34int xss;35};3637#endif /* __KERNEL__ */3839#else /* __i386__ */4041#ifndef __KERNEL__4243struct pt_regs {44/*45* C ABI says these regs are callee-preserved. They aren't saved on kernel entry46* unless syscall needs a complete, fully filled "struct pt_regs".47*/48unsigned long r15;49unsigned long r14;50unsigned long r13;51unsigned long r12;52unsigned long rbp;53unsigned long rbx;54/* These regs are callee-clobbered. Always saved on kernel entry. */55unsigned long r11;56unsigned long r10;57unsigned long r9;58unsigned long r8;59unsigned long rax;60unsigned long rcx;61unsigned long rdx;62unsigned long rsi;63unsigned long rdi;64/*65* On syscall entry, this is syscall#. On CPU exception, this is error code.66* On hw interrupt, it's IRQ number:67*/68unsigned long orig_rax;69/* Return frame for iretq */70unsigned long rip;71unsigned long cs;72unsigned long eflags;73unsigned long rsp;74unsigned long ss;75/* top of stack page */76};7778#endif /* __KERNEL__ */79#endif /* !__i386__ */80818283#endif /* !__ASSEMBLER__ */8485#endif /* _UAPI_ASM_X86_PTRACE_H */868788