summaryrefslogtreecommitdiffstats
path: root/sys/i386/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-11-01 00:18:29 +0000
committernjl <njl@FreeBSD.org>2003-11-01 00:18:29 +0000
commitb98ee2e97a7d4242a800223421cf440ec03f1209 (patch)
treeb81c9fe9b0fde83ec087921f65735bd346394250 /sys/i386/acpica
parent9418dac4b7bb4111dee7d77a471f081dc9022a06 (diff)
downloadFreeBSD-src-b98ee2e97a7d4242a800223421cf440ec03f1209.zip
FreeBSD-src-b98ee2e97a7d4242a800223421cf440ec03f1209.tar.gz
Change the reset video option to be positive (hw.acpi.reset_video).
Requested by: jhb Initialize the real mode stack. This is needed at least for the return address from the lcall. Requested by: takawata Fix style bugs in acpi_wakecode.S Requested by: bde Remove the kernel option now that we have the tunable.
Diffstat (limited to 'sys/i386/acpica')
-rw-r--r--sys/i386/acpica/Makefile5
-rw-r--r--sys/i386/acpica/acpi_machdep.c11
-rw-r--r--sys/i386/acpica/acpi_wakecode.S31
-rw-r--r--sys/i386/acpica/acpi_wakeup.c6
4 files changed, 27 insertions, 26 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);
OpenPOWER on IntegriCloud