Reintroduce a workaround for a gas bug (misassembled lgdt instruction)
Use .code16 for the real mode part of the AP bootstrap trampoline code.
This commit is contained in:
parent
ac80812473
commit
055edbc9e3
@ -165,20 +165,15 @@ NON_GPROF_ENTRY(wait_ap)
|
||||
BOOTMP1:
|
||||
|
||||
NON_GPROF_ENTRY(bootMP)
|
||||
.code16
|
||||
cli
|
||||
CHECKPOINT(0x34, 1)
|
||||
/* First guarantee a 'clean slate' */
|
||||
data32
|
||||
xorl %eax, %eax
|
||||
data32
|
||||
movl %eax, %ebx
|
||||
data32
|
||||
movl %eax, %ecx
|
||||
data32
|
||||
movl %eax, %edx
|
||||
data32
|
||||
movl %eax, %esi
|
||||
data32
|
||||
movl %eax, %edi
|
||||
|
||||
/* set up data segments */
|
||||
@ -188,17 +183,18 @@ NON_GPROF_ENTRY(bootMP)
|
||||
mov %ax, %fs
|
||||
mov %ax, %gs
|
||||
mov %ax, %ss
|
||||
mov $(boot_stk-_bootMP), %sp
|
||||
mov $(boot_stk-_bootMP), %esp
|
||||
|
||||
/* Now load the global descriptor table */
|
||||
addr32
|
||||
data32
|
||||
lgdt MP_GDTptr-_bootMP
|
||||
/* XXX: sigh: lgdt MP_GDTptr-_bootMP GAS BUG! */
|
||||
.byte 0x0f, 0x01, 0x15 /* XXX hand assemble! */
|
||||
.long MP_GDTptr-_bootMP /* XXX hand assemble! */
|
||||
|
||||
/* Enable protected mode */
|
||||
data32
|
||||
movl %cr0, %eax
|
||||
data32
|
||||
orl $CR0_PE, %eax
|
||||
data32
|
||||
movl %eax, %cr0
|
||||
@ -207,13 +203,11 @@ NON_GPROF_ENTRY(bootMP)
|
||||
* make intrasegment jump to flush the processor pipeline and
|
||||
* reload CS register
|
||||
*/
|
||||
data32
|
||||
pushl $0x18
|
||||
data32
|
||||
pushl $(protmode-_bootMP)
|
||||
data32
|
||||
lret
|
||||
lretl
|
||||
|
||||
.code32
|
||||
protmode:
|
||||
CHECKPOINT(0x35, 2)
|
||||
|
||||
|
@ -165,20 +165,15 @@ NON_GPROF_ENTRY(wait_ap)
|
||||
BOOTMP1:
|
||||
|
||||
NON_GPROF_ENTRY(bootMP)
|
||||
.code16
|
||||
cli
|
||||
CHECKPOINT(0x34, 1)
|
||||
/* First guarantee a 'clean slate' */
|
||||
data32
|
||||
xorl %eax, %eax
|
||||
data32
|
||||
movl %eax, %ebx
|
||||
data32
|
||||
movl %eax, %ecx
|
||||
data32
|
||||
movl %eax, %edx
|
||||
data32
|
||||
movl %eax, %esi
|
||||
data32
|
||||
movl %eax, %edi
|
||||
|
||||
/* set up data segments */
|
||||
@ -188,17 +183,18 @@ NON_GPROF_ENTRY(bootMP)
|
||||
mov %ax, %fs
|
||||
mov %ax, %gs
|
||||
mov %ax, %ss
|
||||
mov $(boot_stk-_bootMP), %sp
|
||||
mov $(boot_stk-_bootMP), %esp
|
||||
|
||||
/* Now load the global descriptor table */
|
||||
addr32
|
||||
data32
|
||||
lgdt MP_GDTptr-_bootMP
|
||||
/* XXX: sigh: lgdt MP_GDTptr-_bootMP GAS BUG! */
|
||||
.byte 0x0f, 0x01, 0x15 /* XXX hand assemble! */
|
||||
.long MP_GDTptr-_bootMP /* XXX hand assemble! */
|
||||
|
||||
/* Enable protected mode */
|
||||
data32
|
||||
movl %cr0, %eax
|
||||
data32
|
||||
orl $CR0_PE, %eax
|
||||
data32
|
||||
movl %eax, %cr0
|
||||
@ -207,13 +203,11 @@ NON_GPROF_ENTRY(bootMP)
|
||||
* make intrasegment jump to flush the processor pipeline and
|
||||
* reload CS register
|
||||
*/
|
||||
data32
|
||||
pushl $0x18
|
||||
data32
|
||||
pushl $(protmode-_bootMP)
|
||||
data32
|
||||
lret
|
||||
lretl
|
||||
|
||||
.code32
|
||||
protmode:
|
||||
CHECKPOINT(0x35, 2)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user