ptrace.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_ASMAXP_PTRACE_H
  3. #define _UAPI_ASMAXP_PTRACE_H
  4. /*
  5. * This struct defines the way the registers are stored on the
  6. * kernel stack during a system call or other kernel entry
  7. *
  8. * NOTE! I want to minimize the overhead of system calls, so this
  9. * struct has as little information as possible. It does not have
  10. *
  11. * - floating point regs: the kernel doesn't change those
  12. * - r9-15: saved by the C compiler
  13. *
  14. * This makes "fork()" and "exec()" a bit more complex, but should
  15. * give us low system call latency.
  16. */
  17. struct pt_regs {
  18. unsigned long r0;
  19. unsigned long r1;
  20. unsigned long r2;
  21. unsigned long r3;
  22. unsigned long r4;
  23. unsigned long r5;
  24. unsigned long r6;
  25. unsigned long r7;
  26. unsigned long r8;
  27. unsigned long r19;
  28. unsigned long r20;
  29. unsigned long r21;
  30. unsigned long r22;
  31. unsigned long r23;
  32. unsigned long r24;
  33. unsigned long r25;
  34. unsigned long r26;
  35. unsigned long r27;
  36. unsigned long r28;
  37. unsigned long hae;
  38. /* JRP - These are the values provided to a0-a2 by PALcode */
  39. unsigned long trap_a0;
  40. unsigned long trap_a1;
  41. unsigned long trap_a2;
  42. /* This makes the stack 16-byte aligned as GCC expects */
  43. unsigned long __pad0;
  44. /* These are saved by PAL-code: */
  45. unsigned long ps;
  46. unsigned long pc;
  47. unsigned long gp;
  48. unsigned long r16;
  49. unsigned long r17;
  50. unsigned long r18;
  51. };
  52. /*
  53. * This is the extended stack used by signal handlers and the context
  54. * switcher: it's pushed after the normal "struct pt_regs".
  55. */
  56. struct switch_stack {
  57. unsigned long r9;
  58. unsigned long r10;
  59. unsigned long r11;
  60. unsigned long r12;
  61. unsigned long r13;
  62. unsigned long r14;
  63. unsigned long r15;
  64. unsigned long r26;
  65. #ifndef __KERNEL__
  66. unsigned long fp[32]; /* fp[31] is fpcr */
  67. #endif
  68. };
  69. #endif /* _UAPI_ASMAXP_PTRACE_H */