ptrace.h 2.2 KB

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