^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _PTRACE32_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _PTRACE32_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <asm/ptrace.h> /* needed for NUM_CR_WORDS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include "compat_linux.h" /* needed for psw_compat_t */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) struct compat_per_struct_kernel {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) __u32 cr9; /* PER control bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) __u32 cr10; /* PER starting address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) __u32 cr11; /* PER ending address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) __u32 bits; /* Obsolete software bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) __u32 starting_addr; /* User specified start address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) __u32 ending_addr; /* User specified end address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) __u16 perc_atmid; /* PER trap ATMID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) __u32 address; /* PER trap instruction address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __u8 access_id; /* PER trap access identification */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct compat_user_regs_struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) psw_compat_t psw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) u32 gprs[NUM_GPRS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) u32 acrs[NUM_ACRS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) u32 orig_gpr2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /* nb: there's a 4-byte hole here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) s390_fp_regs fp_regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * These per registers are in here so that gdb can modify them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * itself as there is no "official" ptrace interface for hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * watchpoints. This is the way intel does it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct compat_per_struct_kernel per_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) u32 ieee_instruction_pointer; /* obsolete, always 0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct compat_user {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) /* We start with the registers, to mimic the way that "memory"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) is returned from the ptrace(3,...) function. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct compat_user_regs_struct regs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /* The rest of this junk is to help gdb figure out what goes where */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) u32 u_tsize; /* Text segment size (pages). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) u32 u_dsize; /* Data segment size (pages). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) u32 u_ssize; /* Stack segment size (pages). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) u32 start_code; /* Starting virtual address of text. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) u32 start_stack; /* Starting virtual address of stack area.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) This is actually the bottom of the stack,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) the top of the stack is always found in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) esp register. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) s32 signal; /* Signal that caused the core dump. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) u32 u_ar0; /* Used by gdb to help find the values for */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) /* the registers. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) u32 magic; /* To uniquely identify a core file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) char u_comm[32]; /* User command that was responsible */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) typedef struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) __u32 len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __u32 kernel_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __u32 process_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) } compat_ptrace_area;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #endif /* _PTRACE32_H */