ptrace.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Copyright (C) 1998-2004 Hewlett-Packard Co
  4. * David Mosberger-Tang <[email protected]>
  5. * Stephane Eranian <[email protected]>
  6. * Copyright (C) 2003 Intel Co
  7. * Suresh Siddha <[email protected]>
  8. * Fenghua Yu <[email protected]>
  9. * Arun Sharma <[email protected]>
  10. *
  11. * 12/07/98 S. Eranian added pt_regs & switch_stack
  12. * 12/21/98 D. Mosberger updated to match latest code
  13. * 6/17/99 D. Mosberger added second unat member to "struct switch_stack"
  14. *
  15. */
  16. #ifndef _UAPI_ASM_IA64_PTRACE_H
  17. #define _UAPI_ASM_IA64_PTRACE_H
  18. /*
  19. * When a user process is blocked, its state looks as follows:
  20. *
  21. * +----------------------+ ------- IA64_STK_OFFSET
  22. * | | ^
  23. * | struct pt_regs | |
  24. * | | |
  25. * +----------------------+ |
  26. * | | |
  27. * | memory stack | |
  28. * | (growing downwards) | |
  29. * //.....................// |
  30. * |
  31. * //.....................// |
  32. * | | |
  33. * +----------------------+ |
  34. * | struct switch_stack | |
  35. * | | |
  36. * +----------------------+ |
  37. * | | |
  38. * //.....................// |
  39. * |
  40. * //.....................// |
  41. * | | |
  42. * | register stack | |
  43. * | (growing upwards) | |
  44. * | | |
  45. * +----------------------+ | --- IA64_RBS_OFFSET
  46. * | struct thread_info | | ^
  47. * +----------------------+ | |
  48. * | | | |
  49. * | struct task_struct | | |
  50. * current -> | | | |
  51. * +----------------------+ -------
  52. *
  53. * Note that ar.ec is not saved explicitly in pt_reg or switch_stack.
  54. * This is because ar.ec is saved as part of ar.pfs.
  55. */
  56. #include <asm/fpu.h>
  57. #ifndef __ASSEMBLY__
  58. /*
  59. * This struct defines the way the registers are saved on system
  60. * calls.
  61. *
  62. * We don't save all floating point register because the kernel
  63. * is compiled to use only a very small subset, so the other are
  64. * untouched.
  65. *
  66. * THIS STRUCTURE MUST BE A MULTIPLE 16-BYTE IN SIZE
  67. * (because the memory stack pointer MUST ALWAYS be aligned this way)
  68. *
  69. */
  70. struct pt_regs {
  71. /* The following registers are saved by SAVE_MIN: */
  72. unsigned long b6; /* scratch */
  73. unsigned long b7; /* scratch */
  74. unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
  75. unsigned long ar_ssd; /* reserved for future use (scratch) */
  76. unsigned long r8; /* scratch (return value register 0) */
  77. unsigned long r9; /* scratch (return value register 1) */
  78. unsigned long r10; /* scratch (return value register 2) */
  79. unsigned long r11; /* scratch (return value register 3) */
  80. unsigned long cr_ipsr; /* interrupted task's psr */
  81. unsigned long cr_iip; /* interrupted task's instruction pointer */
  82. /*
  83. * interrupted task's function state; if bit 63 is cleared, it
  84. * contains syscall's ar.pfs.pfm:
  85. */
  86. unsigned long cr_ifs;
  87. unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
  88. unsigned long ar_pfs; /* prev function state */
  89. unsigned long ar_rsc; /* RSE configuration */
  90. /* The following two are valid only if cr_ipsr.cpl > 0 || ti->flags & _TIF_MCA_INIT */
  91. unsigned long ar_rnat; /* RSE NaT */
  92. unsigned long ar_bspstore; /* RSE bspstore */
  93. unsigned long pr; /* 64 predicate registers (1 bit each) */
  94. unsigned long b0; /* return pointer (bp) */
  95. unsigned long loadrs; /* size of dirty partition << 16 */
  96. unsigned long r1; /* the gp pointer */
  97. unsigned long r12; /* interrupted task's memory stack pointer */
  98. unsigned long r13; /* thread pointer */
  99. unsigned long ar_fpsr; /* floating point status (preserved) */
  100. unsigned long r15; /* scratch */
  101. /* The remaining registers are NOT saved for system calls. */
  102. unsigned long r14; /* scratch */
  103. unsigned long r2; /* scratch */
  104. unsigned long r3; /* scratch */
  105. /* The following registers are saved by SAVE_REST: */
  106. unsigned long r16; /* scratch */
  107. unsigned long r17; /* scratch */
  108. unsigned long r18; /* scratch */
  109. unsigned long r19; /* scratch */
  110. unsigned long r20; /* scratch */
  111. unsigned long r21; /* scratch */
  112. unsigned long r22; /* scratch */
  113. unsigned long r23; /* scratch */
  114. unsigned long r24; /* scratch */
  115. unsigned long r25; /* scratch */
  116. unsigned long r26; /* scratch */
  117. unsigned long r27; /* scratch */
  118. unsigned long r28; /* scratch */
  119. unsigned long r29; /* scratch */
  120. unsigned long r30; /* scratch */
  121. unsigned long r31; /* scratch */
  122. unsigned long ar_ccv; /* compare/exchange value (scratch) */
  123. /*
  124. * Floating point registers that the kernel considers scratch:
  125. */
  126. struct ia64_fpreg f6; /* scratch */
  127. struct ia64_fpreg f7; /* scratch */
  128. struct ia64_fpreg f8; /* scratch */
  129. struct ia64_fpreg f9; /* scratch */
  130. struct ia64_fpreg f10; /* scratch */
  131. struct ia64_fpreg f11; /* scratch */
  132. };
  133. /*
  134. * This structure contains the addition registers that need to
  135. * preserved across a context switch. This generally consists of
  136. * "preserved" registers.
  137. */
  138. struct switch_stack {
  139. unsigned long caller_unat; /* user NaT collection register (preserved) */
  140. unsigned long ar_fpsr; /* floating-point status register */
  141. struct ia64_fpreg f2; /* preserved */
  142. struct ia64_fpreg f3; /* preserved */
  143. struct ia64_fpreg f4; /* preserved */
  144. struct ia64_fpreg f5; /* preserved */
  145. struct ia64_fpreg f12; /* scratch, but untouched by kernel */
  146. struct ia64_fpreg f13; /* scratch, but untouched by kernel */
  147. struct ia64_fpreg f14; /* scratch, but untouched by kernel */
  148. struct ia64_fpreg f15; /* scratch, but untouched by kernel */
  149. struct ia64_fpreg f16; /* preserved */
  150. struct ia64_fpreg f17; /* preserved */
  151. struct ia64_fpreg f18; /* preserved */
  152. struct ia64_fpreg f19; /* preserved */
  153. struct ia64_fpreg f20; /* preserved */
  154. struct ia64_fpreg f21; /* preserved */
  155. struct ia64_fpreg f22; /* preserved */
  156. struct ia64_fpreg f23; /* preserved */
  157. struct ia64_fpreg f24; /* preserved */
  158. struct ia64_fpreg f25; /* preserved */
  159. struct ia64_fpreg f26; /* preserved */
  160. struct ia64_fpreg f27; /* preserved */
  161. struct ia64_fpreg f28; /* preserved */
  162. struct ia64_fpreg f29; /* preserved */
  163. struct ia64_fpreg f30; /* preserved */
  164. struct ia64_fpreg f31; /* preserved */
  165. unsigned long r4; /* preserved */
  166. unsigned long r5; /* preserved */
  167. unsigned long r6; /* preserved */
  168. unsigned long r7; /* preserved */
  169. unsigned long b0; /* so we can force a direct return in copy_thread */
  170. unsigned long b1;
  171. unsigned long b2;
  172. unsigned long b3;
  173. unsigned long b4;
  174. unsigned long b5;
  175. unsigned long ar_pfs; /* previous function state */
  176. unsigned long ar_lc; /* loop counter (preserved) */
  177. unsigned long ar_unat; /* NaT bits for r4-r7 */
  178. unsigned long ar_rnat; /* RSE NaT collection register */
  179. unsigned long ar_bspstore; /* RSE dirty base (preserved) */
  180. unsigned long pr; /* 64 predicate registers (1 bit each) */
  181. };
  182. /* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
  183. struct pt_all_user_regs {
  184. unsigned long nat;
  185. unsigned long cr_iip;
  186. unsigned long cfm;
  187. unsigned long cr_ipsr;
  188. unsigned long pr;
  189. unsigned long gr[32];
  190. unsigned long br[8];
  191. unsigned long ar[128];
  192. struct ia64_fpreg fr[128];
  193. };
  194. #endif /* !__ASSEMBLY__ */
  195. /* indices to application-registers array in pt_all_user_regs */
  196. #define PT_AUR_RSC 16
  197. #define PT_AUR_BSP 17
  198. #define PT_AUR_BSPSTORE 18
  199. #define PT_AUR_RNAT 19
  200. #define PT_AUR_CCV 32
  201. #define PT_AUR_UNAT 36
  202. #define PT_AUR_FPSR 40
  203. #define PT_AUR_PFS 64
  204. #define PT_AUR_LC 65
  205. #define PT_AUR_EC 66
  206. /*
  207. * The numbers chosen here are somewhat arbitrary but absolutely MUST
  208. * not overlap with any of the number assigned in <linux/ptrace.h>.
  209. */
  210. #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */
  211. #define PTRACE_OLD_GETSIGINFO 13 /* (replaced by PTRACE_GETSIGINFO in <linux/ptrace.h>) */
  212. #define PTRACE_OLD_SETSIGINFO 14 /* (replaced by PTRACE_SETSIGINFO in <linux/ptrace.h>) */
  213. #define PTRACE_GETREGS 18 /* get all registers (pt_all_user_regs) in one shot */
  214. #define PTRACE_SETREGS 19 /* set all registers (pt_all_user_regs) in one shot */
  215. #define PTRACE_OLDSETOPTIONS 21
  216. #endif /* _UAPI_ASM_IA64_PTRACE_H */