debugreg.h 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef SYS_DEBUGREG_H
  2. #define SYS_DEBUGREG_H
  3. #include <stdint.h>
  4. #define DR_FIRSTADDR 0
  5. #define DR_LASTADDR 3
  6. #define DR_STATUS 6
  7. #define DR_CONTROL 7
  8. #define DR_TRAP0 (0x1)
  9. #define DR_TRAP1 (0x2)
  10. #define DR_TRAP2 (0x4)
  11. #define DR_TRAP3 (0x8)
  12. #define DR_STEP (0x4000)
  13. #define DR_SWITCH (0x8000)
  14. #define DR_CONTROL_SHIFT 16
  15. #define DR_CONTROL_SIZE 4
  16. #define DR_RW_EXECUTE (0x0)
  17. #define DR_RW_WRITE (0x1)
  18. #define DR_RW_READ (0x3)
  19. #define DR_LEN_1 (0x0)
  20. #define DR_LEN_2 (0x4)
  21. #define DR_LEN_4 (0xC)
  22. #define DR_LEN_8 (0x8)
  23. #define DR_LOCAL_ENABLE_SHIFT 0
  24. #define DR_GLOBAL_ENABLE_SHIFT 1
  25. #define DR_ENABLE_SIZE 2
  26. #define DR_LOCAL_ENABLE_MASK (0x55)
  27. #define DR_GLOBAL_ENABLE_MASK (0xAA)
  28. #if SIZE_MAX > 4294967295
  29. # define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL)
  30. #else
  31. # define DR_CONTROL_RESERVED (0x00FC00U)
  32. #endif
  33. #define DR_LOCAL_SLOWDOWN (0x100)
  34. #define DR_GLOBAL_SLOWDOWN (0x200)
  35. #endif