Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux.git] / arch / arm / kernel / kprobes-test.c
index c2fd06b4c3894bd5e5a901e70abd5411d00691ae..379639998d5a804266986b2c5f0141a33ebc8ffa 100644 (file)
  *     @ start of inline data...
  *     .ascii "mov r0, r7"     @ text title for test case
  *     .byte   0
- *     .align  2
+ *     .align  2, 0
  *
  *     @ TEST_ARG_REG
  *     .byte   ARG_TYPE_REG
@@ -1333,7 +1333,8 @@ static void test_case_failed(const char *message)
 static unsigned long next_instruction(unsigned long pc)
 {
 #ifdef CONFIG_THUMB2_KERNEL
-       if ((pc & 1) && !is_wide_instruction(*(u16 *)(pc - 1)))
+       if ((pc & 1) &&
+           !is_wide_instruction(__mem_to_opcode_thumb16(*(u16 *)(pc - 1))))
                return pc + 2;
        else
 #endif
@@ -1378,13 +1379,13 @@ static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
 
        if (test_case_is_thumb) {
                u16 *p = (u16 *)(test_code & ~1);
-               current_instruction = p[0];
+               current_instruction = __mem_to_opcode_thumb16(p[0]);
                if (is_wide_instruction(current_instruction)) {
-                       current_instruction <<= 16;
-                       current_instruction |= p[1];
+                       u16 instr2 = __mem_to_opcode_thumb16(p[1]);
+                       current_instruction = __opcode_thumb32_compose(current_instruction, instr2);
                }
        } else {
-               current_instruction = *(u32 *)test_code;
+               current_instruction = __mem_to_opcode_arm(*(u32 *)test_code);
        }
 
        if (current_title[0] == '.')