]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/sh/include/asm/hw_breakpoint.h
Merge remote-tracking branch 'wireless-next/master'
[karo-tx-linux.git] / arch / sh / include / asm / hw_breakpoint.h
1 #ifndef __ASM_SH_HW_BREAKPOINT_H
2 #define __ASM_SH_HW_BREAKPOINT_H
3
4 #include <uapi/asm/hw_breakpoint.h>
5
6 #define __ARCH_HW_BREAKPOINT_H
7
8 #include <linux/kdebug.h>
9 #include <linux/types.h>
10 #include <cpu/ubc.h>
11
12 struct arch_hw_breakpoint {
13         char            *name; /* Contains name of the symbol to set bkpt */
14         unsigned long   address;
15         u16             len;
16         u16             type;
17 };
18
19 struct sh_ubc {
20         const char      *name;
21         unsigned int    num_events;
22         unsigned int    trap_nr;
23         void            (*enable)(struct arch_hw_breakpoint *, int);
24         void            (*disable)(struct arch_hw_breakpoint *, int);
25         void            (*enable_all)(unsigned long);
26         void            (*disable_all)(void);
27         unsigned long   (*active_mask)(void);
28         unsigned long   (*triggered_mask)(void);
29         void            (*clear_triggered_mask)(unsigned long);
30         struct clk      *clk;   /* optional interface clock / MSTP bit */
31 };
32
33 struct perf_event;
34 struct task_struct;
35 struct pmu;
36
37 /* Maximum number of UBC channels */
38 #define HBP_NUM         2
39
40 static inline int hw_breakpoint_slots(int type)
41 {
42         return HBP_NUM;
43 }
44
45 /* arch/sh/kernel/hw_breakpoint.c */
46 extern int arch_check_bp_in_kernelspace(struct perf_event *bp);
47 extern int arch_validate_hwbkpt_settings(struct perf_event *bp);
48 extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
49                                            unsigned long val, void *data);
50
51 int arch_install_hw_breakpoint(struct perf_event *bp);
52 void arch_uninstall_hw_breakpoint(struct perf_event *bp);
53 void hw_breakpoint_pmu_read(struct perf_event *bp);
54
55 extern void arch_fill_perf_breakpoint(struct perf_event *bp);
56 extern int register_sh_ubc(struct sh_ubc *);
57
58 extern struct pmu perf_ops_bp;
59
60 #endif /* __ASM_SH_HW_BREAKPOINT_H */