summaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/hw_breakpoint.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-11-09 16:27:40 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-12-08 15:02:27 +0900
commit09a072947791088b88ae15111cf68fc5aaaf758d (patch)
tree510728ca3d3906a352cfc673e7f3e38e471165b4 /arch/sh/include/asm/hw_breakpoint.h
parent6ec22f9b037fc0c2e00ddb7023fad279c365324d (diff)
downloadlinux-09a072947791088b88ae15111cf68fc5aaaf758d.tar.gz
linux-09a072947791088b88ae15111cf68fc5aaaf758d.tar.bz2
linux-09a072947791088b88ae15111cf68fc5aaaf758d.zip
sh: hw-breakpoints: Add preliminary support for SH-4A UBC.
This adds preliminary support for the SH-4A UBC to the hw-breakpoints API. Presently only a single channel is implemented, and the ptrace interface still needs to be converted. This is the first step to cleaning up the long-standing UBC mess, making the UBC more generally accessible, and finally making it SMP safe. An additional abstraction will be layered on top of this as with the perf events code to permit the various CPU families to wire up support for their own specific UBCs, as many variations exist. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/hw_breakpoint.h')
-rw-r--r--arch/sh/include/asm/hw_breakpoint.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/sh/include/asm/hw_breakpoint.h b/arch/sh/include/asm/hw_breakpoint.h
new file mode 100644
index 000000000000..0f4a00f60058
--- /dev/null
+++ b/arch/sh/include/asm/hw_breakpoint.h
@@ -0,0 +1,53 @@
+#ifndef __ASM_SH_HW_BREAKPOINT_H
+#define __ASM_SH_HW_BREAKPOINT_H
+
+#include <linux/kdebug.h>
+#include <linux/types.h>
+#include <asm/ubc.h>
+
+#ifdef __KERNEL__
+#define __ARCH_HW_BREAKPOINT_H
+
+struct arch_hw_breakpoint {
+ char *name; /* Contains name of the symbol to set bkpt */
+ unsigned long address;
+ unsigned long asid;
+ u16 len;
+ u16 type;
+};
+
+enum {
+ SH_BREAKPOINT_READ = (1 << 1),
+ SH_BREAKPOINT_WRITE = (1 << 2),
+ SH_BREAKPOINT_RW = SH_BREAKPOINT_READ | SH_BREAKPOINT_WRITE,
+
+ SH_BREAKPOINT_LEN_1 = (1 << 12),
+ SH_BREAKPOINT_LEN_2 = (1 << 13),
+ SH_BREAKPOINT_LEN_4 = SH_BREAKPOINT_LEN_1 | SH_BREAKPOINT_LEN_2,
+ SH_BREAKPOINT_LEN_8 = (1 << 14),
+};
+
+/* Total number of available UBC channels */
+#define HBP_NUM 1 /* XXX */
+
+struct perf_event;
+struct task_struct;
+struct pmu;
+
+extern int arch_check_va_in_userspace(unsigned long va, u16 hbp_len);
+extern int arch_validate_hwbkpt_settings(struct perf_event *bp,
+ struct task_struct *tsk);
+extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
+ unsigned long val, void *data);
+
+int arch_install_hw_breakpoint(struct perf_event *bp);
+void arch_uninstall_hw_breakpoint(struct perf_event *bp);
+void hw_breakpoint_pmu_read(struct perf_event *bp);
+void hw_breakpoint_pmu_unthrottle(struct perf_event *bp);
+
+extern void arch_fill_perf_breakpoint(struct perf_event *bp);
+
+extern struct pmu perf_ops_bp;
+
+#endif /* __KERNEL__ */
+#endif /* __ASM_SH_HW_BREAKPOINT_H */