Pick up the selectors to use for various kernel segments from assym.s

instead of assuming fixed offsets within the GDT. The hard-coded
values here have been incorrect since Peter's GDT rearranging around
10 days ago, causing ACPI resume problems.

Reviewed by:	peter
This commit is contained in:
Ian Dowse 2005-04-22 09:53:04 +00:00
parent 705d63cd9a
commit b8619d3608
2 changed files with 7 additions and 6 deletions

View File

@ -30,9 +30,10 @@
#define LOCORE
#include <machine/asmacros.h>
#include <machine/param.h>
#include <machine/specialreg.h>
#include "assym.s"
.align 4
.code16
wakeup_16:
@ -99,7 +100,7 @@ wakeup_16_gdt:
wakeup_sw32:
/* Switch to protected mode by intersegmental jump */
ljmpl $0x8,$0x12345678 /* Code location, to be replaced */
ljmpl $KCSEL,$0x12345678 /* Code location, to be replaced */
.code32
wakeup_32:
@ -111,12 +112,12 @@ wakeup_32:
nop
/* Set up segment registers for protected mode */
movw $0x10,%ax /* KDSEL to segment registers */
movw $KDSEL,%ax /* KDSEL to segment registers */
movw %ax,%ds
movw %ax,%es
movw %ax,%gs
movw %ax,%ss
movw $0x18,%ax /* KPSEL to %fs */
movw $KPSEL,%ax /* KPSEL to %fs */
movw %ax,%fs
movl %esi,%esp /* physical address stack pointer */

View File

@ -77,11 +77,11 @@ opt_ddb.h: Makefile
# Machine-specific code such as sleep/wakeup
SRCS+= acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
.if ${MACHINE} == "i386"
SRCS+= madt.c
SRCS+= madt.c assym.s
.endif
CLEANFILES+= acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin ${DBSRC:.c=.o}
acpi_wakecode.h: acpi_wakecode.S
acpi_wakecode.h: acpi_wakecode.S assym.s
${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \
MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica