arm64: move DBG_MDSCR_* to asm/debug-monitors.h
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 7 May 2014 11:13:14 +0000 (12:13 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:19:02 +0000 (17:19 +0200)
In order to be able to use the DBG_MDSCR_* macros from the KVM code,
move the relevant definitions to the obvious include file.

Also move the debug_el enum to a portion of the file that is guarded
by #ifndef __ASSEMBLY__ in order to use that file from assembly code.

Acked-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
(cherry picked from commit 51ba248164d0eeb8b4f94d405430c18a56c6ac9a)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/include/asm/debug-monitors.h
arch/arm64/kernel/debug-monitors.c

index 7c951a510b5443a49ffa139f64066fecf54c89d3..aab72ce22348a9a7b09372576d7f917c03c0a5e2 100644 (file)
 
 #ifdef __KERNEL__
 
+/* Low-level stepping controls. */
+#define DBG_MDSCR_SS           (1 << 0)
+#define DBG_SPSR_SS            (1 << 21)
+
+/* MDSCR_EL1 enabling bits */
+#define DBG_MDSCR_KDE          (1 << 13)
+#define DBG_MDSCR_MDE          (1 << 15)
+#define DBG_MDSCR_MASK         ~(DBG_MDSCR_KDE | DBG_MDSCR_MDE)
+
 #define        DBG_ESR_EVT(x)          (((x) >> 27) & 0x7)
 
 /* AArch64 */
 
 #define CACHE_FLUSH_IS_SAFE            1
 
-enum debug_el {
-       DBG_ACTIVE_EL0 = 0,
-       DBG_ACTIVE_EL1,
-};
-
 /* AArch32 */
 #define DBG_ESR_EVT_BKPT       0x4
 #define DBG_ESR_EVT_VECC       0x5
@@ -115,6 +119,11 @@ void unregister_break_hook(struct break_hook *hook);
 
 u8 debug_monitors_arch(void);
 
+enum debug_el {
+       DBG_ACTIVE_EL0 = 0,
+       DBG_ACTIVE_EL1,
+};
+
 void enable_debug_monitors(enum debug_el el);
 void disable_debug_monitors(enum debug_el el);
 
index 553a120fc838a51d97fee6fc9e77baf0dc1fb410..fea84694fce40d8782f800240af0bf544485597b 100644 (file)
 #include <asm/cputype.h>
 #include <asm/system_misc.h>
 
-/* Low-level stepping controls. */
-#define DBG_MDSCR_SS           (1 << 0)
-#define DBG_SPSR_SS            (1 << 21)
-
-/* MDSCR_EL1 enabling bits */
-#define DBG_MDSCR_KDE          (1 << 13)
-#define DBG_MDSCR_MDE          (1 << 15)
-#define DBG_MDSCR_MASK         ~(DBG_MDSCR_KDE | DBG_MDSCR_MDE)
-
 /* Determine debug architecture. */
 u8 debug_monitors_arch(void)
 {