--- linux.orig/drivers/acpi/osl.c 2003-05-05 18:00:25.000000000 +0200 +++ linux/drivers/acpi/osl.c 2003-05-05 21:59:19.000000000 +0200 @@ -33,6 +33,10 @@ #include #include #include +#ifdef CONFIG_ACPI_INITRD +#include +#include +#endif #include #include #include @@ -222,14 +226,52 @@ return AE_OK; } + +#ifdef CONFIG_ACPI_INITRD +unsigned char signature[] = "INITRDDSDT123DSDT123"; + +unsigned char* get_dsdt_from_initrd(unsigned char *start, unsigned char *end) +{ + unsigned char *data; + + if (start == NULL) + return NULL; + printk(KERN_INFO "Looking for DSDT in initrd ..."); + for (data=start; data < end ; ++data) { + if (!memcmp(data, signature, sizeof(signature)-1)) { + printk(KERN_INFO " found!"); + return data+sizeof(signature); + } + } + printk(KERN_INFO " not found!"); + + return NULL; +} +#endif + acpi_status acpi_os_table_override (struct acpi_table_header *existing_table, struct acpi_table_header **new_table) { +#ifdef CONFIG_ACPI_INITRD + extern unsigned long initrd_start, initrd_end; + unsigned char* new_dsdt=NULL; + +#endif if (!existing_table || !new_table) return AE_BAD_PARAMETER; +#ifdef CONFIG_ACPI_INITRD + if (strncmp(existing_table->signature, "DSDT", 4) == 0 && + (new_dsdt=get_dsdt_from_initrd((unsigned char*)initrd_start, + (unsigned char*)initrd_end)) != NULL) + *new_table = (struct acpi_table_header*)new_dsdt; + else + *new_table = NULL; +#else *new_table = NULL; +#endif + return AE_OK; } --- linux.orig/drivers/acpi/Config.in 2003-05-05 18:44:41.000000000 +0200 +++ linux/drivers/acpi/Config.in 2003-05-05 20:19:06.000000000 +0200 @@ -12,6 +12,10 @@ bool 'CPU Enumeration Only' CONFIG_ACPI_HT_ONLY fi + if [ "$CONFIG_BLK_DEV_INITRD" = "y" ]; then + bool 'Read DSDT from initrd' CONFIG_ACPI_INITRD + fi + if [ "$CONFIG_ACPI_HT_ONLY" = "y" ]; then define_bool CONFIG_ACPI_BOOT y else --- linux.orig/Documentation/Configure.help 2003-05-05 19:51:09.000000000 +0200 +++ linux/Documentation/Configure.help 2003-05-05 20:18:56.000000000 +0200 @@ -18602,6 +18602,13 @@ handles PnP messages. All ACPI devices use its services, so using them requires saying Y here. +ACPI DSDT in initrd +CONFIG_ACPI_INITRD + The DSDT (Differentiated System Description Table) often needs to be + overridden because of a broken BIOS implementation. If you want to put + the overriden DSDT into the initrd, see http://gaugusch.at/kernel.shtml + for more info. If unsure, say N here. + ACPI System Driver CONFIG_ACPI_SYS This driver will enable your system to shut down using ACPI, and