diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-07-25 10:47:40 -0400 |
---|---|---|
committer | Ben Dooks <ben.dooks@codethink.co.uk> | 2013-10-19 15:46:35 -0400 |
commit | 5a8b93fc9457be90adfa10d3df6497393c5e2dc2 (patch) | |
tree | 167242e0c26eaba1dedef97dda499525323e5313 | |
parent | 63328070eff2f4fd730c86966a0dbc976147c39f (diff) |
ARM: kdgb: use <asm/opcodes.h> for data to be assembled as intruction
The arch_kgdb_breakpoint() function uses an inline assembly directive
to assemble a specific instruction using .word. This means the linker
will not treat is as an instruction, and therefore incorrectly swap
the endian-ness if running BE8.
As noted, this code means that kgdb is really only usable on arm32
kernels, and should be made dependant on not being a thumb2 kernel
until fixed. However this is not something to be added to this patch.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
-rw-r--r-- | arch/arm/include/asm/kgdb.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h index 48066ce9ea34..0a9d5dd93294 100644 --- a/arch/arm/include/asm/kgdb.h +++ b/arch/arm/include/asm/kgdb.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define __ARM_KGDB_H__ | 11 | #define __ARM_KGDB_H__ |
12 | 12 | ||
13 | #include <linux/ptrace.h> | 13 | #include <linux/ptrace.h> |
14 | #include <asm/opcodes.h> | ||
14 | 15 | ||
15 | /* | 16 | /* |
16 | * GDB assumes that we're a user process being debugged, so | 17 | * GDB assumes that we're a user process being debugged, so |
@@ -41,7 +42,7 @@ | |||
41 | 42 | ||
42 | static inline void arch_kgdb_breakpoint(void) | 43 | static inline void arch_kgdb_breakpoint(void) |
43 | { | 44 | { |
44 | asm(".word 0xe7ffdeff"); | 45 | asm(__inst_arm(0xe7ffdeff)); |
45 | } | 46 | } |
46 | 47 | ||
47 | extern void kgdb_handle_bus_error(void); | 48 | extern void kgdb_handle_bus_error(void); |