1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 21da177e4SLinus Torvalds #ifndef _PTRACE32_H 31da177e4SLinus Torvalds #define _PTRACE32_H 41da177e4SLinus Torvalds 5eaf1b6fbSDan Smith #include <asm/ptrace.h> /* needed for NUM_CR_WORDS */ 663506c41SMartin Schwidefsky #include "compat_linux.h" /* needed for psw_compat_t */ 71da177e4SLinus Torvalds 85e9a2692SMartin Schwidefsky struct compat_per_struct_kernel { 95e9a2692SMartin Schwidefsky __u32 cr9; /* PER control bits */ 105e9a2692SMartin Schwidefsky __u32 cr10; /* PER starting address */ 115e9a2692SMartin Schwidefsky __u32 cr11; /* PER ending address */ 125e9a2692SMartin Schwidefsky __u32 bits; /* Obsolete software bits */ 135e9a2692SMartin Schwidefsky __u32 starting_addr; /* User specified start address */ 145e9a2692SMartin Schwidefsky __u32 ending_addr; /* User specified end address */ 155e9a2692SMartin Schwidefsky __u16 perc_atmid; /* PER trap ATMID */ 165e9a2692SMartin Schwidefsky __u32 address; /* PER trap instruction address */ 175e9a2692SMartin Schwidefsky __u8 access_id; /* PER trap access identification */ 185e9a2692SMartin Schwidefsky }; 191da177e4SLinus Torvalds 205e9a2692SMartin Schwidefsky struct compat_user_regs_struct 211da177e4SLinus Torvalds { 2263506c41SMartin Schwidefsky psw_compat_t psw; 231da177e4SLinus Torvalds u32 gprs[NUM_GPRS]; 241da177e4SLinus Torvalds u32 acrs[NUM_ACRS]; 251da177e4SLinus Torvalds u32 orig_gpr2; 263d6e48f4SJarod Wilson /* nb: there's a 4-byte hole here */ 271da177e4SLinus Torvalds s390_fp_regs fp_regs; 281da177e4SLinus Torvalds /* 291da177e4SLinus Torvalds * These per registers are in here so that gdb can modify them 301da177e4SLinus Torvalds * itself as there is no "official" ptrace interface for hardware 311da177e4SLinus Torvalds * watchpoints. This is the way intel does it. 321da177e4SLinus Torvalds */ 335e9a2692SMartin Schwidefsky struct compat_per_struct_kernel per_info; 34ba6cadfeSMartin Schwidefsky u32 ieee_instruction_pointer; /* obsolete, always 0 */ 351da177e4SLinus Torvalds }; 361da177e4SLinus Torvalds 375e9a2692SMartin Schwidefsky struct compat_user { 381da177e4SLinus Torvalds /* We start with the registers, to mimic the way that "memory" 391da177e4SLinus Torvalds is returned from the ptrace(3,...) function. */ 405e9a2692SMartin Schwidefsky struct compat_user_regs_struct regs; 411da177e4SLinus Torvalds /* The rest of this junk is to help gdb figure out what goes where */ 421da177e4SLinus Torvalds u32 u_tsize; /* Text segment size (pages). */ 431da177e4SLinus Torvalds u32 u_dsize; /* Data segment size (pages). */ 441da177e4SLinus Torvalds u32 u_ssize; /* Stack segment size (pages). */ 451da177e4SLinus Torvalds u32 start_code; /* Starting virtual address of text. */ 461da177e4SLinus Torvalds u32 start_stack; /* Starting virtual address of stack area. 471da177e4SLinus Torvalds This is actually the bottom of the stack, 481da177e4SLinus Torvalds the top of the stack is always found in the 491da177e4SLinus Torvalds esp register. */ 501da177e4SLinus Torvalds s32 signal; /* Signal that caused the core dump. */ 511da177e4SLinus Torvalds u32 u_ar0; /* Used by gdb to help find the values for */ 521da177e4SLinus Torvalds /* the registers. */ 531da177e4SLinus Torvalds u32 magic; /* To uniquely identify a core file */ 541da177e4SLinus Torvalds char u_comm[32]; /* User command that was responsible */ 551da177e4SLinus Torvalds }; 561da177e4SLinus Torvalds 571da177e4SLinus Torvalds typedef struct 581da177e4SLinus Torvalds { 591da177e4SLinus Torvalds __u32 len; 601da177e4SLinus Torvalds __u32 kernel_addr; 611da177e4SLinus Torvalds __u32 process_addr; 625e9a2692SMartin Schwidefsky } compat_ptrace_area; 631da177e4SLinus Torvalds 641da177e4SLinus Torvalds #endif /* _PTRACE32_H */ 65