compat_ptrace.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef _PTRACE32_H
  2. #define _PTRACE32_H
  3. #include <asm/ptrace.h> /* needed for NUM_CR_WORDS */
  4. #include "compat_linux.h" /* needed for psw_compat_t */
  5. typedef struct {
  6. __u32 cr[NUM_CR_WORDS];
  7. } per_cr_words32;
  8. typedef struct {
  9. __u16 perc_atmid; /* 0x096 */
  10. __u32 address; /* 0x098 */
  11. __u8 access_id; /* 0x0a1 */
  12. } per_lowcore_words32;
  13. typedef struct {
  14. union {
  15. per_cr_words32 words;
  16. } control_regs;
  17. /*
  18. * Use these flags instead of setting em_instruction_fetch
  19. * directly they are used so that single stepping can be
  20. * switched on & off while not affecting other tracing
  21. */
  22. unsigned single_step : 1;
  23. unsigned instruction_fetch : 1;
  24. unsigned : 30;
  25. /*
  26. * These addresses are copied into cr10 & cr11 if single
  27. * stepping is switched off
  28. */
  29. __u32 starting_addr;
  30. __u32 ending_addr;
  31. union {
  32. per_lowcore_words32 words;
  33. } lowcore;
  34. } per_struct32;
  35. struct user_regs_struct32
  36. {
  37. psw_compat_t psw;
  38. u32 gprs[NUM_GPRS];
  39. u32 acrs[NUM_ACRS];
  40. u32 orig_gpr2;
  41. /* nb: there's a 4-byte hole here */
  42. s390_fp_regs fp_regs;
  43. /*
  44. * These per registers are in here so that gdb can modify them
  45. * itself as there is no "official" ptrace interface for hardware
  46. * watchpoints. This is the way intel does it.
  47. */
  48. per_struct32 per_info;
  49. u32 ieee_instruction_pointer;
  50. /* Used to give failing instruction back to user for ieee exceptions */
  51. };
  52. struct user32 {
  53. /* We start with the registers, to mimic the way that "memory"
  54. is returned from the ptrace(3,...) function. */
  55. struct user_regs_struct32 regs; /* Where the registers are actually stored */
  56. /* The rest of this junk is to help gdb figure out what goes where */
  57. u32 u_tsize; /* Text segment size (pages). */
  58. u32 u_dsize; /* Data segment size (pages). */
  59. u32 u_ssize; /* Stack segment size (pages). */
  60. u32 start_code; /* Starting virtual address of text. */
  61. u32 start_stack; /* Starting virtual address of stack area.
  62. This is actually the bottom of the stack,
  63. the top of the stack is always found in the
  64. esp register. */
  65. s32 signal; /* Signal that caused the core dump. */
  66. u32 u_ar0; /* Used by gdb to help find the values for */
  67. /* the registers. */
  68. u32 magic; /* To uniquely identify a core file */
  69. char u_comm[32]; /* User command that was responsible */
  70. };
  71. typedef struct
  72. {
  73. __u32 len;
  74. __u32 kernel_addr;
  75. __u32 process_addr;
  76. } ptrace_area_emu31;
  77. #endif /* _PTRACE32_H */