[PATCH] i386: move kernel_thread_helper into entry.S
authorAndi Kleen <ak@suse.de>
Tue, 26 Sep 2006 08:52:35 +0000 (10:52 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Tue, 26 Sep 2006 08:52:35 +0000 (10:52 +0200)
And add proper CFI annotation to it which was previously
impossible. This prevents "stuck" messages by the dwarf2 unwinder
when reaching the top of a kernel stack.

Includes feedback from Jan Beulich

Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
arch/i386/kernel/entry.S
arch/i386/kernel/process.c

index ba22ec8fab54e18c632a13839cc5c8c5180c5da8..dede506e5bd02eafa1c2673e98562687dfbe7c42 100644 (file)
@@ -950,6 +950,19 @@ ENTRY(arch_unwind_init_running)
 ENDPROC(arch_unwind_init_running)
 #endif
 
+ENTRY(kernel_thread_helper)
+       pushl $0                # fake return address for unwinder
+       CFI_STARTPROC
+       movl %edx,%eax
+       push %edx
+       CFI_ADJUST_CFA_OFFSET 4
+       call *%ebx
+       push %eax
+       CFI_ADJUST_CFA_OFFSET 4
+       call do_exit
+       CFI_ENDPROC
+ENDPROC(kernel_thread_helper)
+
 .section .rodata,"a"
 #include "syscall_table.S"
 
index b741c3e1a5ebd49501dc2e3a100dd68549863b52..220aeca59c3a6d67e9bf2d010923610435c284b8 100644 (file)
@@ -321,15 +321,6 @@ void show_regs(struct pt_regs * regs)
  * the "args".
  */
 extern void kernel_thread_helper(void);
-__asm__(".section .text\n"
-       ".align 4\n"
-       "kernel_thread_helper:\n\t"
-       "movl %edx,%eax\n\t"
-       "pushl %edx\n\t"
-       "call *%ebx\n\t"
-       "pushl %eax\n\t"
-       "call do_exit\n"
-       ".previous");
 
 /*
  * Create a kernel thread