ptrace.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
  7. * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  8. */
  9. #ifndef _UAPI_ASM_PTRACE_H
  10. #define _UAPI_ASM_PTRACE_H
  11. /* 0 - 31 are integer registers, 32 - 63 are fp registers. */
  12. #define FPR_BASE 32
  13. #define PC 64
  14. #define CAUSE 65
  15. #define BADVADDR 66
  16. #define MMHI 67
  17. #define MMLO 68
  18. #define FPC_CSR 69
  19. #define FPC_EIR 70
  20. #define DSP_BASE 71 /* 3 more hi / lo register pairs */
  21. #define DSP_CONTROL 77
  22. #define ACX 78
  23. /*
  24. * This struct defines the registers as used by PTRACE_{GET,SET}REGS. The
  25. * format is the same for both 32- and 64-bit processes. Registers for 32-bit
  26. * processes are sign extended.
  27. */
  28. #ifdef __KERNEL__
  29. struct user_pt_regs {
  30. #else
  31. struct pt_regs {
  32. #endif
  33. /* Saved main processor registers. */
  34. __u64 regs[32];
  35. /* Saved special registers. */
  36. __u64 lo;
  37. __u64 hi;
  38. __u64 cp0_epc;
  39. __u64 cp0_badvaddr;
  40. __u64 cp0_status;
  41. __u64 cp0_cause;
  42. } __attribute__ ((aligned (8)));
  43. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  44. #define PTRACE_GETREGS 12
  45. #define PTRACE_SETREGS 13
  46. #define PTRACE_GETFPREGS 14
  47. #define PTRACE_SETFPREGS 15
  48. /* #define PTRACE_GETFPXREGS 18 */
  49. /* #define PTRACE_SETFPXREGS 19 */
  50. #define PTRACE_OLDSETOPTIONS 21
  51. #define PTRACE_GET_THREAD_AREA 25
  52. #define PTRACE_SET_THREAD_AREA 26
  53. /* Calls to trace a 64bit program from a 32bit program. */
  54. #define PTRACE_PEEKTEXT_3264 0xc0
  55. #define PTRACE_PEEKDATA_3264 0xc1
  56. #define PTRACE_POKETEXT_3264 0xc2
  57. #define PTRACE_POKEDATA_3264 0xc3
  58. #define PTRACE_GET_THREAD_AREA_3264 0xc4
  59. /* Read and write watchpoint registers. */
  60. enum pt_watch_style {
  61. pt_watch_style_mips32,
  62. pt_watch_style_mips64
  63. };
  64. struct mips32_watch_regs {
  65. unsigned int watchlo[8];
  66. /* Lower 16 bits of watchhi. */
  67. unsigned short watchhi[8];
  68. /* Valid mask and I R W bits.
  69. * bit 0 -- 1 if W bit is usable.
  70. * bit 1 -- 1 if R bit is usable.
  71. * bit 2 -- 1 if I bit is usable.
  72. * bits 3 - 11 -- Valid watchhi mask bits.
  73. */
  74. unsigned short watch_masks[8];
  75. /* The number of valid watch register pairs. */
  76. unsigned int num_valid;
  77. } __attribute__((aligned(8)));
  78. struct mips64_watch_regs {
  79. unsigned long long watchlo[8];
  80. unsigned short watchhi[8];
  81. unsigned short watch_masks[8];
  82. unsigned int num_valid;
  83. } __attribute__((aligned(8)));
  84. struct pt_watch_regs {
  85. enum pt_watch_style style;
  86. union {
  87. struct mips32_watch_regs mips32;
  88. struct mips64_watch_regs mips64;
  89. };
  90. };
  91. #define PTRACE_GET_WATCH_REGS 0xd0
  92. #define PTRACE_SET_WATCH_REGS 0xd1
  93. #endif /* _UAPI_ASM_PTRACE_H */