ptrace.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _UAPI_ASM_SCORE_PTRACE_H
  2. #define _UAPI_ASM_SCORE_PTRACE_H
  3. #define PTRACE_GETREGS 12
  4. #define PTRACE_SETREGS 13
  5. #define SINGLESTEP16_INSN 0x7006
  6. #define SINGLESTEP32_INSN 0x840C8000
  7. #define BREAKPOINT16_INSN 0x7002 /* work on SPG300 */
  8. #define BREAKPOINT32_INSN 0x84048000 /* work on SPG300 */
  9. /* Define instruction mask */
  10. #define INSN32_MASK 0x80008000
  11. #define J32 0x88008000 /* 1_00010_0000000000_1_000000000000000 */
  12. #define J32M 0xFC008000 /* 1_11111_0000000000_1_000000000000000 */
  13. #define B32 0x90008000 /* 1_00100_0000000000_1_000000000000000 */
  14. #define B32M 0xFC008000
  15. #define BL32 0x90008001 /* 1_00100_0000000000_1_000000000000001 */
  16. #define BL32M B32
  17. #define BR32 0x80008008 /* 1_00000_0000000000_1_00000000_000100_0 */
  18. #define BR32M 0xFFE0807E
  19. #define BRL32 0x80008009 /* 1_00000_0000000000_1_00000000_000100_1 */
  20. #define BRL32M BR32M
  21. #define B32_SET (J32 | B32 | BL32 | BR32 | BRL32)
  22. #define J16 0x3000 /* 0_011_....... */
  23. #define J16M 0xF000
  24. #define B16 0x4000 /* 0_100_....... */
  25. #define B16M 0xF000
  26. #define BR16 0x0004 /* 0_000.......0100 */
  27. #define BR16M 0xF00F
  28. #define B16_SET (J16 | B16 | BR16)
  29. /*
  30. * This struct defines the way the registers are stored on the stack during a
  31. * system call/exception. As usual the registers k0/k1 aren't being saved.
  32. */
  33. struct pt_regs {
  34. unsigned long pad0[6]; /* stack arguments */
  35. unsigned long orig_r4;
  36. unsigned long orig_r7;
  37. long is_syscall;
  38. unsigned long regs[32];
  39. unsigned long cel;
  40. unsigned long ceh;
  41. unsigned long sr0; /* cnt */
  42. unsigned long sr1; /* lcr */
  43. unsigned long sr2; /* scr */
  44. unsigned long cp0_epc;
  45. unsigned long cp0_ema;
  46. unsigned long cp0_psr;
  47. unsigned long cp0_ecr;
  48. unsigned long cp0_condition;
  49. };
  50. #endif /* _UAPI_ASM_SCORE_PTRACE_H */