ptrace.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /* These are saved by PAL-code: */
  43. unsigned long ps;
  44. unsigned long pc;
  45. unsigned long gp;
  46. unsigned long r16;
  47. unsigned long r17;
  48. unsigned long r18;
  49. };
  50. /*
  51. * This is the extended stack used by signal handlers and the context
  52. * switcher: it's pushed after the normal "struct pt_regs".
  53. */
  54. struct switch_stack {
  55. unsigned long r9;
  56. unsigned long r10;
  57. unsigned long r11;
  58. unsigned long r12;
  59. unsigned long r13;
  60. unsigned long r14;
  61. unsigned long r15;
  62. unsigned long r26;
  63. unsigned long fp[32]; /* fp[31] is fpcr */
  64. };
  65. #endif /* _UAPI_ASMAXP_PTRACE_H */