hw_breakpoint.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef __ASM_SH_HW_BREAKPOINT_H
  2. #define __ASM_SH_HW_BREAKPOINT_H
  3. #include <linux/kdebug.h>
  4. #include <linux/types.h>
  5. #include <asm/ubc.h>
  6. #ifdef __KERNEL__
  7. #define __ARCH_HW_BREAKPOINT_H
  8. struct arch_hw_breakpoint {
  9. char *name; /* Contains name of the symbol to set bkpt */
  10. unsigned long address;
  11. unsigned long asid;
  12. u16 len;
  13. u16 type;
  14. };
  15. enum {
  16. SH_BREAKPOINT_READ = (1 << 1),
  17. SH_BREAKPOINT_WRITE = (1 << 2),
  18. SH_BREAKPOINT_RW = SH_BREAKPOINT_READ | SH_BREAKPOINT_WRITE,
  19. SH_BREAKPOINT_LEN_1 = (1 << 12),
  20. SH_BREAKPOINT_LEN_2 = (1 << 13),
  21. SH_BREAKPOINT_LEN_4 = SH_BREAKPOINT_LEN_1 | SH_BREAKPOINT_LEN_2,
  22. SH_BREAKPOINT_LEN_8 = (1 << 14),
  23. };
  24. /* Total number of available UBC channels */
  25. #define HBP_NUM 1 /* XXX */
  26. struct perf_event;
  27. struct task_struct;
  28. struct pmu;
  29. extern int arch_check_va_in_userspace(unsigned long va, u16 hbp_len);
  30. extern int arch_validate_hwbkpt_settings(struct perf_event *bp,
  31. struct task_struct *tsk);
  32. extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
  33. unsigned long val, void *data);
  34. int arch_install_hw_breakpoint(struct perf_event *bp);
  35. void arch_uninstall_hw_breakpoint(struct perf_event *bp);
  36. void hw_breakpoint_pmu_read(struct perf_event *bp);
  37. void hw_breakpoint_pmu_unthrottle(struct perf_event *bp);
  38. extern void arch_fill_perf_breakpoint(struct perf_event *bp);
  39. extern struct pmu perf_ops_bp;
  40. #endif /* __KERNEL__ */
  41. #endif /* __ASM_SH_HW_BREAKPOINT_H */