ptrace.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _M68K_PTRACE_H
  2. #define _M68K_PTRACE_H
  3. #define PT_D1 0
  4. #define PT_D2 1
  5. #define PT_D3 2
  6. #define PT_D4 3
  7. #define PT_D5 4
  8. #define PT_D6 5
  9. #define PT_D7 6
  10. #define PT_A0 7
  11. #define PT_A1 8
  12. #define PT_A2 9
  13. #define PT_A3 10
  14. #define PT_A4 11
  15. #define PT_A5 12
  16. #define PT_A6 13
  17. #define PT_D0 14
  18. #define PT_USP 15
  19. #define PT_ORIG_D0 16
  20. #define PT_SR 17
  21. #define PT_PC 18
  22. #ifndef __ASSEMBLY__
  23. /* this struct defines the way the registers are stored on the
  24. stack during a system call. */
  25. struct pt_regs {
  26. long d1;
  27. long d2;
  28. long d3;
  29. long d4;
  30. long d5;
  31. long a0;
  32. long a1;
  33. long a2;
  34. long d0;
  35. long orig_d0;
  36. long stkadj;
  37. unsigned short sr;
  38. unsigned long pc;
  39. unsigned format : 4; /* frame format specifier */
  40. unsigned vector : 12; /* vector offset */
  41. };
  42. /*
  43. * This is the extended stack used by signal handlers and the context
  44. * switcher: it's pushed after the normal "struct pt_regs".
  45. */
  46. struct switch_stack {
  47. unsigned long d6;
  48. unsigned long d7;
  49. unsigned long a3;
  50. unsigned long a4;
  51. unsigned long a5;
  52. unsigned long a6;
  53. unsigned long retpc;
  54. };
  55. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  56. #define PTRACE_GETREGS 12
  57. #define PTRACE_SETREGS 13
  58. #define PTRACE_GETFPREGS 14
  59. #define PTRACE_SETFPREGS 15
  60. #ifdef __KERNEL__
  61. #ifndef PS_S
  62. #define PS_S (0x2000)
  63. #define PS_M (0x1000)
  64. #endif
  65. #define user_mode(regs) (!((regs)->sr & PS_S))
  66. #define instruction_pointer(regs) ((regs)->pc)
  67. #define profile_pc(regs) instruction_pointer(regs)
  68. extern void show_regs(struct pt_regs *);
  69. #endif /* __KERNEL__ */
  70. #endif /* __ASSEMBLY__ */
  71. #endif /* _M68K_PTRACE_H */