X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fhead.S;fp=arch%2Fi386%2Fkernel%2Fhead.S;h=e0b7c632efbcb63fa6704baae50b300422da624e;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=a6b8bd89aa27192ea507a6c8fee660e414b059b9;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index a6b8bd89a..e0b7c632e 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S @@ -8,6 +8,7 @@ */ .text +#include #include #include #include @@ -317,14 +318,20 @@ is386: movl $2,%ecx # set MP movl %eax,%gs lldt %ax cld # gcc2 wants the direction flag cleared at all times - pushl %eax # fake return address #ifdef CONFIG_SMP movb ready, %cl movb $1, ready - cmpb $0,%cl # the first CPU calls start_kernel - jne initialize_secondary # all other CPUs call initialize_secondary + cmpb $0,%cl + je 1f # the first CPU calls start_kernel + # all other CPUs call initialize_secondary + call initialize_secondary + jmp L6 +1: #endif /* CONFIG_SMP */ - jmp start_kernel + call start_kernel +L6: + jmp L6 # main should never return here, but + # just in case, we know what happens. /* * We depend on ET to be correct. This checks for 287/387. @@ -443,6 +450,7 @@ int_msg: .globl boot_gdt_descr .globl idt_descr +.globl cpu_gdt_descr ALIGN # early boot GDT descriptor (must use 1:1 address mapping) @@ -462,6 +470,8 @@ cpu_gdt_descr: .word GDT_ENTRIES*8-1 .long cpu_gdt_table + .fill NR_CPUS-1,8,0 # space for the other GDT descriptors + /* * The boot_gdt_table must mirror the equivalent in setup.S and is * used only for booting. @@ -475,7 +485,7 @@ ENTRY(boot_gdt_table) /* * The Global Descriptor Table contains 28 quadwords, per-CPU. */ - .align L1_CACHE_BYTES + .align PAGE_SIZE_asm ENTRY(cpu_gdt_table) .quad 0x0000000000000000 /* NULL descriptor */ .quad 0x0000000000000000 /* 0x0b reserved */