[PATCH] i386: move startup_32() in text.head section
[pandora-kernel.git] / arch / i386 / kernel / head.S
index edef508..734be55 100644 (file)
@@ -53,6 +53,7 @@
  * any particular GDT layout, because we load our own as soon as we
  * can.
  */
+.section .text.head,"ax",@progbits
 ENTRY(startup_32)
 
 #ifdef CONFIG_PARAVIRT
@@ -103,7 +104,7 @@ ENTRY(startup_32)
        movzwl OLD_CL_OFFSET,%esi
        addl $(OLD_CL_BASE_ADDR),%esi
 2:
-       movl $(saved_command_line - __PAGE_OFFSET),%edi
+       movl $(boot_command_line - __PAGE_OFFSET),%edi
        movl $(COMMAND_LINE_SIZE/4),%ecx
        rep
        movsl
@@ -141,16 +142,25 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
        jb 10b
        movl %edi,(init_pg_tables_end - __PAGE_OFFSET)
 
-#ifdef CONFIG_SMP
        xorl %ebx,%ebx                          /* This is the boot CPU (BSP) */
        jmp 3f
-
 /*
  * Non-boot CPU entry point; entered from trampoline.S
  * We can't lgdt here, because lgdt itself uses a data segment, but
  * we know the trampoline has already loaded the boot_gdt_table GDT
  * for us.
+ *
+ * If cpu hotplug is not supported then this code can go in init section
+ * which will be freed later
  */
+
+#ifdef CONFIG_HOTPLUG_CPU
+.section .text,"ax",@progbits
+#else
+.section .init.text,"ax",@progbits
+#endif
+
+#ifdef CONFIG_SMP
 ENTRY(startup_32_smp)
        cld
        movl $(__BOOT_DS),%eax
@@ -208,8 +218,8 @@ ENTRY(startup_32_smp)
        xorl %ebx,%ebx
        incl %ebx
 
-3:
 #endif /* CONFIG_SMP */
+3:
 
 /*
  * Enable paging
@@ -319,12 +329,12 @@ is386:    movl $2,%ecx            # set MP
        movl %eax,%ds
        movl %eax,%es
 
-       xorl %eax,%eax                  # Clear FS and LDT
-       movl %eax,%fs
+       xorl %eax,%eax                  # Clear GS and LDT
+       movl %eax,%gs
        lldt %ax
 
        movl $(__KERNEL_PDA),%eax
-       mov  %eax,%gs
+       mov  %eax,%fs
 
        cld                     # gcc2 wants the direction flag cleared at all times
        pushl $0                # fake return address for unwinder
@@ -360,7 +370,7 @@ check_x87:
  * cpu_gdt_table and boot_pda; for secondary CPUs, these will be
  * that CPU's GDT and PDA.
  */
-setup_pda:
+ENTRY(setup_pda)
        /* get the PDA pointer */
        movl start_pda, %eax
 
@@ -492,6 +502,7 @@ ignore_int:
 #endif
        iret
 
+.section .text
 #ifdef CONFIG_PARAVIRT
 startup_paravirt:
        cld