hw_breakpoint.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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;
  27. struct pt_regs;
  28. struct task_struct;
  29. int hw_breakpoint_slots(int type);
  30. int arch_check_bp_in_kernelspace(struct perf_event *bp);
  31. int arch_validate_hwbkpt_settings(struct perf_event *bp);
  32. 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. int check_hw_breakpoint(struct pt_regs *regs);
  38. void clear_ptrace_hw_breakpoint(struct task_struct *tsk);
  39. #else
  40. struct task_struct;
  41. static inline void clear_ptrace_hw_breakpoint(struct task_struct *tsk)
  42. {
  43. }
  44. #endif /* CONFIG_HAVE_HW_BREAKPOINT */
  45. #endif /* __ASM_XTENSA_HW_BREAKPOINT_H */