diff options
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/acpica/Makefile | 5 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_machdep.c | 11 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_wakecode.S | 31 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_wakeup.c | 6 | ||||
-rw-r--r-- | sys/i386/conf/NOTES | 4 |
5 files changed, 27 insertions, 30 deletions
diff --git a/sys/i386/acpica/Makefile b/sys/i386/acpica/Makefile index c22071f..bc6aa58 100644 --- a/sys/i386/acpica/Makefile +++ b/sys/i386/acpica/Makefile @@ -11,10 +11,6 @@ CLEANFILES= acpi_wakecode.h acpi_wakecode.bin acpi_wakecode.o .endif CFLAGS+= -I. -.ifdef ACPI_NO_RESET_VIDEO -CFLAGS+= -DACPI_NO_RESET_VIDEO -.endif - all: acpi_wakecode.h acpi_wakecode.o: acpi_wakecode.S @@ -26,4 +22,3 @@ acpi_wakecode.h: acpi_wakecode.bin acpi_wakecode.o sh ${MAKESRCPATH}/genwakecode.sh > acpi_wakecode.h .include <bsd.prog.mk> - diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index 18ffdb4..d382bc6 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -61,8 +61,8 @@ static device_t acpi_dev; #include <i386/bios/apm.h> #endif -u_int32_t acpi_no_reset_video = 0; -TUNABLE_INT("hw.acpi.no_reset_video", &acpi_no_reset_video); +u_int32_t acpi_reset_video = 1; +TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); static struct apm_softc apm_softc; @@ -333,9 +333,10 @@ acpi_machdep_init(device_t dev) if (intr_model != ACPI_INTR_PIC) acpi_SetIntrModel(intr_model); - SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "no_reset_video", CTLFLAG_RD | CTLFLAG_RW, &acpi_no_reset_video, 0, - "Disable calling the VESA reset BIOS vector on the resume path"); + SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, + SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, + "reset_video", CTLFLAG_RD | CTLFLAG_RW, &acpi_reset_video, 0, + "Call the VESA reset BIOS vector on the resume path"); return (0); } diff --git a/sys/i386/acpica/acpi_wakecode.S b/sys/i386/acpica/acpi_wakecode.S index e91a646..da39e07 100644 --- a/sys/i386/acpica/acpi_wakecode.S +++ b/sys/i386/acpica/acpi_wakecode.S @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #define LOCORE +#include <machine/param.h> #include <machine/specialreg.h> .align 4 @@ -38,23 +39,27 @@ wakeup_16: nop cli - /* Set up segment registers for real mode */ + /* + * Set up segment registers for real mode and a small stack for + * any calls we make. + */ movw %cs,%ax movw %ax,%ds movw %ax,%ss - -#ifndef ACPI_NO_RESET_VIDEO + movw $PAGE_SIZE,%sp + + /* Re-initialize video BIOS if the reset_video tunable is set. */ + cmp $1,reset_video + je wakeup_16_gdt + lcall $0xc000,$3 + /* - * Re-initialize video BIOS. Restore DS and SS from CS in - * case the BIOS modified them. + * Set up segment registers for real mode again in case the + * previous BIOS call clobbers them. */ - cmp $1, no_reset_video - je wakeup_16_gdt - lcall $0xc000, $3 - movw %cs, %ax - movw %ax, %ds - movw %ax, %ss -#endif + movw %cs,%ax + movw %ax,%ds + movw %ax,%ss wakeup_16_gdt: /* Load GDT for real mode */ @@ -214,7 +219,7 @@ physical_esp: .long 0 previous_cr2: .long 0 previous_cr3: .long 0 previous_cr4: .long 0 -no_reset_video: .long 0 +reset_video: .long 0 /* transfer from real mode to protected mode */ previous_cr0: .long 0 diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index adf366e..5be0c2f 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$"); #define vm_page_unlock_queues() #endif -extern u_int32_t acpi_no_reset_video; -extern void initializecpu(void); +extern uint32_t acpi_reset_video; +extern void initializecpu(void); static struct region_descriptor r_idt, r_gdt, *p_gdt; static u_int16_t r_ldt; @@ -233,7 +233,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(previous_cr3, u_int32_t, r_cr3); WAKECODE_FIXUP(previous_cr4, u_int32_t, r_cr4); - WAKECODE_FIXUP(no_reset_video, u_int32_t, acpi_no_reset_video); + WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video); WAKECODE_FIXUP(previous_tr, u_int16_t, r_tr); WAKECODE_BCOPY(previous_gdt, struct region_descriptor, r_gdt); diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index ccbe85d..7a33562 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -412,9 +412,6 @@ options TDFX_LINUX # Enable Linuxulator support # # ACPI_MAX_THREADS sets the number of task threads started. # -# ACPI_NO_RESET_VIDEO disables calling the VESA reset BIOS vector on -# the resume path. -# # ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op. # # ACPICA_PEDANTIC enables strict checking of AML. Our default is to @@ -427,7 +424,6 @@ options TDFX_LINUX # Enable Linuxulator support device acpi options ACPI_DEBUG options ACPI_MAX_THREADS=1 -#!options ACPI_NO_RESET_VIDEO #!options ACPI_NO_SEMAPHORES #!options ACPICA_PEDANTIC |