From 37688d63276146108db05e433930ef7f0d572d34 Mon Sep 17 00:00:00 2001 From: iwasaki Date: Tue, 6 Nov 2001 15:00:30 +0000 Subject: Add S4BIOS sleep (BIOS hibernation) and DSDT overriding support. - Add S4BIOS sleep implementation. This will works well if MIB hw.acpi.s4bios is set (and of course BIOS supports it and hibernation is enabled correctly). - Add DSDT overriding support which is submitted by takawata originally. If loader tunable acpi_dsdt_load="YES" and DSDT file is set to acpi_dsdt_name (default DSDT file name is /boot/acpi_dsdt.aml), ACPI CA core loads DSDT from given file rather than BIOS memory block. DSDT file can be generated by iasl in ports/devel/acpicatools/. - Add new files so that we can add our proposed additional code to Intel ACPI CA into these files temporary. They will be removed when similar code is added into ACPI CA officially. --- sys/dev/acpica/acpi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sys/dev/acpica/acpi.c') diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 245fa42..cddb898 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -51,6 +52,8 @@ #include "acpi.h" +#include + #include #include @@ -205,6 +208,7 @@ acpi_identify(driver_t *driver, device_t parent) { device_t child; int error; + caddr_t acpi_dsdt, p; #ifdef ENABLE_DEBUGGER char *debugpoint = getenv("debug.acpi.debugger"); #endif @@ -247,6 +251,19 @@ acpi_identify(driver_t *driver, device_t parent) if (debugpoint && !strcmp(debugpoint, "tables")) acpi_EnterDebugger(); #endif + + if ((acpi_dsdt = preload_search_by_type("acpi_dsdt")) != NULL) { + if ((p = preload_search_info(acpi_dsdt, MODINFO_ADDR)) != NULL) { + error = AcpiSetDsdtTablePtr(*(void **)p); + if (error != AE_OK) { + printf("ACPI: DSDT overriding failed: %s\n", + AcpiFormatException(error)); + } else { + printf("ACPI: DSDT was overridden.\n"); + } + } + } + if ((error = AcpiLoadTables()) != AE_OK) { printf("ACPI: table load failed: %s\n", AcpiFormatException(error)); return_VOID; @@ -392,6 +409,9 @@ acpi_attach(device_t dev) OID_AUTO, "suspend_state", CTLTYPE_STRING | CTLFLAG_RW, &sc->acpi_suspend_sx, 0, acpi_sleep_state_sysctl, "A", ""); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "s4bios", CTLFLAG_RD | CTLFLAG_RW, + &sc->acpi_s4bios, 0, "S4BIOS mode"); + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "verbose", CTLFLAG_RD | CTLFLAG_RW, &sc->acpi_verbose, 0, "verbose mode"); if (bootverbose) -- cgit v1.1