Move C labels to start-of-line
[coreboot.git] / src / cpu / x86 / lapic / secondary.S
1 #include <cpu/x86/mtrr.h>
2 #include <cpu/x86/lapic_def.h>
3
4         .text
5         .globl _secondary_start, _secondary_start_end
6         .balign 4096
7 _secondary_start:
8         .code16
9         cli
10         xorl    %eax, %eax
11         movl    %eax, %cr3    /* Invalidate TLB*/
12
13         /* On hyper threaded cpus, invalidating the cache here is
14          * very very bad.  Don't.
15          */
16
17         /* setup the data segment */
18         movw    %cs, %ax
19         movw    %ax, %ds
20
21         data32  lgdt    gdtaddr  - _secondary_start
22
23         movl    %cr0, %eax
24         andl    $0x7FFAFFD1, %eax /* PG,AM,WP,NE,TS,EM,MP = 0 */
25         orl     $0x60000001, %eax /* CD, NW, PE = 1 */
26         movl    %eax, %cr0
27
28         ljmpl   $0x10, $1f
29 1:
30         .code32
31         movw    $0x18, %ax
32         movw    %ax, %ds
33         movw    %ax, %es
34         movw    %ax, %ss
35         movw    %ax, %fs
36         movw    %ax, %gs
37
38         /* Load the Interrupt descriptor table */
39         lidt    idtarg
40
41         /* Set the stack pointer, and flag that we are done */
42         xorl    %eax, %eax
43         movl    secondary_stack, %esp
44         movl    %eax, secondary_stack
45
46         call    secondary_cpu_init
47 1:      hlt
48         jmp     1b
49
50 gdtaddr:
51         .word   gdt_limit       /* the table limit */
52         .long   gdt             /* we know the offset */
53
54 _secondary_start_end:
55 .code32