diff options
author | tegge <tegge@FreeBSD.org> | 2000-05-25 21:33:52 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2000-05-25 21:33:52 +0000 |
commit | 055edbc9e32d18fab9a6257ac3ee60ce42e60ae3 (patch) | |
tree | 6fbec6c8a7741805a62f0a31f014b392afeefbb1 /sys | |
parent | ac808124731af879036026fadb3590ed1d64d4f6 (diff) | |
download | FreeBSD-src-055edbc9e32d18fab9a6257ac3ee60ce42e60ae3.zip FreeBSD-src-055edbc9e32d18fab9a6257ac3ee60ce42e60ae3.tar.gz |
Reintroduce a workaround for a gas bug (misassembled lgdt instruction)
Use .code16 for the real mode part of the AP bootstrap trampoline code.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/mpboot.S | 20 | ||||
-rw-r--r-- | sys/i386/i386/mpboot.s | 20 |
2 files changed, 14 insertions, 26 deletions
diff --git a/sys/amd64/amd64/mpboot.S b/sys/amd64/amd64/mpboot.S index e3e11f0..9eb2d7c 100644 --- a/sys/amd64/amd64/mpboot.S +++ b/sys/amd64/amd64/mpboot.S @@ -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) diff --git a/sys/i386/i386/mpboot.s b/sys/i386/i386/mpboot.s index e3e11f0..9eb2d7c 100644 --- a/sys/i386/i386/mpboot.s +++ b/sys/i386/i386/mpboot.s @@ -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) |