ptrace.h 2.7 KB

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