Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hw_breakpoint.h
Go to the documentation of this file.
1 #ifndef __ASM_SH_HW_BREAKPOINT_H
2 #define __ASM_SH_HW_BREAKPOINT_H
3 
5 
6 #define __ARCH_HW_BREAKPOINT_H
7 
8 #include <linux/kdebug.h>
9 #include <linux/types.h>
10 
12  char *name; /* Contains name of the symbol to set bkpt */
13  unsigned long address;
16 };
17 
18 enum {
19  SH_BREAKPOINT_READ = (1 << 1),
20  SH_BREAKPOINT_WRITE = (1 << 2),
22 
23  SH_BREAKPOINT_LEN_1 = (1 << 12),
24  SH_BREAKPOINT_LEN_2 = (1 << 13),
26  SH_BREAKPOINT_LEN_8 = (1 << 14),
27 };
28 
29 struct sh_ubc {
30  const char *name;
31  unsigned int num_events;
32  unsigned int trap_nr;
35  void (*enable_all)(unsigned long);
37  unsigned long (*active_mask)(void);
38  unsigned long (*triggered_mask)(void);
40  struct clk *clk; /* optional interface clock / MSTP bit */
41 };
42 
43 struct perf_event;
44 struct task_struct;
45 struct pmu;
46 
47 /* Maximum number of UBC channels */
48 #define HBP_NUM 2
49 
50 static inline int hw_breakpoint_slots(int type)
51 {
52  return HBP_NUM;
53 }
54 
55 /* arch/sh/kernel/hw_breakpoint.c */
56 extern int arch_check_bp_in_kernelspace(struct perf_event *bp);
57 extern int arch_validate_hwbkpt_settings(struct perf_event *bp);
59  unsigned long val, void *data);
60 
63 void hw_breakpoint_pmu_read(struct perf_event *bp);
64 
65 extern void arch_fill_perf_breakpoint(struct perf_event *bp);
66 extern int register_sh_ubc(struct sh_ubc *);
67 
68 extern struct pmu perf_ops_bp;
69 
70 #endif /* __ASM_SH_HW_BREAKPOINT_H */