xen/arm: arm64: Move the define BRK_BUG_FRAME into a separate header
authorJulien Grall <julien.grall@arm.com>
Wed, 22 Jun 2016 11:15:21 +0000 (12:15 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 13 Jul 2016 17:30:45 +0000 (18:30 +0100)
New immediates will be defined in the future. To keep track of the
immediates allocated, gather all of them in a separate header.

Also rename BRK_BUG_FRAME to BKR_BUG_FRAME_IMM.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c
xen/include/asm-arm/arm64/brk.h [new file with mode: 0644]
xen/include/asm-arm/arm64/bug.h

index 185f7a5fd19c0480d8c5d2985150cac0c048c67c..42011c59054d1b191f66598266d61a643862784d 100644 (file)
@@ -1202,7 +1202,7 @@ static void do_trap_brk(struct cpu_user_regs *regs, const union hsr hsr)
 
     switch (hsr.brk.comment)
     {
-    case BRK_BUG_FRAME:
+    case BRK_BUG_FRAME_IMM:
         if ( do_bug_frame(regs, regs->pc) )
             goto die;
 
diff --git a/xen/include/asm-arm/arm64/brk.h b/xen/include/asm-arm/arm64/brk.h
new file mode 100644 (file)
index 0000000..7867b07
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2016 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARM_ARM64_BRK
+#define __ASM_ARM_ARM64_BRK
+
+/*
+ * #imm16 values used for BRK instruction generation
+ * 0x001: xen-mode BUG() and WARN() traps
+ */
+#define BRK_BUG_FRAME_IMM   1
+
+#endif /* !__ASM_ARM_ARM64_BRK */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
index 42b0e4f2f75ed45138acb765eaaa0e5c66a4b384..59f664d7deae7d3f716ef838f291d6d24080861a 100644 (file)
@@ -2,9 +2,8 @@
 #define __ARM_ARM64_BUG_H__
 
 #include <xen/stringify.h>
+#include <asm/arm64/brk.h>
 
-#define BRK_BUG_FRAME 1
-
-#define BUG_INSTR "brk " __stringify(BRK_BUG_FRAME)
+#define BUG_INSTR "brk " __stringify(BRK_BUG_FRAME_IMM)
 
 #endif /* __ARM_ARM64_BUG_H__ */