# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1654 -> 1.1655 # include/linux/acpi.h 1.31 -> 1.32 # arch/i386/kernel/bootflag.c 1.2 -> 1.3 # arch/i386/kernel/acpi/boot.c 1.47 -> 1.48 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/03/01 len.brown@intel.com 1.1655 # [ACPI] delete ACPI table parsing code from bootflags module # -------------------------------------------- # diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c --- a/arch/i386/kernel/acpi/boot.c Mon Mar 1 03:27:20 2004 +++ b/arch/i386/kernel/acpi/boot.c Mon Mar 1 03:27:20 2004 @@ -378,6 +378,25 @@ return 0; } +static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size) +{ + struct acpi_table_sbf *sb; + + if (!phys_addr || !size) + return -EINVAL; + + sb = (struct acpi_table_sbf *) __acpi_map_table(phys_addr, size); + if (!sb) { + printk(KERN_WARNING PREFIX "Unable to map SBF\n"); + return -ENODEV; + } + + sbf_port = sb->sbf_cmos; /* Save CMOS port */ + + return 0; +} + + #ifdef CONFIG_HPET_TIMER extern unsigned long hpet_address; @@ -615,6 +634,8 @@ acpi_disabled = 1; return error; } + + (void) acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); /* * blacklist may disable ACPI entirely diff -Nru a/arch/i386/kernel/bootflag.c b/arch/i386/kernel/bootflag.c --- a/arch/i386/kernel/bootflag.c Mon Mar 1 03:27:20 2004 +++ b/arch/i386/kernel/bootflag.c Mon Mar 1 03:27:20 2004 @@ -1,6 +1,5 @@ /* - * Implement 'Simple Boot Flag Specification 1.0' - * + * Implement 'Simple Boot Flag Specification 2.0' */ @@ -11,6 +10,7 @@ #include #include #include +#include #include #include @@ -23,56 +23,8 @@ #define SBF_PARITY (1<<7) -struct sbf_boot -{ - u8 sbf_signature[4]; - u32 sbf_len; - u8 sbf_revision __attribute((packed)); - u8 sbf_csum __attribute((packed)); - u8 sbf_oemid[6] __attribute((packed)); - u8 sbf_oemtable[8] __attribute((packed)); - u8 sbf_revdata[4] __attribute((packed)); - u8 sbf_creator[4] __attribute((packed)); - u8 sbf_crearev[4] __attribute((packed)); - u8 sbf_cmos __attribute((packed)); - u8 sbf_spare[3] __attribute((packed)); -}; - - -static int sbf_port __initdata = -1; - -static int __init sbf_struct_valid(unsigned long tptr) -{ - u8 *ap; - u8 v; - unsigned int i; - struct sbf_boot sb; - - memcpy_fromio(&sb, (void *)tptr, sizeof(sb)); - - if(sb.sbf_len != 40 && sb.sbf_len != 39) - // 39 on IBM ThinkPad A21m, BIOS version 1.02b (KXET24WW; 2000-12-19). - return 0; - - ap = (u8 *)&sb; - v= 0; - - for(i=0;i1) - rsdtlen = *(u32 *)(p+20); - else - rsdtlen = 36; - - if(rsdtlen < 36 || rsdtlen > 1024) - continue; - break; - } - if(i>0xFFFE0) - return 0; - - - rsdt = ioremap(rsdtbase, rsdtlen); - if(rsdt == 0) - return 0; - - i = readl(rsdt + 4); - - /* - * Remap if needed - */ - - if(i > rsdtlen) - { - rsdtlen = i; - iounmap(rsdt); - rsdt = ioremap(rsdtbase, rsdtlen); - if(rsdt == 0) - return 0; - } - - for(n = 0; n < i; n++) - sum += readb(rsdt + n); - - if(sum) - { - iounmap(rsdt); - return 0; - } - - /* Ok the RSDT checksums too */ - - for(n = 36; n+3 < i; n += 4) - { - unsigned long rp = readl(rsdt+n); - int len = 4096; - - if(rp > 0xFFFFFFFFUL - len) - len = 0xFFFFFFFFUL - rp; - - /* Too close to the end!! */ - if(len < 20) - continue; - rp = (unsigned long)ioremap(rp, 4096); - if(rp == 0) - continue; - if(sbf_struct_valid(rp)) - { - /* Found the BOOT table and processed it */ - printk(KERN_INFO "SBF: Simple Boot Flag extension found and enabled.\n"); - } - iounmap((void *)rp); - } - iounmap(rsdt); - sbf_bootup(); return 0; } diff -Nru a/include/linux/acpi.h b/include/linux/acpi.h --- a/include/linux/acpi.h Mon Mar 1 03:27:20 2004 +++ b/include/linux/acpi.h Mon Mar 1 03:27:20 2004 @@ -233,8 +233,27 @@ } __attribute__ ((packed)); /* + * Simple Boot Flags + * http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx + */ +struct acpi_table_sbf +{ + u8 sbf_signature[4]; + u32 sbf_len; + u8 sbf_revision; + u8 sbf_csum; + u8 sbf_oemid[6]; + u8 sbf_oemtable[8]; + u8 sbf_revdata[4]; + u8 sbf_creator[4]; + u8 sbf_crearev[4]; + u8 sbf_cmos; + u8 sbf_spare[3]; +} __attribute__ ((packed)); + +/* * System Resource Affinity Table (SRAT) - * see http://www.microsoft.com/hwdev/design/srat.htm + * http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx */ struct acpi_table_srat { @@ -380,6 +399,8 @@ extern int acpi_mp_config; extern u32 pci_mmcfg_base_addr; + +extern int sbf_port ; #else /*!CONFIG_ACPI_BOOT*/