ptrace.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #ifndef __KERNEL__
  24. /*
  25. * This struct defines the way the registers are stored on the stack during a
  26. * system call/exception. As usual the registers k0/k1 aren't being saved.
  27. */
  28. struct pt_regs {
  29. /* Saved main processor registers. */
  30. unsigned long regs[32];
  31. /* Saved special registers. */
  32. unsigned long cp0_status;
  33. unsigned long hi;
  34. unsigned long lo;
  35. unsigned long cp0_badvaddr;
  36. unsigned long cp0_cause;
  37. unsigned long cp0_epc;
  38. } __attribute__ ((aligned (8)));
  39. #endif /* __KERNEL__ */
  40. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  41. #define PTRACE_GETREGS 12
  42. #define PTRACE_SETREGS 13
  43. #define PTRACE_GETFPREGS 14
  44. #define PTRACE_SETFPREGS 15
  45. /* #define PTRACE_GETFPXREGS 18 */
  46. /* #define PTRACE_SETFPXREGS 19 */
  47. #define PTRACE_OLDSETOPTIONS 21
  48. #define PTRACE_GET_THREAD_AREA 25
  49. #define PTRACE_SET_THREAD_AREA 26
  50. /* Calls to trace a 64bit program from a 32bit program. */
  51. #define PTRACE_PEEKTEXT_3264 0xc0
  52. #define PTRACE_PEEKDATA_3264 0xc1
  53. #define PTRACE_POKETEXT_3264 0xc2
  54. #define PTRACE_POKEDATA_3264 0xc3
  55. #define PTRACE_GET_THREAD_AREA_3264 0xc4
  56. /* Read and write watchpoint registers. */
  57. enum pt_watch_style {
  58. pt_watch_style_mips32,
  59. pt_watch_style_mips64
  60. };
  61. struct mips32_watch_regs {
  62. unsigned int watchlo[8];
  63. /* Lower 16 bits of watchhi. */
  64. unsigned short watchhi[8];
  65. /* Valid mask and I R W bits.
  66. * bit 0 -- 1 if W bit is usable.
  67. * bit 1 -- 1 if R bit is usable.
  68. * bit 2 -- 1 if I bit is usable.
  69. * bits 3 - 11 -- Valid watchhi mask bits.
  70. */
  71. unsigned short watch_masks[8];
  72. /* The number of valid watch register pairs. */
  73. unsigned int num_valid;
  74. } __attribute__((aligned(8)));
  75. struct mips64_watch_regs {
  76. unsigned long long watchlo[8];
  77. unsigned short watchhi[8];
  78. unsigned short watch_masks[8];
  79. unsigned int num_valid;
  80. } __attribute__((aligned(8)));
  81. struct pt_watch_regs {
  82. enum pt_watch_style style;
  83. union {
  84. struct mips32_watch_regs mips32;
  85. struct mips64_watch_regs mips64;
  86. };
  87. };
  88. #define PTRACE_GET_WATCH_REGS 0xd0
  89. #define PTRACE_SET_WATCH_REGS 0xd1
  90. #endif /* _UAPI_ASM_PTRACE_H */