===== drivers/acpi/Kconfig 1.39 vs edited ===== --- 1.39/drivers/acpi/Kconfig 2004-10-26 10:44:21 +08:00 +++ edited/drivers/acpi/Kconfig 2004-11-23 15:45:25 +08:00 @@ -233,20 +233,27 @@ config ACPI_TOSHIBA If you have a legacy free Toshiba laptop (such as the Libretto L1 series), say Y. -config ACPI_CUSTOM_DSDT - bool "Include Custom DSDT" +config ACPI_CUSTOM_TABLES + bool "Include Custom System Description Tables" depends on ACPI_INTERPRETER && !STANDALONE default n help - Thist option is to load a custom ACPI DSDT + This option is to load custom ACPI System Description Tables. If you don't know what that is, say N. config ACPI_CUSTOM_DSDT_FILE string "Custom DSDT Table file to include" - depends on ACPI_CUSTOM_DSDT + depends on ACPI_CUSTOM_TABLES default "" help - Enter the full path name to the file wich includes the AmlCode declaration. + Enter the full path name to the DSDT file wich includes the AmlCode declaration. + +config ACPI_CUSTOM_SSDT_FILE + string "Custom SSDT Table file to include" + depends on ACPI_CUSTOM_TABLES + default "" + help + Enter the full path name to the SSDT file wich includes the AmlCode declaration. config ACPI_BLACKLIST_YEAR int "Disable ACPI for systems before Jan 1st this year" ===== drivers/acpi/Makefile 1.39 vs edited ===== --- 1.39/drivers/acpi/Makefile 2004-10-25 23:38:43 +08:00 +++ edited/drivers/acpi/Makefile 2004-11-23 12:36:48 +08:00 @@ -10,6 +10,15 @@ ifdef CONFIG_ACPI_DEBUG ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT endif +ifeq ($(CONFIG_ACPI_CUSTOM_TABLES), y) + ifneq ($(CONFIG_ACPI_CUSTOM_DSDT_FILE), "") + ACPI_CFLAGS += -DACPI_CUSTOM_DSDT_FILE=\"$(CONFIG_ACPI_CUSTOM_DSDT_FILE)\" + endif + ifneq ($(CONFIG_ACPI_CUSTOM_SSDT_FILE), "") + ACPI_CFLAGS += -DACPI_CUSTOM_SSDT_FILE=\"$(CONFIG_ACPI_CUSTOM_SSDT_FILE)\" + endif +endif + EXTRA_CFLAGS += $(ACPI_CFLAGS) obj-$(CONFIG_ACPI) := acpi_ksyms.o ===== drivers/acpi/osl.c 1.59 vs edited ===== --- 1.59/drivers/acpi/osl.c 2004-11-11 06:57:35 +08:00 +++ edited/drivers/acpi/osl.c 2004-11-23 15:18:54 +08:00 @@ -55,10 +55,6 @@ struct acpi_os_dpc void *context; }; -#ifdef CONFIG_ACPI_CUSTOM_DSDT -#include CONFIG_ACPI_CUSTOM_DSDT_FILE -#endif - #ifdef ENABLE_DEBUGGER #include /* stuff for debugger support */ @@ -244,14 +240,32 @@ acpi_os_table_override (struct acpi_tabl if (!existing_table || !new_table) return AE_BAD_PARAMETER; -#ifdef CONFIG_ACPI_CUSTOM_DSDT - if (strncmp(existing_table->signature, "DSDT", 4) == 0) - *new_table = (struct acpi_table_header*)AmlCode; - else - *new_table = NULL; -#else *new_table = NULL; -#endif + +#ifdef CONFIG_ACPI_CUSTOM_TABLES +#ifdef ACPI_CUSTOM_DSDT_FILE + { +#include ACPI_CUSTOM_DSDT_FILE + if (strncmp(existing_table->signature, "DSDT", 4) == 0) + *new_table = (struct acpi_table_header*)AmlCode; + } +#endif /* ACPI_CUSTOM_DSDT_FILE */ +#ifdef ACPI_CUSTOM_SSDT_FILE + { +#include ACPI_CUSTOM_SSDT_FILE + static int ssdt_overrided = 0; + + if (ssdt_overrided) + return AE_ALREADY_EXISTS; + + if (strncmp(existing_table->signature, "SSDT", 4) == 0) { + *new_table = (struct acpi_table_header*)AmlCode; + ssdt_overrided = 1; + } + } +#endif /* ACPI_CUSTOM_SSDT_FILE */ +#endif /* CONFIG_ACPI_CUSTOM_TABLES */ + return AE_OK; }