ptrace.h 8.0 KB

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