compat_ptrace.h 2.1 KB

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