ptrace.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef _ASM_SCORE_PTRACE_H
  2. #define _ASM_SCORE_PTRACE_H
  3. #define PTRACE_GETREGS 12
  4. #define PTRACE_SETREGS 13
  5. #define PC 32
  6. #define CONDITION 33
  7. #define ECR 34
  8. #define EMA 35
  9. #define CEH 36
  10. #define CEL 37
  11. #define COUNTER 38
  12. #define LDCR 39
  13. #define STCR 40
  14. #define PSR 41
  15. #define SINGLESTEP16_INSN 0x7006
  16. #define SINGLESTEP32_INSN 0x840C8000
  17. #define BREAKPOINT16_INSN 0x7002 /* work on SPG300 */
  18. #define BREAKPOINT32_INSN 0x84048000 /* work on SPG300 */
  19. /* Define instruction mask */
  20. #define INSN32_MASK 0x80008000
  21. #define J32 0x88008000 /* 1_00010_0000000000_1_000000000000000 */
  22. #define J32M 0xFC008000 /* 1_11111_0000000000_1_000000000000000 */
  23. #define B32 0x90008000 /* 1_00100_0000000000_1_000000000000000 */
  24. #define B32M 0xFC008000
  25. #define BL32 0x90008001 /* 1_00100_0000000000_1_000000000000001 */
  26. #define BL32M B32
  27. #define BR32 0x80008008 /* 1_00000_0000000000_1_00000000_000100_0 */
  28. #define BR32M 0xFFE0807E
  29. #define BRL32 0x80008009 /* 1_00000_0000000000_1_00000000_000100_1 */
  30. #define BRL32M BR32M
  31. #define B32_SET (J32 | B32 | BL32 | BR32 | BRL32)
  32. #define J16 0x3000 /* 0_011_....... */
  33. #define J16M 0xF000
  34. #define B16 0x4000 /* 0_100_....... */
  35. #define B16M 0xF000
  36. #define BR16 0x0004 /* 0_000.......0100 */
  37. #define BR16M 0xF00F
  38. #define B16_SET (J16 | B16 | BR16)
  39. /*
  40. * This struct defines the way the registers are stored on the stack during a
  41. * system call/exception. As usual the registers k0/k1 aren't being saved.
  42. */
  43. struct pt_regs {
  44. unsigned long pad0[6]; /* stack arguments */
  45. unsigned long orig_r4;
  46. unsigned long orig_r7;
  47. long is_syscall;
  48. unsigned long regs[32];
  49. unsigned long cel;
  50. unsigned long ceh;
  51. unsigned long sr0; /* cnt */
  52. unsigned long sr1; /* lcr */
  53. unsigned long sr2; /* scr */
  54. unsigned long cp0_epc;
  55. unsigned long cp0_ema;
  56. unsigned long cp0_psr;
  57. unsigned long cp0_ecr;
  58. unsigned long cp0_condition;
  59. };
  60. #ifdef __KERNEL__
  61. struct task_struct;
  62. /*
  63. * Does the process account for user or for system time?
  64. */
  65. #define user_mode(regs) ((regs->cp0_psr & 8) == 8)
  66. #define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc)
  67. #define profile_pc(regs) instruction_pointer(regs)
  68. extern void do_syscall_trace(struct pt_regs *regs, int entryexit);
  69. extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
  70. extern int read_tsk_short(struct task_struct *, unsigned long,
  71. unsigned short *);
  72. #define arch_has_single_step() (1)
  73. #endif /* __KERNEL__ */
  74. #endif /* _ASM_SCORE_PTRACE_H */