ptrace.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _H8300_PTRACE_H
  2. #define _H8300_PTRACE_H
  3. #ifndef __ASSEMBLY__
  4. #define PT_ER1 0
  5. #define PT_ER2 1
  6. #define PT_ER3 2
  7. #define PT_ER4 3
  8. #define PT_ER5 4
  9. #define PT_ER6 5
  10. #define PT_ER0 6
  11. #define PT_ORIG_ER0 7
  12. #define PT_CCR 8
  13. #define PT_PC 9
  14. #define PT_USP 10
  15. #define PT_EXR 12
  16. /* this struct defines the way the registers are stored on the
  17. stack during a system call. */
  18. struct pt_regs {
  19. long retpc;
  20. long er4;
  21. long er5;
  22. long er6;
  23. long er3;
  24. long er2;
  25. long er1;
  26. long orig_er0;
  27. unsigned short ccr;
  28. long er0;
  29. long vector;
  30. #if defined(CONFIG_CPU_H8S)
  31. unsigned short exr;
  32. #endif
  33. unsigned long pc;
  34. } __attribute__((aligned(2),packed));
  35. #define PTRACE_GETREGS 12
  36. #define PTRACE_SETREGS 13
  37. #ifdef __KERNEL__
  38. #ifndef PS_S
  39. #define PS_S (0x10)
  40. #endif
  41. #if defined(__H8300H__)
  42. #define H8300_REGS_NO 11
  43. #endif
  44. #if defined(__H8300S__)
  45. #define H8300_REGS_NO 12
  46. #endif
  47. /* Find the stack offset for a register, relative to thread.esp0. */
  48. #define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
  49. #define arch_has_single_step() (1)
  50. #define user_mode(regs) (!((regs)->ccr & PS_S))
  51. #define instruction_pointer(regs) ((regs)->pc)
  52. #define profile_pc(regs) instruction_pointer(regs)
  53. #endif /* __KERNEL__ */
  54. #endif /* __ASSEMBLY__ */
  55. #endif /* _H8300_PTRACE_H */