summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/hw_breakpoint.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-11-03 17:29:03 -0500
committerTejun Heo <tj@kernel.org>2015-11-03 17:29:03 -0500
commit159b5bb46492e4dcef2070b12861030bc360402b (patch)
tree93de7d6e94a059aade50ee5437de6a50ccd1cf7b /arch/arm64/include/asm/hw_breakpoint.h
parent56e74338a535cbcc2f2da08b1ea1a92920194364 (diff)
parent469eabb3aec03d9defed3462df743a223a5c8f54 (diff)
Merge branch 'for-4.3-fixes' into for-4.4
Diffstat (limited to 'arch/arm64/include/asm/hw_breakpoint.h')
-rw-r--r--arch/arm64/include/asm/hw_breakpoint.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/hw_breakpoint.h b/arch/arm64/include/asm/hw_breakpoint.h
index 52b484b6aa1a..4c47cb2fbb52 100644
--- a/arch/arm64/include/asm/hw_breakpoint.h
+++ b/arch/arm64/include/asm/hw_breakpoint.h
@@ -16,6 +16,8 @@
#ifndef __ASM_HW_BREAKPOINT_H
#define __ASM_HW_BREAKPOINT_H
+#include <asm/cputype.h>
+
#ifdef __KERNEL__
struct arch_hw_breakpoint_ctrl {
@@ -132,5 +134,17 @@ static inline void ptrace_hw_copy_thread(struct task_struct *task)
extern struct pmu perf_ops_bp;
+/* Determine number of BRP registers available. */
+static inline int get_num_brps(void)
+{
+ return ((read_cpuid(ID_AA64DFR0_EL1) >> 12) & 0xf) + 1;
+}
+
+/* Determine number of WRP registers available. */
+static inline int get_num_wrps(void)
+{
+ return ((read_cpuid(ID_AA64DFR0_EL1) >> 20) & 0xf) + 1;
+}
+
#endif /* __KERNEL__ */
#endif /* __ASM_BREAKPOINT_H */