linux-user/x86_64: Create target_ptrace.h

Remove the target_pt_regs structure from target_syscall.h.
Add target_user_regs_struct to target_ptrace.h, which matches
what is actually used on x86_64.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson
2025-08-28 14:41:40 +10:00
parent ff15e62d3f
commit 399313bb6d
2 changed files with 40 additions and 28 deletions
+40
View File
@@ -0,0 +1,40 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef X86_64_TARGET_PTRACE_H
#define X86_64_TARGET_PTRACE_H
/*
* The struct pt_regs in arch/x86/include/uapi/asm/ptrace.h has missing
* register values and is not used. See arch/x86/include/asm/user_64.h.
*/
struct target_user_regs_struct {
abi_ulong r15;
abi_ulong r14;
abi_ulong r13;
abi_ulong r12;
abi_ulong bp;
abi_ulong bx;
abi_ulong r11;
abi_ulong r10;
abi_ulong r9;
abi_ulong r8;
abi_ulong ax;
abi_ulong cx;
abi_ulong dx;
abi_ulong si;
abi_ulong di;
abi_ulong orig_ax;
abi_ulong ip;
abi_ulong cs;
abi_ulong flags;
abi_ulong sp;
abi_ulong ss;
abi_ulong fs_base;
abi_ulong gs_base;
abi_ulong ds;
abi_ulong es;
abi_ulong fs;
abi_ulong gs;
};
#endif /* X86_64_TARGET_PTRACE_H */
-28
View File
@@ -4,34 +4,6 @@
#define __USER_CS (0x33)
#define __USER_DS (0x2B)
struct target_pt_regs {
abi_ulong r15;
abi_ulong r14;
abi_ulong r13;
abi_ulong r12;
abi_ulong rbp;
abi_ulong rbx;
/* arguments: non interrupts/non tracing syscalls only save up to here */
abi_ulong r11;
abi_ulong r10;
abi_ulong r9;
abi_ulong r8;
abi_ulong rax;
abi_ulong rcx;
abi_ulong rdx;
abi_ulong rsi;
abi_ulong rdi;
abi_ulong orig_rax;
/* end of arguments */
/* cpu exception frame or undefined */
abi_ulong rip;
abi_ulong cs;
abi_ulong eflags;
abi_ulong rsp;
abi_ulong ss;
/* top of stack page */
};
/* Maximum number of LDT entries supported. */
#define TARGET_LDT_ENTRIES 8192
/* The size of each LDT entry. */