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.
This commit is contained in:
parent
9418dac4b7
commit
b98ee2e97a
@ -598,7 +598,6 @@ WITNESS_SKIPSPIN opt_witness.h
|
||||
# options for ACPI support
|
||||
ACPI_DEBUG opt_acpi.h
|
||||
ACPI_MAX_THREADS opt_acpi.h
|
||||
ACPI_NO_RESET_VIDEO opt_acpi.h
|
||||
ACPI_NO_SEMAPHORES opt_acpi.h
|
||||
ACPICA_PEDANTIC opt_acpi.h
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
/*
|
||||
* Re-initialize video BIOS. Restore DS and SS from CS in
|
||||
* case the BIOS modified them.
|
||||
*/
|
||||
cmp $1, 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
|
||||
movw %cs, %ax
|
||||
movw %ax, %ds
|
||||
movw %ax, %ss
|
||||
#endif
|
||||
lcall $0xc000,$3
|
||||
|
||||
/*
|
||||
* Set up segment registers for real mode again in case the
|
||||
* previous BIOS call clobbers them.
|
||||
*/
|
||||
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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user