hw_breakpoint.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Xtensa hardware breakpoints/watchpoints handling functions
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2016 Cadence Design Systems Inc.
  9. */
  10. #ifndef __ASM_XTENSA_HW_BREAKPOINT_H
  11. #define __ASM_XTENSA_HW_BREAKPOINT_H
  12. #ifdef CONFIG_HAVE_HW_BREAKPOINT
  13. #include <linux/kdebug.h>
  14. #include <linux/types.h>
  15. #include <uapi/linux/hw_breakpoint.h>
  16. /* Breakpoint */
  17. #define XTENSA_BREAKPOINT_EXECUTE 0
  18. /* Watchpoints */
  19. #define XTENSA_BREAKPOINT_LOAD 1
  20. #define XTENSA_BREAKPOINT_STORE 2
  21. struct arch_hw_breakpoint {
  22. unsigned long address;
  23. u16 len;
  24. u16 type;
  25. };
  26. struct perf_event_attr;
  27. struct perf_event;
  28. struct pt_regs;
  29. struct task_struct;
  30. int hw_breakpoint_slots(int type);
  31. int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw);
  32. int hw_breakpoint_arch_parse(struct perf_event *bp,
  33. const struct perf_event_attr *attr,
  34. struct arch_hw_breakpoint *hw);
  35. int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
  36. unsigned long val, void *data);
  37. int arch_install_hw_breakpoint(struct perf_event *bp);
  38. void arch_uninstall_hw_breakpoint(struct perf_event *bp);
  39. void hw_breakpoint_pmu_read(struct perf_event *bp);
  40. int check_hw_breakpoint(struct pt_regs *regs);
  41. void clear_ptrace_hw_breakpoint(struct task_struct *tsk);
  42. #else
  43. struct task_struct;
  44. static inline void clear_ptrace_hw_breakpoint(struct task_struct *tsk)
  45. {
  46. }
  47. #endif /* CONFIG_HAVE_HW_BREAKPOINT */
  48. #endif /* __ASM_XTENSA_HW_BREAKPOINT_H */