ptrace.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * linux/include/asm-m32r/ptrace.h
  4. *
  5. * This file is subject to the terms and conditions of the GNU General Public
  6. * License. See the file "COPYING" in the main directory of this archive
  7. * for more details.
  8. *
  9. * M32R version:
  10. * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org>
  11. */
  12. #ifndef _UAPI_ASM_M32R_PTRACE_H
  13. #define _UAPI_ASM_M32R_PTRACE_H
  14. /* 0 - 13 are integer registers (general purpose registers). */
  15. #define PT_R4 0
  16. #define PT_R5 1
  17. #define PT_R6 2
  18. #define PT_REGS 3
  19. #define PT_R0 4
  20. #define PT_R1 5
  21. #define PT_R2 6
  22. #define PT_R3 7
  23. #define PT_R7 8
  24. #define PT_R8 9
  25. #define PT_R9 10
  26. #define PT_R10 11
  27. #define PT_R11 12
  28. #define PT_R12 13
  29. #define PT_SYSCNR 14
  30. #define PT_R13 PT_FP
  31. #define PT_R14 PT_LR
  32. #define PT_R15 PT_SP
  33. /* processor status and miscellaneous context registers. */
  34. #define PT_ACC0H 15
  35. #define PT_ACC0L 16
  36. #define PT_ACC1H 17 /* ISA_DSP_LEVEL2 only */
  37. #define PT_ACC1L 18 /* ISA_DSP_LEVEL2 only */
  38. #define PT_PSW 19
  39. #define PT_BPC 20
  40. #define PT_BBPSW 21
  41. #define PT_BBPC 22
  42. #define PT_SPU 23
  43. #define PT_FP 24
  44. #define PT_LR 25
  45. #define PT_SPI 26
  46. #define PT_ORIGR0 27
  47. /* virtual pt_reg entry for gdb */
  48. #define PT_PC 30
  49. #define PT_CBR 31
  50. #define PT_EVB 32
  51. /* Control registers. */
  52. #define SPR_CR0 PT_PSW
  53. #define SPR_CR1 PT_CBR /* read only */
  54. #define SPR_CR2 PT_SPI
  55. #define SPR_CR3 PT_SPU
  56. #define SPR_CR4
  57. #define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */
  58. #define SPR_CR6 PT_BPC
  59. #define SPR_CR7
  60. #define SPR_CR8 PT_BBPSW
  61. #define SPR_CR9
  62. #define SPR_CR10
  63. #define SPR_CR11
  64. #define SPR_CR12
  65. #define SPR_CR13 PT_WR
  66. #define SPR_CR14 PT_BBPC
  67. #define SPR_CR15
  68. /* this struct defines the way the registers are stored on the
  69. stack during a system call. */
  70. struct pt_regs {
  71. /* Saved main processor registers. */
  72. unsigned long r4;
  73. unsigned long r5;
  74. unsigned long r6;
  75. struct pt_regs *pt_regs;
  76. unsigned long r0;
  77. unsigned long r1;
  78. unsigned long r2;
  79. unsigned long r3;
  80. unsigned long r7;
  81. unsigned long r8;
  82. unsigned long r9;
  83. unsigned long r10;
  84. unsigned long r11;
  85. unsigned long r12;
  86. long syscall_nr;
  87. /* Saved main processor status and miscellaneous context registers. */
  88. unsigned long acc0h;
  89. unsigned long acc0l;
  90. unsigned long acc1h; /* ISA_DSP_LEVEL2 only */
  91. unsigned long acc1l; /* ISA_DSP_LEVEL2 only */
  92. unsigned long psw;
  93. unsigned long bpc; /* saved PC for TRAP syscalls */
  94. unsigned long bbpsw;
  95. unsigned long bbpc;
  96. unsigned long spu; /* saved user stack */
  97. unsigned long fp;
  98. unsigned long lr; /* saved PC for JL syscalls */
  99. unsigned long spi; /* saved kernel stack */
  100. unsigned long orig_r0;
  101. };
  102. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  103. #define PTRACE_GETREGS 12
  104. #define PTRACE_SETREGS 13
  105. #define PTRACE_OLDSETOPTIONS 21
  106. #endif /* _UAPI_ASM_M32R_PTRACE_H */