diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2003-10-30 16:14:55 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2003-10-30 16:14:55 +0000 |
commit | d959b1ec080147ee1d619340e77a08cf548fe501 (patch) | |
tree | da007a9d72fdbffe0fc96ed881e22c118050c053 /sys/i386/acpica | |
parent | f06677c31d30ff047ed2e60d7ac2736e110b6a6c (diff) | |
download | FreeBSD-src-d959b1ec080147ee1d619340e77a08cf548fe501.zip FreeBSD-src-d959b1ec080147ee1d619340e77a08cf548fe501.tar.gz |
Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' as
the same effect as ACPI_NO_RESET_VIDEO kernel option.
Diffstat (limited to 'sys/i386/acpica')
-rw-r--r-- | sys/i386/acpica/acpi_machdep.c | 10 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_wakecode.S | 4 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_wakeup.c | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index 09e095a..18ffdb4 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/conf.h> #include <sys/fcntl.h> +#include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/uio.h> #include "acpi.h" @@ -59,6 +61,9 @@ 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); + static struct apm_softc apm_softc; static d_open_t apmopen; @@ -327,6 +332,11 @@ 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"); + return (0); } diff --git a/sys/i386/acpica/acpi_wakecode.S b/sys/i386/acpica/acpi_wakecode.S index a67f4ad..e91a646 100644 --- a/sys/i386/acpica/acpi_wakecode.S +++ b/sys/i386/acpica/acpi_wakecode.S @@ -48,12 +48,15 @@ wakeup_16: * Re-initialize video BIOS. Restore DS and SS from CS in * case the BIOS modified them. */ + cmp $1, no_reset_video + je wakeup_16_gdt lcall $0xc000, $3 movw %cs, %ax movw %ax, %ds movw %ax, %ss #endif +wakeup_16_gdt: /* Load GDT for real mode */ lgdt physical_gdt @@ -211,6 +214,7 @@ physical_esp: .long 0 previous_cr2: .long 0 previous_cr3: .long 0 previous_cr4: .long 0 +no_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 9a11f42..adf366e 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #define vm_page_unlock_queues() #endif +extern u_int32_t acpi_no_reset_video; extern void initializecpu(void); static struct region_descriptor r_idt, r_gdt, *p_gdt; @@ -232,6 +233,8 @@ 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(previous_tr, u_int16_t, r_tr); WAKECODE_BCOPY(previous_gdt, struct region_descriptor, r_gdt); WAKECODE_FIXUP(previous_ldt, u_int16_t, r_ldt); |