aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2012-02-17 11:54:28 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2012-09-19 03:32:52 -0400
commit4588c34daabb5aebee9cbe90f0ca6ab11412f207 (patch)
tree1bfb963e136e20b0efa1bad2b2c6057081f0fab5 /arch/arm/include
parent6a6d55c38c8b4ee77b50a33f03ea09e75b18bf82 (diff)
ARM: virt: Add boot-time diagnostics
In order to easily detect pathological cases, print some diagnostics when the kernel boots. This also provides helpers to detect that HYP mode is actually available, which can be used by other subsystems to enable HYP specific features. Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/virt.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h
index 0a99723edbf2..86164df86cb4 100644
--- a/arch/arm/include/asm/virt.h
+++ b/arch/arm/include/asm/virt.h
@@ -47,6 +47,23 @@ unsigned long __hyp_get_vectors(void);
47#define __boot_cpu_mode (SVC_MODE) 47#define __boot_cpu_mode (SVC_MODE)
48#endif 48#endif
49 49
50#ifndef ZIMAGE
51void hyp_mode_check(void);
52
53/* Reports the availability of HYP mode */
54static inline bool is_hyp_mode_available(void)
55{
56 return ((__boot_cpu_mode & MODE_MASK) == HYP_MODE &&
57 !(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH));
58}
59
60/* Check if the bootloader has booted CPUs in different modes */
61static inline bool is_hyp_mode_mismatched(void)
62{
63 return !!(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH);
64}
65#endif
66
50#endif /* __ASSEMBLY__ */ 67#endif /* __ASSEMBLY__ */
51 68
52#endif /* ! VIRT_H */ 69#endif /* ! VIRT_H */