@@ -2,6 +2,7 @@
#define _ASMARM_BUG_H
#include <linux/linkage.h>
+#include <asm/opcodes.h>
#ifdef CONFIG_BUG
@@ -12,15 +13,15 @@
*/
#ifdef CONFIG_THUMB2_KERNEL
#define BUG_INSTR_VALUE 0xde02
-#define BUG_INSTR_TYPE ".hword "
+#define __BUG_INSTR __inst_thumb16(BUG_INSTR_VALUE)
#else
#define BUG_INSTR_VALUE 0xe7f001f2
-#define BUG_INSTR_TYPE ".word "
+#define __BUG_INSTR __inst_arm(BUG_INSTR_VALUE)
#endif
-#define BUG() _BUG(__FILE__, __LINE__, BUG_INSTR_VALUE)
-#define _BUG(file, line, value) __BUG(file, line, value)
+#define BUG() _BUG(__FILE__, __LINE__)
+#define _BUG(file, line) __BUG(file, line)
#ifdef CONFIG_DEBUG_BUGVERBOSE
@@ -31,9 +32,9 @@
* avoid multiple copies of the string appearing in the kernel image.
*/
-#define __BUG(__file, __line, __value) \
+#define __BUG(__file, __line) \
do { \
- asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n" \
+ asm volatile("1:\t" __BUG_INSTR "\n" \
".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
"2:\t.asciz " #__file "\n" \
".popsection\n" \
@@ -46,9 +47,9 @@ do { \
#else /* not CONFIG_DEBUG_BUGVERBOSE */
-#define __BUG(__file, __line, __value) \
+#define __BUG(__file, __line) \
do { \
- asm volatile(BUG_INSTR_TYPE #__value); \
+ asm volatile(__BUG_INSTR) \
unreachable(); \
} while (0)
#endif /* CONFIG_DEBUG_BUGVERBOSE */
@@ -11,6 +11,8 @@
#ifndef __ASSEMBLY__
#include <linux/linkage.h>
+#include <linux/types.h>
+
extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);
#endif