diff -Nru a/Documentation/Configure.help b/Documentation/Configure.help --- a/Documentation/Configure.help Mon Aug 18 14:54:09 2003 +++ b/Documentation/Configure.help Mon Aug 18 14:54:09 2003 @@ -13739,7 +13739,7 @@ CFI Flash device mapping on the Flaga Digital Module CONFIG_MTD_CFI_FLAGADM - Mapping for the Flaga digital module. If you don´t have one, ignore + Mapping for the Flaga digital module. If you don´t have one, ignore this setting. Momenco Ocelot boot flash device @@ -18846,19 +18846,24 @@ The ACPI Sourceforge project may also be of interest: -ACPI Processor Enumeration Only -CONFIG_ACPI_HT_ONLY - This option enables limited ACPI support -- just enough to - enumerate processors from the ACPI Multiple APIC Description - Table (MADT). Note that ACPI supports both logical (e.g. Hyper- - Threading) and physical processors, where the MultiProcessor - Specification (MPS) table only supports physical processors. +ACPI Processor Enumeration for HT +CONFIG_ACPI_HT + ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT) + and physical processors. It is designed to obsolete several older + specifications, including the MultiProcessor Specification (MPS), + which supported only physical processors. + + CONFIG_ACPI_HT includes the minimal ACPI boot-time code + necessary to enumerate logical processors and enable HT. + + CONFIG_ACPI includes CONFIG_ACPI_HT, plus IO APIC enumeration, + and the hooks to run the ACPI AML interpreter for run-time events. + + When CONFIG_ACPI is selected, the command-line option "acpi=ht" + is available to run just the ACPI boot-time code -- just as if + only CONFIG_ACPI_HT were selected. - Full ACPI support (CONFIG_ACPI) is preferred. Use this option - only if you wish to limit ACPI's role to processor enumeration. - - In this configuration, ACPI defaults to off. It must be enabled - on the command-line with the "acpismp=force" option. + Note that "acpi=off" can be used to disable all ACPI code in the kernel. Enable ACPI 2.0 with errata 1.3 CONFIG_ACPI20 @@ -23078,7 +23083,7 @@ HERMES_PRO: Hermes-Pro ISDN/LAN router with integrated 8 x hub - Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik + Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik Date of Release: 2000 (?) End of life: - @@ -24583,7 +24588,7 @@ Tulsa CONFIG_SA1100_PFS168 - The Radisys Corp. PFS-168 (aka Tulsa) is an Intel® StrongArm® SA-1110 based + The Radisys Corp. PFS-168 (aka Tulsa) is an Intel® StrongArm® SA-1110 based computer which includes the SA-1111 Microprocessor Companion Chip and other custom I/O designed to add connectivity and multimedia features for vending and business machine applications. Say Y here if you require support for diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt --- a/Documentation/kernel-parameters.txt Mon Aug 18 14:54:09 2003 +++ b/Documentation/kernel-parameters.txt Mon Aug 18 14:54:09 2003 @@ -69,8 +69,10 @@ 53c7xx= [HW,SCSI] Amiga SCSI controllers. acpi= [HW,ACPI] Advanced Configuration and Power Interface - - acpismp=force [IA-32] Early setup parse and use ACPI SMP table. + force Force ACPI on, even if blacklisted platform + off Disable ACPI + ht Limit ACPI to boot-time LAPIC enumeration for HT, + disabling the run-time AML interpreter. ad1816= [HW,SOUND] @@ -404,8 +406,6 @@ no-hlt [BUGS=IA-32] Tells the kernel that the hlt instruction doesn't work correctly and not to use it. - - noht [SMP,IA-32] Disables P4 Xeon(tm) HyperThreading. noisapnp [ISAPNP] Disables ISA PnP code. diff -Nru a/Makefile b/Makefile --- a/Makefile Mon Aug 18 14:54:09 2003 +++ b/Makefile Mon Aug 18 14:54:09 2003 @@ -135,7 +135,7 @@ DRIVERS-m := DRIVERS- := -DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o +DRIVERS-$(CONFIG_ACPI_BOOT) += drivers/acpi/acpi.o DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o DRIVERS-y += drivers/char/char.o \ drivers/block/block.o \ diff -Nru a/arch/i386/config.in b/arch/i386/config.in --- a/arch/i386/config.in Mon Aug 18 14:54:09 2003 +++ b/arch/i386/config.in Mon Aug 18 14:54:09 2003 @@ -348,6 +348,7 @@ source drivers/pnp/Config.in source drivers/block/Config.in +define_bool CONFIG_MOUNT_ROOT_FAILED_MSG y source drivers/md/Config.in diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile --- a/arch/i386/kernel/Makefile Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/Makefile Mon Aug 18 14:54:09 2003 @@ -38,7 +38,6 @@ obj-$(CONFIG_APM) += apm.o obj-$(CONFIG_ACPI_BOOT) += acpi.o obj-$(CONFIG_ACPI_SLEEP) += acpi_wakeup.o -obj-$(CONFIG_ACPI_HT_ONLY) += acpitable.o obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o diff -Nru a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c --- a/arch/i386/kernel/acpi.c Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/acpi.c Mon Aug 18 14:54:09 2003 @@ -49,13 +49,13 @@ #define PREFIX "ACPI: " -extern int acpi_disabled; - /* -------------------------------------------------------------------------- Boot-time Configuration -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_BOOT +extern int acpi_disabled; +extern int acpi_ht; enum acpi_irq_model_id acpi_irq_model; @@ -297,11 +297,33 @@ } +/* + * acpi_boot_init() + * called from setup_arch(), always. + * 1. maps ACPI tables for later use + * 2. enumerates lapics + * 3. enumerates io-apics + * + * side effects: + * acpi_lapic = 1 if LAPIC found + * acpi_ioapic = 1 if IOAPIC found + * if (acpi_lapic && acpi_ioapic) smp_found_config = 1; + * if acpi_blacklisted() acpi_disabled = 1; + * acpi_irq_model=... + * ... + * + * return value: (currently ignored) + * 0: success + * !0: failure + */ int __init acpi_boot_init (void) { int result = 0; + if (acpi_disabled && !acpi_ht) + return(1); + /* * The default interrupt routing model is PIC (8259). This gets * overriden if IOAPICs are enumerated (below). @@ -314,14 +336,15 @@ result = acpi_table_init(); if (result) return result; - +#ifdef CONFIG_ACPI result = acpi_blacklisted(); if (result) { + printk(KERN_NOTICE PREFIX "BIOS listed in blacklist, disabling ACPI support\n"); acpi_disabled = 1; return result; } - else - printk(KERN_NOTICE PREFIX "BIOS passes blacklist\n"); +#endif + #ifdef CONFIG_X86_LOCAL_APIC @@ -389,6 +412,17 @@ * I/O APIC * -------- */ + + /* + * ACPI interpreter is required to complete interrupt setup, + * so if it is off, don't enumerate the io-apics with ACPI. + * If MPS is present, it will handle them, + * otherwise the system will stay in PIC mode + */ + if (acpi_disabled) { + return(1); + } + result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic); if (!result) { diff -Nru a/arch/i386/kernel/acpitable.c b/arch/i386/kernel/acpitable.c --- a/arch/i386/kernel/acpitable.c Mon Aug 18 14:54:09 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,553 +0,0 @@ -/* - * acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1) - * - * Copyright (C) 1999 Andrew Henroid - * Copyright (C) 2001 Richard Schaal - * Copyright (C) 2001 Paul Diefenbaugh - * Copyright (C) 2001 Jun Nakajima - * Copyright (C) 2001 Arjan van de Ven - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * $Id: acpitable.c,v 1.7 2001/11/04 12:21:18 fenrus Exp $ - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "acpitable.h" - -static acpi_table_handler acpi_boot_ops[ACPI_TABLE_COUNT]; - -int acpi_lapic; - -static unsigned char __init -acpi_checksum(void *buffer, int length) -{ - int i; - unsigned char *bytebuffer; - unsigned char sum = 0; - - if (!buffer || length <= 0) - return 0; - - bytebuffer = (unsigned char *) buffer; - - for (i = 0; i < length; i++) - sum += *(bytebuffer++); - - return sum; -} - -static void __init -acpi_print_table_header(acpi_table_header * header) -{ - if (!header) - return; - - printk(KERN_INFO "ACPI table found: %.4s v%d [%.6s %.8s %d.%d]\n", - header->signature, header->revision, header->oem_id, - header->oem_table_id, header->oem_revision >> 16, - header->oem_revision & 0xffff); - - return; -} - -/******************************************************************************* - * - * FUNCTION: acpi_tb_scan_memory_for_rsdp - * - * PARAMETERS: address - Starting pointer for search - * length - Maximum length to search - * - * RETURN: Pointer to the RSDP if found and valid, otherwise NULL. - * - * DESCRIPTION: Search a block of memory for the RSDP signature - * - ******************************************************************************/ - -static void *__init -acpi_tb_scan_memory_for_rsdp(void *address, int length) -{ - u32 offset; - - if (length <= 0) - return NULL; - - /* Search from given start addr for the requested length */ - - offset = 0; - - while (offset < length) { - /* The signature must match and the checksum must be correct */ - if (strncmp(address, RSDP_SIG, sizeof(RSDP_SIG) - 1) == 0 && - acpi_checksum(address, RSDP_CHECKSUM_LENGTH) == 0) { - /* If so, we have found the RSDP */ - printk(KERN_INFO "ACPI: RSDP located at physical address %p\n", - address); - return address; - } - offset += RSDP_SCAN_STEP; - address += RSDP_SCAN_STEP; - } - - /* Searched entire block, no RSDP was found */ - printk(KERN_INFO "ACPI: Searched entire block, no RSDP was found.\n"); - return NULL; -} - -/******************************************************************************* - * - * FUNCTION: acpi_find_root_pointer - * - * PARAMETERS: none - * - * RETURN: physical address of the RSDP - * - * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor - * pointer structure. If it is found, set *RSDP to point to it. - * - * NOTE: The RSDP must be either in the first 1_k of the Extended - * BIOS Data Area or between E0000 and FFFFF (ACPI 1.0 section - * 5.2.2; assertion #421). - * - ******************************************************************************/ - -static struct acpi_table_rsdp * __init -acpi_find_root_pointer(void) -{ - struct acpi_table_rsdp * rsdp; - - /* - * Physical address is given - */ - /* - * Region 1) Search EBDA (low memory) paragraphs - */ - rsdp = acpi_tb_scan_memory_for_rsdp(__va(LO_RSDP_WINDOW_BASE), - LO_RSDP_WINDOW_SIZE); - - if (rsdp) - return rsdp; - - /* - * Region 2) Search upper memory: 16-byte boundaries in E0000h-F0000h - */ - rsdp = acpi_tb_scan_memory_for_rsdp(__va(HI_RSDP_WINDOW_BASE), - HI_RSDP_WINDOW_SIZE); - - - - if (rsdp) - return rsdp; - - printk(KERN_ERR "ACPI: System description tables not found\n"); - return NULL; -} - - -/* - * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, - * to map the target physical address. The problem is that set_fixmap() - * provides a single page, and it is possible that the page is not - * sufficient. - * By using this area, we can map up to MAX_IO_APICS pages temporarily, - * i.e. until the next __va_range() call. - * - * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* - * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and - * count idx down while incrementing the phys address. - */ -static __init char * -__va_range(unsigned long phys, unsigned long size) -{ - unsigned long base, offset, mapped_size; - int idx; - - offset = phys & (PAGE_SIZE - 1); - mapped_size = PAGE_SIZE - offset; - set_fixmap(FIX_IO_APIC_BASE_END, phys); - base = fix_to_virt(FIX_IO_APIC_BASE_END); - dprintk("__va_range(0x%lx, 0x%lx): idx=%d mapped at %lx\n", phys, size, - FIX_IO_APIC_BASE_END, base); - - /* - * Most cases can be covered by the below. - */ - idx = FIX_IO_APIC_BASE_END; - while (mapped_size < size) { - if (--idx < FIX_IO_APIC_BASE_0) - return 0; /* cannot handle this */ - phys += PAGE_SIZE; - set_fixmap(idx, phys); - mapped_size += PAGE_SIZE; - } - - return ((unsigned char *) base + offset); -} - -static int __init acpi_tables_init(void) -{ - int result = -ENODEV; - acpi_table_header *header = NULL; - struct acpi_table_rsdp *rsdp = NULL; - struct acpi_table_rsdt *rsdt = NULL; - struct acpi_table_rsdt saved_rsdt; - int tables = 0; - int type = 0; - int i = 0; - - - rsdp = (struct acpi_table_rsdp *) acpi_find_root_pointer(); - - if (!rsdp) - return -ENODEV; - - printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision, - rsdp->oem_id); - - if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) { - printk(KERN_WARNING "RSDP table signature incorrect\n"); - return -EINVAL; - } - - rsdt = (struct acpi_table_rsdt *) - __va_range(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt)); - - if (!rsdt) { - printk(KERN_WARNING "ACPI: Invalid root system description tables (RSDT)\n"); - return -ENODEV; - } - - header = & rsdt->header; - acpi_print_table_header(header); - - if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) { - printk(KERN_WARNING "ACPI: RSDT signature incorrect\n"); - return -ENODEV; - } - - /* - * The number of tables is computed by taking the - * size of all entries (header size minus total - * size of RSDT) divided by the size of each entry - * (4-byte table pointers). - */ - tables = (header->length - sizeof(acpi_table_header)) / 4; - - memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt)); - - if (saved_rsdt.header.length > sizeof(saved_rsdt)) { - printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", saved_rsdt.header.length); - return -ENODEV; - } - - for (i = 0; i < tables; i++) { - /* Map in header, then map in full table length. */ - header = (acpi_table_header *) - __va_range(saved_rsdt.entry[i], - sizeof(acpi_table_header)); - if (!header) - break; - header = (acpi_table_header *) - __va_range(saved_rsdt.entry[i], header->length); - if (!header) - break; - - acpi_print_table_header(header); - - if (acpi_checksum(header,header->length)) { - printk(KERN_WARNING "ACPI %s has invalid checksum\n", - acpi_table_signatures[i]); - continue; - } - - for (type = 0; type < ACPI_TABLE_COUNT; type++) - if (!strncmp((char *) &header->signature, - acpi_table_signatures[type],strlen(acpi_table_signatures[type]))) - break; - - if (type >= ACPI_TABLE_COUNT) { - printk(KERN_WARNING "ACPI: Unsupported table %.4s\n", - header->signature); - continue; - } - - - if (!acpi_boot_ops[type]) - continue; - - result = acpi_boot_ops[type] (header, - (unsigned long) saved_rsdt. - entry[i]); - } - - return result; -} - -static int total_cpus __initdata = 0; -int have_acpi_tables; - -extern void __init MP_processor_info(struct mpc_config_processor *); - -static void __init -acpi_parse_lapic(struct acpi_table_lapic *local_apic) -{ - struct mpc_config_processor proc_entry; - int ix = 0; - - if (!local_apic) - return; - - printk(KERN_INFO "LAPIC (acpi_id[0x%04x] id[0x%x] enabled[%d])\n", - local_apic->acpi_id, local_apic->id, local_apic->flags.enabled); - - printk(KERN_INFO "CPU %d (0x%02x00)", total_cpus, local_apic->id); - - if (local_apic->flags.enabled) { - printk(" enabled"); - ix = local_apic->id; - if (ix >= MAX_APICS) { - printk(KERN_WARNING - "Processor #%d INVALID - (Max ID: %d).\n", ix, - MAX_APICS); - return; - } - /* - * Fill in the info we want to save. Not concerned about - * the processor ID. Processor features aren't present in - * the table. - */ - proc_entry.mpc_type = MP_PROCESSOR; - proc_entry.mpc_apicid = local_apic->id; - proc_entry.mpc_cpuflag = CPU_ENABLED; - if (proc_entry.mpc_apicid == boot_cpu_physical_apicid) { - printk(" (BSP)"); - proc_entry.mpc_cpuflag |= CPU_BOOTPROCESSOR; - } - proc_entry.mpc_cpufeature = - (boot_cpu_data.x86 << 8) | - (boot_cpu_data.x86_model << 4) | - boot_cpu_data.x86_mask; - proc_entry.mpc_featureflag = boot_cpu_data.x86_capability[0]; - proc_entry.mpc_reserved[0] = 0; - proc_entry.mpc_reserved[1] = 0; - proc_entry.mpc_apicver = 0x10; /* integrated APIC */ - MP_processor_info(&proc_entry); - } else { - printk(" disabled"); - } - printk("\n"); - - total_cpus++; - return; -} - -static void __init -acpi_parse_ioapic(struct acpi_table_ioapic *ioapic) -{ - - if (!ioapic) - return; - - printk(KERN_INFO - "IOAPIC (id[0x%x] address[0x%x] global_irq_base[0x%x])\n", - ioapic->id, ioapic->address, ioapic->global_irq_base); - - if (nr_ioapics >= MAX_IO_APICS) { - printk(KERN_WARNING - "Max # of I/O APICs (%d) exceeded (found %d).\n", - MAX_IO_APICS, nr_ioapics); -/* panic("Recompile kernel with bigger MAX_IO_APICS!\n"); */ - } -} - - -/* Interrupt source overrides inform the machine about exceptions - to the normal "PIC" mode interrupt routing */ - -static void __init -acpi_parse_int_src_ovr(struct acpi_table_int_src_ovr *intsrc) -{ - if (!intsrc) - return; - - printk(KERN_INFO - "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n", - intsrc->bus, intsrc->bus_irq, intsrc->global_irq, - intsrc->flags.polarity, intsrc->flags.trigger); -} - -/* - * At this point, we look at the interrupt assignment entries in the MPS - * table. - */ - -static void __init acpi_parse_nmi_src(struct acpi_table_nmi_src *nmisrc) -{ - if (!nmisrc) - return; - - printk(KERN_INFO - "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n", - nmisrc->flags.polarity, nmisrc->flags.trigger, - nmisrc->global_irq); - -} -static void __init -acpi_parse_lapic_nmi(struct acpi_table_lapic_nmi *localnmi) -{ - if (!localnmi) - return; - - printk(KERN_INFO - "LAPIC_NMI (acpi_id[0x%04x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n", - localnmi->acpi_id, localnmi->flags.polarity, - localnmi->flags.trigger, localnmi->lint); -} -static void __init -acpi_parse_lapic_addr_ovr(struct acpi_table_lapic_addr_ovr *lapic_addr_ovr) -{ - if (!lapic_addr_ovr) - return; - - printk(KERN_INFO "LAPIC_ADDR_OVR (address[0x%lx])\n", - (unsigned long) lapic_addr_ovr->address); - -} - -static void __init -acpi_parse_plat_int_src(struct acpi_table_plat_int_src *plintsrc) -{ - if (!plintsrc) - return; - - printk(KERN_INFO - "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", - plintsrc->flags.polarity, plintsrc->flags.trigger, - plintsrc->type, plintsrc->id, plintsrc->eid, - plintsrc->iosapic_vector, plintsrc->global_irq); -} -static int __init -acpi_parse_madt(acpi_table_header * header, unsigned long phys) -{ - - struct acpi_table_madt *madt; - acpi_madt_entry_header *entry_header; - int table_size; - - madt = (struct acpi_table_madt *) __va_range(phys, header->length); - - if (!madt) - return -EINVAL; - - table_size = (int) (header->length - sizeof(*madt)); - entry_header = - (acpi_madt_entry_header *) ((void *) madt + sizeof(*madt)); - - while (entry_header && (table_size > 0)) { - switch (entry_header->type) { - case ACPI_MADT_LAPIC: - acpi_parse_lapic((struct acpi_table_lapic *) - entry_header); - break; - case ACPI_MADT_IOAPIC: - acpi_parse_ioapic((struct acpi_table_ioapic *) - entry_header); - break; - case ACPI_MADT_INT_SRC_OVR: - acpi_parse_int_src_ovr((struct acpi_table_int_src_ovr *) - entry_header); - break; - case ACPI_MADT_NMI_SRC: - acpi_parse_nmi_src((struct acpi_table_nmi_src *) - entry_header); - break; - case ACPI_MADT_LAPIC_NMI: - acpi_parse_lapic_nmi((struct acpi_table_lapic_nmi *) - entry_header); - break; - case ACPI_MADT_LAPIC_ADDR_OVR: - acpi_parse_lapic_addr_ovr((struct - acpi_table_lapic_addr_ovr *) - entry_header); - break; - case ACPI_MADT_PLAT_INT_SRC: - acpi_parse_plat_int_src((struct acpi_table_plat_int_src - *) entry_header); - break; - default: - printk(KERN_WARNING - "Unsupported MADT entry type 0x%x\n", - entry_header->type); - break; - } - table_size -= entry_header->length; - entry_header = - (acpi_madt_entry_header *) ((void *) entry_header + - entry_header->length); - } - - if (!total_cpus) { - printk("ACPI: No Processors found in the APCI table.\n"); - return -EINVAL; - } - - printk(KERN_INFO "%d CPUs total\n", total_cpus); - - if (madt->lapic_address) - mp_lapic_addr = madt->lapic_address; - else - mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; - - printk(KERN_INFO "Local APIC address %x\n", madt->lapic_address); - - return 0; -} - - -/* - * Configure the processor info using MADT in the ACPI tables. If we fail to - * configure that, then we use the MPS tables. - */ -void __init -acpi_boot_init(void) -{ - - memset(&acpi_boot_ops, 0, sizeof(acpi_boot_ops)); - acpi_boot_ops[ACPI_APIC] = acpi_parse_madt; - - /* - * Only do this when requested, either because of CPU/Bios type or from the command line - */ - - if (!acpi_tables_init()) - acpi_lapic = 1; -} - diff -Nru a/arch/i386/kernel/acpitable.h b/arch/i386/kernel/acpitable.h --- a/arch/i386/kernel/acpitable.h Mon Aug 18 14:54:09 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,260 +0,0 @@ -/* - * acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1) - * - * Copyright (C) 1999 Andrew Henroid - * Copyright (C) 2001 Richard Schaal - * Copyright (C) 2001 Paul Diefenbaugh - * Copyright (C) 2001 Jun Nakajima - * Copyright (C) 2001 Arjan van de Ven - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $ - */ - -/* - * The following codes are cut&pasted from drivers/acpi. Part of the code - * there can be not updated or delivered yet. - * To avoid conflicts when CONFIG_ACPI is defined, the following codes are - * modified so that they are self-contained in this file. - * -- jun - */ - -#ifndef _HEADER_ACPITABLE_H_ -#define _HEADER_ACPITABLE_H_ - -#define dprintk printk -typedef unsigned int ACPI_TBLPTR; - -typedef struct { /* ACPI common table header */ - char signature[4]; /* identifies type of table */ - u32 length; /* length of table, - in bytes, * including header */ - u8 revision; /* specification minor version # */ - u8 checksum; /* to make sum of entire table == 0 */ - char oem_id[6]; /* OEM identification */ - char oem_table_id[8]; /* OEM table identification */ - u32 oem_revision; /* OEM revision number */ - char asl_compiler_id[4]; /* ASL compiler vendor ID */ - u32 asl_compiler_revision; /* ASL compiler revision number */ -} acpi_table_header __attribute__ ((packed));; - -enum { - ACPI_APIC = 0, - ACPI_BOOT, - ACPI_DBGP, - ACPI_DSDT, - ACPI_ECDT, - ACPI_ETDT, - ACPI_FACP, - ACPI_FACS, - ACPI_OEMX, - ACPI_PSDT, - ACPI_SBST, - ACPI_SLIT, - ACPI_SPCR, - ACPI_SRAT, - ACPI_SSDT, - ACPI_SPMI, - ACPI_XSDT, - ACPI_TABLE_COUNT -}; - -static char *acpi_table_signatures[ACPI_TABLE_COUNT] = { - "APIC", - "BOOT", - "DBGP", - "DSDT", - "ECDT", - "ETDT", - "FACP", - "FACS", - "OEM", - "PSDT", - "SBST", - "SLIT", - "SPCR", - "SRAT", - "SSDT", - "SPMI", - "XSDT" -}; - -struct acpi_table_madt { - acpi_table_header header; - u32 lapic_address; - struct { - u32 pcat_compat:1; - u32 reserved:31; - } flags __attribute__ ((packed)); -} __attribute__ ((packed));; - -enum { - ACPI_MADT_LAPIC = 0, - ACPI_MADT_IOAPIC, - ACPI_MADT_INT_SRC_OVR, - ACPI_MADT_NMI_SRC, - ACPI_MADT_LAPIC_NMI, - ACPI_MADT_LAPIC_ADDR_OVR, - ACPI_MADT_IOSAPIC, - ACPI_MADT_LSAPIC, - ACPI_MADT_PLAT_INT_SRC, - ACPI_MADT_ENTRY_COUNT -}; - -#define RSDP_SIG "RSD PTR " -#define RSDT_SIG "RSDT" - -#define ACPI_DEBUG_PRINT(pl) - -#define ACPI_MEMORY_MODE 0x01 -#define ACPI_LOGICAL_ADDRESSING 0x00 -#define ACPI_PHYSICAL_ADDRESSING 0x01 - -#define LO_RSDP_WINDOW_BASE 0 /* Physical Address */ -#define HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */ -#define LO_RSDP_WINDOW_SIZE 0x400 -#define HI_RSDP_WINDOW_SIZE 0x20000 -#define RSDP_SCAN_STEP 16 -#define RSDP_CHECKSUM_LENGTH 20 - -typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long); - -struct acpi_table_rsdp { - char signature[8]; - u8 checksum; - char oem_id[6]; - u8 revision; - u32 rsdt_address; -} __attribute__ ((packed)); - -struct acpi_table_rsdt { - acpi_table_header header; - u32 entry[ACPI_TABLE_COUNT]; -} __attribute__ ((packed)); - -typedef struct { - u8 type; - u8 length; -} acpi_madt_entry_header __attribute__ ((packed)); - -typedef struct { - u16 polarity:2; - u16 trigger:2; - u16 reserved:12; -} acpi_madt_int_flags __attribute__ ((packed)); - -struct acpi_table_lapic { - acpi_madt_entry_header header; - u8 acpi_id; - u8 id; - struct { - u32 enabled:1; - u32 reserved:31; - } flags __attribute__ ((packed)); -} __attribute__ ((packed)); - -struct acpi_table_ioapic { - acpi_madt_entry_header header; - u8 id; - u8 reserved; - u32 address; - u32 global_irq_base; -} __attribute__ ((packed)); - -struct acpi_table_int_src_ovr { - acpi_madt_entry_header header; - u8 bus; - u8 bus_irq; - u32 global_irq; - acpi_madt_int_flags flags; -} __attribute__ ((packed)); - -struct acpi_table_nmi_src { - acpi_madt_entry_header header; - acpi_madt_int_flags flags; - u32 global_irq; -} __attribute__ ((packed)); - -struct acpi_table_lapic_nmi { - acpi_madt_entry_header header; - u8 acpi_id; - acpi_madt_int_flags flags; - u8 lint; -} __attribute__ ((packed)); - -struct acpi_table_lapic_addr_ovr { - acpi_madt_entry_header header; - u8 reserved[2]; - u64 address; -} __attribute__ ((packed)); - -struct acpi_table_iosapic { - acpi_madt_entry_header header; - u8 id; - u8 reserved; - u32 global_irq_base; - u64 address; -} __attribute__ ((packed)); - -struct acpi_table_lsapic { - acpi_madt_entry_header header; - u8 acpi_id; - u8 id; - u8 eid; - u8 reserved[3]; - struct { - u32 enabled:1; - u32 reserved:31; - } flags; -} __attribute__ ((packed)); - -struct acpi_table_plat_int_src { - acpi_madt_entry_header header; - acpi_madt_int_flags flags; - u8 type; - u8 id; - u8 eid; - u8 iosapic_vector; - u32 global_irq; - u32 reserved; -} __attribute__ ((packed)); - -/* - * ACPI Table Descriptor. One per ACPI table - */ -typedef struct acpi_table_desc { - struct acpi_table_desc *prev; - struct acpi_table_desc *next; - struct acpi_table_desc *installed_desc; - acpi_table_header *pointer; - void *base_pointer; - u8 *aml_pointer; - u64 physical_address; - u32 aml_length; - u32 length; - u32 count; - u16 table_id; - u8 type; - u8 allocation; - u8 loaded_into_namespace; - -} acpi_table_desc __attribute__ ((packed));; - -#endif diff -Nru a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c --- a/arch/i386/kernel/dmi_scan.c Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/dmi_scan.c Mon Aug 18 14:54:09 2003 @@ -115,10 +115,10 @@ * the SMBIOS version, which we don't know at this point. */ if(buf[14]!=0) - dmi_printk((KERN_INFO "DMI %d.%d present.\n", - buf[14]>>4, buf[14]&0x0F)); + printk(KERN_INFO "DMI %d.%d present.\n", + buf[14]>>4, buf[14]&0x0F); else - dmi_printk((KERN_INFO "DMI present.\n")); + printk(KERN_INFO "DMI present.\n"); dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n", num, len)); dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", @@ -148,6 +148,20 @@ static char *dmi_ident[DMI_STRING_MAX]; +/* print some information suitable for a blacklist entry. */ +void dmi_dump_system(void) +{ + printk("DMI: BIOS: %.40s, %.40s, %.40s\n", + dmi_ident[DMI_BIOS_VENDOR], dmi_ident[DMI_BIOS_VERSION], + dmi_ident[DMI_BIOS_DATE]); + printk("DMI: System: %.40s, %.40s, %.40s\n", + dmi_ident[DMI_SYS_VENDOR], dmi_ident[DMI_PRODUCT_NAME], + dmi_ident[DMI_PRODUCT_VERSION]); + printk("DMI: Board: %.40s, %.40s, %.40s\n", + dmi_ident[DMI_BOARD_VENDOR], dmi_ident[DMI_BOARD_NAME], + dmi_ident[DMI_BOARD_VERSION]); +} + /* * Save a DMI string */ @@ -459,7 +473,27 @@ broken_440gx_bios = 1; pci_probe |= PCI_BIOS_IRQ_SCAN; #endif - + return 0; +} + +/* + * ASUS K7V-RM has broken ACPI table defining sleep modes + */ + +static __init int broken_acpi_Sx(struct dmi_blacklist *d) +{ + printk(KERN_WARNING "Detected ASUS mainboard with broken ACPI sleep table\n"); + dmi_broken |= BROKEN_ACPI_Sx; + return 0; +} + +/* + * Toshiba keyboard likes to repeat keys when they are not repeated. + */ + +static __init int broken_toshiba_keyboard(struct dmi_blacklist *d) +{ + printk(KERN_WARNING "Toshiba with broken keyboard detected. If your keyboard sometimes generates 3 keypresses instead of one, contact pavel@ucw.cz\n"); return 0; } @@ -532,6 +566,58 @@ return 0; } + +extern int acpi_disabled, use_acpi_pci, acpi_force; +extern int skip_ioapic_setup; + +static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d) +{ + if (!acpi_force) { + printk(KERN_NOTICE "%s detected: acpi off\n",d->ident); + acpi_disabled = 1; + } else { + printk(KERN_NOTICE + "Warning: DMI blacklist says broken, but acpi forced\n"); + } + return 0; +} + + +#ifdef CONFIG_ACPI_BOOT +extern int acpi_ht; + +/* + * Limit ACPI to CPU enumeration for HT + */ +static __init __attribute__((unused)) int force_acpi_ht(struct dmi_blacklist *d) +{ + if (!acpi_force) { + printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident); + acpi_disabled = 1; + acpi_ht = 1; + } else { + printk(KERN_NOTICE + "Warning: acpi=force overrules DMI blacklist: acpi=ht\n"); + } + return 0; +} +#endif + +/* Default currently */ +static __init int force_acpi_pci(struct dmi_blacklist *d) +{ + printk(KERN_NOTICE "%s detected: force use of pci=acpi\n", d->ident); + use_acpi_pci = 1; + return 0; +} + +static __init int disable_acpi_pci(struct dmi_blacklist *d) +{ + printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident); + use_acpi_pci = 0; + return 0; +} + /* * Process the DMI blacklists */ @@ -625,6 +711,11 @@ MATCH(DMI_PRODUCT_NAME, "L8400K series Notebook PC"), NO_MATCH, NO_MATCH } }, + { apm_is_horked, "ABIT KX7-333[R]", { /* APM blows on shutdown */ + MATCH(DMI_BOARD_VENDOR, "ABIT"), + MATCH(DMI_BOARD_NAME, "VT8367-8233A (KX7-333[R])"), + NO_MATCH, NO_MATCH, + } }, { apm_is_horked, "Trigem Delhi3", { /* APM crashes */ MATCH(DMI_SYS_VENDOR, "TriGem Computer, Inc"), MATCH(DMI_PRODUCT_NAME, "Delhi3"), @@ -870,6 +961,16 @@ NO_MATCH, NO_MATCH, NO_MATCH } }, + { broken_acpi_Sx, "ASUS K7V-RM", { /* Bad ACPI Sx table */ + MATCH(DMI_BIOS_VERSION,"ASUS K7V-RM ACPI BIOS Revision 1003A"), + MATCH(DMI_BOARD_NAME, ""), + NO_MATCH, NO_MATCH + } }, + + { broken_toshiba_keyboard, "Toshiba Satellite 4030cdt", { /* Keyboard generates spurious repeats */ + MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), + NO_MATCH, NO_MATCH, NO_MATCH + } }, { init_ints_after_s1, "Toshiba Satellite 4030cdt", { /* Reinitialization of 8259 is needed after S1 resume */ MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), NO_MATCH, NO_MATCH, NO_MATCH @@ -897,6 +998,115 @@ NO_MATCH, NO_MATCH, NO_MATCH } }, +#ifdef CONFIG_ACPI_BOOT + /* + * If your system is blacklisted here, but you find that acpi=force + * works for you, please contact acpi-devel@sourceforge.net + */ + + /* + * Boxes that need ACPI disabled + */ + + { acpi_disable, "IBM Thinkpad", { + MATCH(DMI_BOARD_VENDOR, "IBM"), + MATCH(DMI_BOARD_NAME, "2629H1G"), + NO_MATCH, NO_MATCH }}, + + /* + * Boxes that need acpi=ht + */ + + { force_acpi_ht, "FSC Primergy T850", { + MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), + MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "DELL GX240", { + MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"), + MATCH(DMI_BOARD_NAME, "OptiPlex GX240"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "HP VISUALIZE NT Workstation", { + MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), + MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "Compaq ProLiant DL380 G2", { + MATCH(DMI_SYS_VENDOR, "Compaq"), + MATCH(DMI_PRODUCT_NAME, "ProLiant DL380 G2"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "Compaq ProLiant ML530 G2", { + MATCH(DMI_SYS_VENDOR, "Compaq"), + MATCH(DMI_PRODUCT_NAME, "ProLiant ML530 G2"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "Compaq ProLiant ML350 G3", { + MATCH(DMI_SYS_VENDOR, "Compaq"), + MATCH(DMI_PRODUCT_NAME, "ProLiant ML350 G3"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "Compaq Workstation W8000", { + MATCH(DMI_SYS_VENDOR, "Compaq"), + MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "ASUS P4B266", { + MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + MATCH(DMI_BOARD_NAME, "P4B266"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "ASUS P2B-DS", { + MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + MATCH(DMI_BOARD_NAME, "P2B-DS"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "ASUS CUR-DLS", { + MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + MATCH(DMI_BOARD_NAME, "CUR-DLS"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "ASUS A7V", { + MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), + MATCH(DMI_BOARD_NAME, ""), + MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1011"), NO_MATCH }}, + + { force_acpi_ht, "ABIT i440BX-W83977", { + MATCH(DMI_BOARD_VENDOR, "ABIT "), + MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "IBM Bladecenter", { + MATCH(DMI_BOARD_VENDOR, "IBM"), + MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "IBM eServer xSeries 360", { + MATCH(DMI_BOARD_VENDOR, "IBM"), + MATCH(DMI_BOARD_NAME, "eServer xSeries 360"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "IBM eserver xSeries 330", { + MATCH(DMI_BOARD_VENDOR, "IBM"), + MATCH(DMI_BOARD_NAME, "eserver xSeries 330"), + NO_MATCH, NO_MATCH }}, + + { force_acpi_ht, "IBM eserver xSeries 440", { + MATCH(DMI_BOARD_VENDOR, "IBM"), + MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"), + NO_MATCH, NO_MATCH }}, +#endif // CONFIG_ACPI_BOOT + + /* + * Boxes that need ACPI PCI IRQ routing disabled + */ + + { disable_acpi_pci, "ASUS A7V", { + MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), + MATCH(DMI_BOARD_NAME, ""), + MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), NO_MATCH }}, + { NULL, } }; @@ -906,11 +1116,31 @@ * returns 1 or we hit the end. */ +#define ACPI_BLACKLIST_CUTOFF_YEAR 2001 + static __init void dmi_check_blacklist(void) { struct dmi_blacklist *d; int i; + if (dmi_ident[DMI_BIOS_DATE]) { + char *s = strrchr(dmi_ident[DMI_BIOS_DATE], '/'); + if (s) { + int year, disable = 0; + s++; + year = simple_strtoul(s,NULL,0); + if (year >= 1000) + disable = year < ACPI_BLACKLIST_CUTOFF_YEAR; + else if (year < 1 || (year > 90 && year <= 99)) + disable = 1; + if (disable && !acpi_force) { + printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s); + printk(KERN_NOTICE "You can enable it with acpi=force\n"); + acpi_disabled = 1; + } + } + } + d=&dmi_blacklist[0]; while(d->callback) { @@ -988,4 +1218,30 @@ int err = dmi_iterate(dmi_decode); if(err == 0) dmi_check_blacklist(); + else + printk(KERN_INFO "DMI not present.\n"); } + +#ifdef CONFIG_MOUNT_ROOT_FAILED_MSG +/* + * mount_root_failed_msg() + * + * Called from mount_block_root() upon failure to mount root. + * architecture dependent to give different platforms + * the opportunity to print different handy messages + * On x86 this lives here b/c it dumps out some DMI info. + */ + +void +mount_root_failed_msg(void) +{ +#ifdef CONFIG_ACPI_BOOT + printk ("Try booting with pci=noacpi, acpi=ht, " + "or acpi=off on the command line.\n"); + printk ("If one helps, please report the following lines:\n"); + + dmi_dump_system(); +#endif +} +#endif /* CONFIG_MOUNT_ROOT_FAILED_MSG */ + diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/io_apic.c Mon Aug 18 14:54:09 2003 @@ -1825,7 +1825,7 @@ } -int io_apic_set_pci_routing (int ioapic, int pin, int irq) +int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low) { struct IO_APIC_route_entry entry; unsigned long flags; @@ -1848,18 +1848,22 @@ entry.dest_mode = INT_DELIVERY_MODE; entry.dest.logical.logical_dest = target_cpus(); entry.mask = 1; /* Disabled (masked) */ - entry.trigger = 1; /* Level sensitive */ - entry.polarity = 1; /* Low active */ + entry.trigger = edge_level; + entry.polarity = active_high_low; add_pin_to_irq(irq, ioapic, pin); entry.vector = assign_irq_vector(irq); printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " - "IRQ %d)\n", ioapic, - mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq); + "IRQ %d Mode:%i Active:%i)\n", ioapic, + mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, edge_level, active_high_low); + if (edge_level) { irq_desc[irq].handler = &ioapic_level_irq_type; + } else { + irq_desc[irq].handler = &ioapic_edge_irq_type; + } set_intr_gate(entry.vector, interrupt[irq]); diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c --- a/arch/i386/kernel/mpparse.c Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/mpparse.c Mon Aug 18 14:54:09 2003 @@ -768,10 +768,11 @@ struct intel_mp_floating *mpf = mpf_found; /* - * ACPI may be used to obtain the entire SMP configuration or just to - * enumerate/configure processors (CONFIG_ACPI_HT_ONLY). Note that - * ACPI supports both logical (e.g. Hyper-Threading) and physical - * processors, where MPS only supports physical. + * ACPI can either augment or replace MPS. + * If MPS is present, ACPI could be used to just enumerate/configure + * the logical processors (acpi_lapic) -- the minimal way + * to enable HT. But as we don't want HT to depend on MPS, + * we use ACPI for both acpi_lapic and acpi_ioapic configuration. */ if (acpi_lapic && acpi_ioapic) { printk(KERN_INFO "Using ACPI (MADT) for SMP configuration information\n"); @@ -1152,7 +1153,8 @@ mp_bus_id_to_local = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 2]; mp_bus_id_to_pci_bus = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 3]; mp_irqs = (struct mpc_config_intsrc *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 4]; - memset(mp_bus_id_to_pci_bus, -1, MAX_MP_BUSSES); + for (i = 0; i < MAX_MP_BUSSES; ++i) + mp_bus_id_to_pci_bus[i] = -1; /* * Fabricate the legacy ISA bus (bus #31). @@ -1197,6 +1199,9 @@ panic("Max # of irq sources exceeded!\n"); } } +#endif /* CONFIG_ACPI_BOOT */ + +#ifdef CONFIG_ACPI /* Ensure the ACPI SCI interrupt level is active low, edge-triggered */ @@ -1249,7 +1254,7 @@ ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start; - io_apic_set_pci_routing(ioapic, ioapic_pin, irq); + io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); // Active low, level triggered } @@ -1263,6 +1268,8 @@ int ioapic_pin = 0; int irq = 0; int idx, bit = 0; + int edge_level = 0; + int active_high_low = 0; /* * Parsing through the PCI Interrupt Routing Table (PRT) and program @@ -1273,12 +1280,16 @@ /* Need to get irq for dynamic entry */ if (entry->link.handle) { - irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); + irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low); if (!irq) continue; } - else + else { + /* Hardwired IRQ. Assume PCI standard settings */ irq = entry->link.index; + edge_level = 1; + active_high_low = 1; + } /* Don't set up the ACPI SCI because it's already set up */ if (acpi_fadt.sci_int == irq) @@ -1311,7 +1322,7 @@ mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<irq = irq; printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n", @@ -1321,6 +1332,9 @@ entry->irq); } + + + return; } @@ -1328,4 +1342,4 @@ #endif /*CONFIG_X86_IO_APIC*/ -#endif /*CONFIG_ACPI_BOOT*/ +#endif /*CONFIG_ACPI*/ diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/setup.c Mon Aug 18 14:54:09 2003 @@ -173,16 +173,22 @@ static int have_cpuid_p(void) __init; static int disable_x86_serial_nr __initdata = 1; -static int disable_x86_ht __initdata = 0; static u32 disabled_x86_caps[NCAPINTS] __initdata = { 0 }; -#ifdef CONFIG_ACPI_HT_ONLY -int acpi_disabled = 1; +#ifdef CONFIG_ACPI + int acpi_disabled __initdata = 0; #else -int acpi_disabled = 0; + int acpi_disabled __initdata = 1; #endif EXPORT_SYMBOL(acpi_disabled); +#ifdef CONFIG_ACPI_BOOT + int acpi_ht __initdata = 1; /* enable HT */ +#endif + + +int acpi_force __initdata = 0; + extern int blk_nohighio; /* @@ -804,20 +810,27 @@ } } - /* "noht" disables HyperThreading (2 logical cpus per Xeon) */ - else if (!memcmp(from, "noht", 4)) { - disable_x86_ht = 1; - set_bit(X86_FEATURE_HT, disabled_x86_caps); - } - - /* "acpi=off" disables both ACPI table parsing and interpreter init */ - else if (!memcmp(from, "acpi=off", 8)) +#ifdef CONFIG_ACPI_BOOT + /* "acpi=off" disables both ACPI table parsing and interpreter */ + else if (!memcmp(from, "acpi=off", 8)) { + acpi_ht = 0; acpi_disabled = 1; + } - /* "acpismp=force" turns on ACPI again */ - else if (!memcmp(from, "acpismp=force", 13)) + /* acpi=force to over-ride black-list */ + else if (!memcmp(from, "acpi=force", 10)) { + acpi_force = 1; + acpi_ht=1; acpi_disabled = 0; + } + + /* Limit ACPI to boot-time only, still enabled HT */ + else if (!memcmp(from, "acpi=ht", 7)) { + acpi_ht = 1; + if (!acpi_force) acpi_disabled = 1; + } +#endif /* * highmem=size forces highmem to be exactly 'size' bytes. * This works even on boxes that have no highmem otherwise. @@ -1152,11 +1165,6 @@ max_low_pfn = setup_memory(); - if (disable_x86_ht) { - clear_bit(X86_FEATURE_HT, &boot_cpu_data.x86_capability[0]); - set_bit(X86_FEATURE_HT, disabled_x86_caps); - } - /* * NOTE: before this point _nobody_ is allowed to allocate * any memory using the bootmem allocator. @@ -1166,12 +1174,14 @@ smp_alloc_memory(); /* AP processor realmode stacks in low memory*/ #endif paging_init(); -#ifdef CONFIG_ACPI + + dmi_scan_machine(); + +#ifdef CONFIG_ACPI_BOOT /* * Parse the ACPI tables for possible boot-time SMP configuration. */ - if (!acpi_disabled) - acpi_boot_init(); + (void) acpi_boot_init(); #endif #ifdef CONFIG_X86_LOCAL_APIC /* @@ -1190,7 +1200,6 @@ conswitchp = &dummy_con; #endif #endif - dmi_scan_machine(); } static int cachesize_override __initdata = -1; @@ -2406,7 +2415,7 @@ strcpy(c->x86_model_id, p); #ifdef CONFIG_SMP - if (test_bit(X86_FEATURE_HT, &c->x86_capability) && !disable_x86_ht) { + if (test_bit(X86_FEATURE_HT, &c->x86_capability)) { extern int phys_proc_id[NR_CPUS]; u32 eax, ebx, ecx, edx; diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c --- a/arch/i386/kernel/smpboot.c Mon Aug 18 14:54:09 2003 +++ b/arch/i386/kernel/smpboot.c Mon Aug 18 14:54:09 2003 @@ -1034,7 +1034,7 @@ * If we couldnt find an SMP configuration at boot time, * get out of here now! */ - if (!smp_found_config) { + if (!smp_found_config && !acpi_lapic) { printk(KERN_NOTICE "SMP motherboard not detected.\n"); #ifndef CONFIG_VISWS io_apic_irqs = 0; diff -Nru a/drivers/Makefile b/drivers/Makefile --- a/drivers/Makefile Mon Aug 18 14:54:09 2003 +++ b/drivers/Makefile Mon Aug 18 14:54:09 2003 @@ -45,7 +45,7 @@ # CONFIG_HAMRADIO can be set without CONFIG_NETDEVICE being set -- ch subdir-$(CONFIG_HAMRADIO) += net/hamradio subdir-$(CONFIG_I2C) += i2c -subdir-$(CONFIG_ACPI) += acpi +subdir-$(CONFIG_ACPI_BOOT) += acpi subdir-$(CONFIG_BLUEZ) += bluetooth diff -Nru a/drivers/acpi/Config.in b/drivers/acpi/Config.in --- a/drivers/acpi/Config.in Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/Config.in Mon Aug 18 14:54:09 2003 @@ -5,40 +5,40 @@ if [ "$CONFIG_X86" = "y" ]; then mainmenu_option next_comment - comment 'ACPI Support' - bool 'ACPI Support' CONFIG_ACPI + comment 'ACPI (Advanced Configuration and Power Interface) Support' + + bool 'Minimal ACPI LAPIC enumeration to enable HT' CONFIG_ACPI_HT + + if [ "$CONFIG_ACPI_HT" = "y" ]; then + bool 'Full ACPI Support, including AML interpreter for run-time events' CONFIG_ACPI + define_bool CONFIG_ACPI_BOOT y + else + define_bool CONFIG_ACPI n + fi + if [ "$CONFIG_ACPI" = "y" ]; then - if [ "$CONFIG_X86_LOCAL_APIC" = "y" ]; then - bool 'CPU Enumeration Only' CONFIG_ACPI_HT_ONLY - else - define_bool CONFIG_ACPI_HT_ONLY n + define_bool CONFIG_ACPI_BUS y + define_bool CONFIG_ACPI_INTERPRETER y + define_bool CONFIG_ACPI_EC y + define_bool CONFIG_ACPI_POWER y + if [ "$CONFIG_PCI" = "y" ]; then + define_bool CONFIG_ACPI_PCI y fi - - if [ "$CONFIG_ACPI_HT_ONLY" = "n" ]; then - define_bool CONFIG_ACPI_BOOT y - define_bool CONFIG_ACPI_BUS y - define_bool CONFIG_ACPI_INTERPRETER y - define_bool CONFIG_ACPI_EC y - define_bool CONFIG_ACPI_POWER y - if [ "$CONFIG_PCI" = "y" ]; then - define_bool CONFIG_ACPI_PCI y - fi - define_bool CONFIG_ACPI_SLEEP y - define_bool CONFIG_ACPI_SYSTEM y - tristate ' AC Adapter' CONFIG_ACPI_AC - tristate ' Battery' CONFIG_ACPI_BATTERY - tristate ' Button' CONFIG_ACPI_BUTTON - tristate ' Fan' CONFIG_ACPI_FAN - tristate ' Processor' CONFIG_ACPI_PROCESSOR - dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR - if [ "$CONFIG_NUMA" = "y" -a "$CONFIG_X86_64" != "y" ]; then - dep_bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA - fi - tristate ' ASUS Laptop Extras' CONFIG_ACPI_ASUS - tristate ' Toshiba Laptop Extras' CONFIG_ACPI_TOSHIBA - bool ' Debug Statements' CONFIG_ACPI_DEBUG - bool ' Relaxed AML Checking' CONFIG_ACPI_RELAXED_AML + define_bool CONFIG_ACPI_SLEEP y + define_bool CONFIG_ACPI_SYSTEM y + tristate ' AC Adapter' CONFIG_ACPI_AC + tristate ' Battery' CONFIG_ACPI_BATTERY + tristate ' Button' CONFIG_ACPI_BUTTON + tristate ' Fan' CONFIG_ACPI_FAN + tristate ' Processor' CONFIG_ACPI_PROCESSOR + dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR + if [ "$CONFIG_NUMA" = "y" -a "$CONFIG_X86_64" != "y" ]; then + dep_bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA fi + tristate ' ASUS Laptop Extras' CONFIG_ACPI_ASUS + tristate ' Toshiba Laptop Extras' CONFIG_ACPI_TOSHIBA + bool ' Debug Statements' CONFIG_ACPI_DEBUG + bool ' Relaxed AML Checking' CONFIG_ACPI_RELAXED_AML fi endmenu diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile --- a/drivers/acpi/Makefile Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/Makefile Mon Aug 18 14:54:09 2003 @@ -16,14 +16,13 @@ export-objs := acpi_ksyms.o processor.o -obj-y := acpi_ksyms.o +obj-$(CONFIG_ACPI) := acpi_ksyms.o # # ACPI Boot-Time Table Parsing # -ifeq ($(CONFIG_ACPI_BOOT),y) - obj-y += tables.o blacklist.o -endif +obj-$(CONFIG_ACPI_BOOT) += tables.o +obj-$(CONFIG_ACPI) += blacklist.o # # ACPI Core Subsystem (Interpreter) diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c --- a/drivers/acpi/bus.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/bus.c Mon Aug 18 14:54:09 2003 @@ -2037,7 +2037,7 @@ acpi_set_debug(ACPI_DEBUG_LOW); if (acpi_disabled) { - printk(KERN_INFO PREFIX "Disabled via command line (acpi=off)\n"); + printk(KERN_INFO PREFIX "Interpreter disabled.\n"); return -ENODEV; } diff -Nru a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c --- a/drivers/acpi/executer/exutils.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/executer/exutils.c Mon Aug 18 14:54:09 2003 @@ -290,7 +290,7 @@ * acpi_integer is unsigned, so we don't worry about a '-' */ if ((current_value = value) == 0) { - return_VALUE (1); + return_VALUE (1); } num_digits = 0; diff -Nru a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c --- a/drivers/acpi/hardware/hwregs.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/hardware/hwregs.c Mon Aug 18 14:54:09 2003 @@ -357,9 +357,9 @@ /* * Decode the Register ID - * Register id = Register block id | bit id + * Register ID = [Register block ID] | [bit ID] * - * Check bit id to fine locate Register offset. + * Check bit ID to fine locate Register offset. * Check Mask to determine Register offset, and then read-write. */ switch (bit_reg_info->parent_register) { @@ -367,9 +367,9 @@ /* * Status Registers are different from the rest. Clear by - * writing 1, writing 0 has no effect. So, the only relevant + * writing 1, and writing 0 has no effect. So, the only relevant * information is the single bit we're interested in, all others should - * be written as 0 so they will be left unchanged + * be written as 0 so they will be left unchanged. */ value = ACPI_REGISTER_PREPARE_BITS (value, bit_reg_info->bit_position, bit_reg_info->access_bit_mask); @@ -394,17 +394,17 @@ case ACPI_REGISTER_PM1_CONTROL: /* - * Read the PM1 Control register. + * Write the PM1 Control register. * Note that at this level, the fact that there are actually TWO - * registers (A and B - and that B may not exist) is abstracted. + * registers (A and B - and B may not exist) is abstracted. */ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", register_value)); ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position, bit_reg_info->access_bit_mask, value); - status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, register_id, - (u16) register_value); + status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM1_CONTROL, (u16) register_value); break; @@ -724,7 +724,7 @@ /* * Three address spaces supported: - * Memory, Io, or PCI config. + * Memory, IO, or PCI_Config. */ switch (reg->address_space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: @@ -808,9 +808,10 @@ (!reg->address)) { return (AE_OK); } + /* * Three address spaces supported: - * Memory, Io, or PCI config. + * Memory, IO, or PCI_Config. */ switch (reg->address_space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c --- a/drivers/acpi/osl.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/osl.c Mon Aug 18 14:54:09 2003 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -251,7 +252,12 @@ irq = acpi_fadt.sci_int; #ifdef CONFIG_IA64 - irq = gsi_to_vector(irq); + irq = acpi_irq_to_vector(irq); + if (irq < 0) { + printk(KERN_ERR PREFIX "SCI (ACPI interrupt %d) not registered\n", + acpi_fadt.sci_int); + return AE_OK; + } #endif acpi_irq_irq = irq; acpi_irq_handler = handler; @@ -269,7 +275,7 @@ { if (acpi_irq_handler) { #ifdef CONFIG_IA64 - irq = gsi_to_vector(irq); + irq = acpi_irq_to_vector(irq); #endif free_irq(irq, acpi_irq); acpi_irq_handler = NULL; @@ -292,11 +298,14 @@ void acpi_os_stall(u32 us) { - if (us > 10000) { - mdelay(us / 1000); - } - else { - udelay(us); + while (us) { + u32 delay = 1000; + + if (delay > us) + delay = us; + udelay(delay); + touch_nmi_watchdog(); + us -= delay; } } @@ -728,7 +737,7 @@ if (flags & ACPI_NOT_ISR) ACPI_DISABLE_IRQS(); - spin_lock(handle); + spin_lock((spinlock_t *)handle); return_VOID; } @@ -747,7 +756,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Releasing spinlock[%p] from %s level\n", handle, ((flags & ACPI_NOT_ISR) ? "non-interrupt" : "interrupt"))); - spin_unlock(handle); + spin_unlock((spinlock_t *)handle); if (flags & ACPI_NOT_ISR) ACPI_ENABLE_IRQS(); diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/pci_irq.c Mon Aug 18 14:54:09 2003 @@ -24,6 +24,8 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include + #include #include #include @@ -36,6 +38,9 @@ #ifdef CONFIG_X86_IO_APIC #include #endif +#ifdef CONFIG_IOSAPIC +# include +#endif #include #include @@ -253,7 +258,7 @@ } if (!entry->irq && entry->link.handle) { - entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); + entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, NULL, NULL); if (!entry->irq) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n")); return_VALUE(0); @@ -373,6 +378,10 @@ eisa_set_level_irq(dev->irq); } #endif +#ifdef CONFIG_IOSAPIC + if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC) + iosapic_enable_intr(dev->irq); +#endif return_VALUE(dev->irq); } @@ -392,7 +401,9 @@ } /* Make sure all link devices have a valid IRQ. */ - acpi_pci_link_check(); + if (acpi_pci_link_check()) { + return_VALUE(-ENODEV); + } #ifdef CONFIG_X86_IO_APIC /* Program IOAPICs using data from PRT entries. */ diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c --- a/drivers/acpi/pci_link.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/pci_link.c Mon Aug 18 14:54:09 2003 @@ -65,6 +65,9 @@ struct acpi_pci_link_irq { u8 active; /* Current IRQ */ + u8 edge_level; /* All IRQs */ + u8 active_high_low; /* All IRQs */ + u8 setonboot; u8 possible_count; u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE]; }; @@ -114,6 +117,8 @@ link->irq.possible[i] = p->interrupts[i]; link->irq.possible_count++; } + link->irq.edge_level = p->edge_level; + link->irq.active_high_low = p->active_high_low; break; } case ACPI_RSTYPE_EXT_IRQ: @@ -132,6 +137,8 @@ link->irq.possible[i] = p->interrupts[i]; link->irq.possible_count++; } + link->irq.edge_level = p->edge_level; + link->irq.active_high_low = p->active_high_low; break; } default: @@ -260,7 +267,6 @@ * IRQ a boot-enabled Link device is set to is the correct one. * (Required to support systems such as the Toshiba 5005-S504.) */ - link->irq.active = irq; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); @@ -290,28 +296,33 @@ if (!link || !irq) return_VALUE(-EINVAL); - /* See if we're already at the target IRQ. */ - if (irq == link->irq.active) - return_VALUE(0); - - /* Make sure the target IRQ in the list of possible IRQs. */ - for (i=0; iirq.possible_count; i++) { - if (irq == link->irq.possible[i]) - valid = 1; - } - if (!valid) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Target IRQ %d invalid\n", irq)); - return_VALUE(-EINVAL); + /* We don't check irqs the first time around */ + if (link->irq.setonboot) { + /* See if we're already at the target IRQ. */ + if (irq == link->irq.active) + return_VALUE(0); + + /* Make sure the target IRQ in the list of possible IRQs. */ + for (i=0; iirq.possible_count; i++) { + if (irq == link->irq.possible[i]) + valid = 1; + } + if (!valid) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Target IRQ %d invalid\n", irq)); + return_VALUE(-EINVAL); + } } memset(&resource, 0, sizeof(resource)); - /* NOTE: PCI interrupts are always level / active_low / shared. */ + /* NOTE: PCI interrupts are always level / active_low / shared. But not all + interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for + parameters */ if (irq <= 15) { resource.res.id = ACPI_RSTYPE_IRQ; resource.res.length = sizeof(struct acpi_resource); - resource.res.data.irq.edge_level = ACPI_LEVEL_SENSITIVE; - resource.res.data.irq.active_high_low = ACPI_ACTIVE_LOW; + resource.res.data.irq.edge_level = link->irq.edge_level; + resource.res.data.irq.active_high_low = link->irq.active_high_low; resource.res.data.irq.shared_exclusive = ACPI_SHARED; resource.res.data.irq.number_of_interrupts = 1; resource.res.data.irq.interrupts[0] = irq; @@ -320,8 +331,8 @@ resource.res.id = ACPI_RSTYPE_EXT_IRQ; resource.res.length = sizeof(struct acpi_resource); resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER; - resource.res.data.extended_irq.edge_level = ACPI_LEVEL_SENSITIVE; - resource.res.data.extended_irq.active_high_low = ACPI_ACTIVE_LOW; + resource.res.data.extended_irq.edge_level = link->irq.edge_level; + resource.res.data.extended_irq.active_high_low = link->irq.active_high_low; resource.res.data.extended_irq.shared_exclusive = ACPI_SHARED; resource.res.data.extended_irq.number_of_interrupts = 1; resource.res.data.extended_irq.interrupts[0] = irq; @@ -329,6 +340,7 @@ } resource.end.id = ACPI_RSTYPE_END_TAG; + /* Attempt to set the resource */ status = acpi_set_current_resources(link->handle, &buffer); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); @@ -351,11 +363,13 @@ if (result) { return_VALUE(result); } + if (link->irq.active != irq) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Attempt to enable at IRQ %d resulted in IRQ %d\n", irq, link->irq.active)); link->irq.active = 0; + acpi_ut_evaluate_object (link->handle, "_DIS", 0, NULL); return_VALUE(-ENODEV); } @@ -403,7 +417,7 @@ ACPI_FUNCTION_TRACE("acpi_pci_link_check"); /* - * Pass #1: Update penalties to facilitate IRQ balancing. + * Update penalties to facilitate IRQ balancing. */ list_for_each(node, &acpi_link.entries) { @@ -424,23 +438,23 @@ } } - /* - * Pass #2: Enable boot-disabled Links at 'best' IRQ. - */ - list_for_each(node, &acpi_link.entries) { - int irq = 0; - int i = 0; + return_VALUE(0); +} - link = list_entry(node, struct acpi_pci_link, node); - if (!link || !link->irq.possible_count) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); - continue; - } +static int acpi_pci_link_allocate(struct acpi_pci_link* link) { + int irq; + int i; - if (link->irq.active) - continue; + ACPI_FUNCTION_TRACE("acpi_pci_link_allocate"); + + if (link->irq.setonboot) + return_VALUE(0); + if (link->irq.active) { + irq = link->irq.active; + } else { irq = link->irq.possible[0]; + } /* * Select the best IRQ. This is done in reverse to promote @@ -451,16 +465,20 @@ irq = link->irq.possible[i]; } - /* Enable the link device at this IRQ. */ - acpi_pci_link_set(link, irq); - + /* Attempt to enable the link device at this IRQ. */ + if (acpi_pci_link_set(link, irq)) { + printk(PREFIX "Unable to set IRQ for %s [%s] (likely buggy ACPI BIOS). Aborting ACPI-based IRQ routing. Try pci=noacpi or acpi=off\n", + acpi_device_name(link->device), + acpi_device_bid(link->device)); + return_VALUE(-ENODEV); + } else { acpi_irq_penalty[link->irq.active] += 100; - printk(PREFIX "%s [%s] enabled at IRQ %d\n", acpi_device_name(link->device), acpi_device_bid(link->device), link->irq.active); } + link->irq.setonboot = 1; return_VALUE(0); } @@ -468,7 +486,9 @@ int acpi_pci_link_get_irq ( acpi_handle handle, - int index) + int index, + int* edge_level, + int* active_high_low) { int result = 0; struct acpi_device *device = NULL; @@ -494,11 +514,17 @@ return_VALUE(0); } + if (acpi_pci_link_allocate(link)) { + return -ENODEV; + } + if (!link->irq.active) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); return_VALUE(0); } + if (edge_level) *edge_level = link->irq.edge_level; + if (active_high_low) *active_high_low = link->irq.active_high_low; return_VALUE(link->irq.active); } diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c --- a/drivers/acpi/processor.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/processor.c Mon Aug 18 14:54:09 2003 @@ -2273,7 +2273,6 @@ if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error removing notify handler\n")); - return_VALUE(-ENODEV); } acpi_processor_remove_fs(device); diff -Nru a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c --- a/drivers/acpi/tables/tbconvrt.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/tables/tbconvrt.c Mon Aug 18 14:54:09 2003 @@ -75,14 +75,10 @@ ACPI_FUNCTION_ENTRY (); -#if ACPI_MACHINE_WIDTH != 64 - if (RSDP->revision < 2) { pointer_size = sizeof (u32); } - else -#endif - { + else { pointer_size = sizeof (u64); } diff -Nru a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c --- a/drivers/acpi/tables/tbget.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/tables/tbget.c Mon Aug 18 14:54:09 2003 @@ -145,7 +145,7 @@ /* Create a logical address for the physical pointer*/ status = acpi_os_map_memory (address->pointer.physical, sizeof (struct acpi_table_header), - (void **) &header); + (void *) &header); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n", ACPI_HIDWORD (address->pointer.physical), @@ -361,7 +361,7 @@ * into our address space. */ status = acpi_os_map_memory (address->pointer.physical, (acpi_size) header->length, - (void **) &full_table); + (void *) &full_table); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n", header->signature, diff -Nru a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c --- a/drivers/acpi/tables/tbinstal.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/tables/tbinstal.c Mon Aug 18 14:54:09 2003 @@ -271,22 +271,40 @@ if (list_head->next) { return_ACPI_STATUS (AE_ALREADY_EXISTS); } - } - /* - * Link the new table in to the list of tables of this type. - * Just insert at the start of the list, order unimportant. - * - * table_desc->Prev is already NULL from calloc() - */ - table_desc->next = list_head->next; - list_head->next = table_desc; + table_desc->next = list_head->next; + list_head->next = table_desc; + + if (table_desc->next) { + table_desc->next->prev = table_desc; + } - if (table_desc->next) { - table_desc->next->prev = table_desc; + list_head->count++; } + else { + /* + * Link the new table in to the list of tables of this type. + * Insert at the end of the list, order IS IMPORTANT. + * + * table_desc->Prev & Next are already NULL from calloc() + */ + list_head->count++; + + if (!list_head->next) { + list_head->next = table_desc; + } + else { + table_desc->next = list_head->next; - list_head->count++; + while (table_desc->next->next) { + table_desc->next = table_desc->next->next; + } + + table_desc->next->next = table_desc; + table_desc->prev = table_desc->next; + table_desc->next = NULL; + } + } /* Finish initialization of the table descriptor */ diff -Nru a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c --- a/drivers/acpi/tables/tbrsdt.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/tables/tbrsdt.c Mon Aug 18 14:54:09 2003 @@ -85,7 +85,7 @@ * Obtain access to the RSDP structure */ status = acpi_os_map_memory (address->pointer.physical, sizeof (struct rsdp_descriptor), - (void **) &rsdp); + (void *) &rsdp); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } diff -Nru a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c --- a/drivers/acpi/tables/tbxfroot.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/tables/tbxfroot.c Mon Aug 18 14:54:09 2003 @@ -179,7 +179,7 @@ if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) { status = acpi_os_map_memory (rsdp_address.pointer.physical, sizeof (struct rsdp_descriptor), - (void **) &acpi_gbl_RSDP); + (void *) &acpi_gbl_RSDP); if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -423,7 +423,7 @@ * 1) Search EBDA (low memory) paragraphs */ status = acpi_os_map_memory ((u64) ACPI_LO_RSDP_WINDOW_BASE, ACPI_LO_RSDP_WINDOW_SIZE, - (void **) &table_ptr); + (void *) &table_ptr); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %X for length %X\n", ACPI_LO_RSDP_WINDOW_BASE, ACPI_LO_RSDP_WINDOW_SIZE)); @@ -447,7 +447,7 @@ * 2) Search upper memory: 16-byte boundaries in E0000h-F0000h */ status = acpi_os_map_memory ((u64) ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE, - (void **) &table_ptr); + (void *) &table_ptr); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %X for length %X\n", ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE)); diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/tables.c Mon Aug 18 14:54:09 2003 @@ -33,6 +33,7 @@ #include #include #include +#include #define PREFIX "ACPI: " @@ -61,16 +62,14 @@ /* System Description Table (RSDT/XSDT) */ struct acpi_table_sdt { - unsigned long pa; /* Physical Address */ - unsigned long count; /* Table count */ - struct { - unsigned long pa; - enum acpi_table_id id; - unsigned long size; - } entry[ACPI_MAX_TABLES]; + unsigned long pa; + enum acpi_table_id id; + unsigned long size; } __attribute__ ((packed)); -static struct acpi_table_sdt sdt; +static unsigned long sdt_pa; /* Physical Address */ +static unsigned long sdt_count; /* Table count */ +static struct acpi_table_sdt *sdt_entry; void acpi_table_print ( @@ -97,10 +96,11 @@ else name = header->signature; - printk(KERN_INFO PREFIX "%.4s (v%3.3d %6.6s %8.8s %5.5d.%5.5d) @ 0x%p\n", + printk(KERN_INFO PREFIX "%.4s (v%3.3d %6.6s %8.8s 0x%08x %.4s 0x%08x) @ 0x%p\n", name, header->revision, header->oem_id, - header->oem_table_id, header->oem_revision >> 16, - header->oem_revision & 0xffff, (void *) phys_addr); + header->oem_table_id, header->oem_revision, + header->asl_compiler_id, header->asl_compiler_revision, + (void *) phys_addr); } @@ -220,12 +220,16 @@ return (sum & 0xFF); } +/* + * acpi_get_table_header_early() + * for acpi_blacklisted(), acpi_table_get_sdt() + */ int __init acpi_get_table_header_early ( enum acpi_table_id id, struct acpi_table_header **header) { - int i; + unsigned int i; enum acpi_table_id temp_id; /* DSDT is different from the rest */ @@ -236,11 +240,11 @@ /* Locate the table. */ - for (i = 0; i < sdt.count; i++) { - if (sdt.entry[i].id != temp_id) + for (i = 0; i < sdt_count; i++) { + if (sdt_entry[i].id != temp_id) continue; *header = (void *) - __acpi_map_table(sdt.entry[i].pa, sdt.entry[i].size); + __acpi_map_table(sdt_entry[i].pa, sdt_entry[i].size); if (!*header) { printk(KERN_WARNING PREFIX "Unable to map %s\n", acpi_table_signatures[temp_id]); @@ -282,18 +286,18 @@ acpi_table_entry_header *entry = NULL; unsigned long count = 0; unsigned long madt_end = 0; - int i = 0; + unsigned int i = 0; if (!handler) return -EINVAL; /* Locate the MADT (if exists). There should only be one. */ - for (i = 0; i < sdt.count; i++) { - if (sdt.entry[i].id != id) + for (i = 0; i < sdt_count; i++) { + if (sdt_entry[i].id != id) continue; madt = (void *) - __acpi_map_table(sdt.entry[i].pa, sdt.entry[i].size); + __acpi_map_table(sdt_entry[i].pa, sdt_entry[i].size); if (!madt) { printk(KERN_WARNING PREFIX "Unable to map %s\n", acpi_table_signatures[id]); @@ -308,7 +312,7 @@ return -ENODEV; } - madt_end = (unsigned long) madt + sdt.entry[i].size; + madt_end = (unsigned long) madt + sdt_entry[i].size; /* Parse all entries looking for a match. */ @@ -344,15 +348,15 @@ acpi_table_handler handler) { int count = 0; - int i = 0; + unsigned int i = 0; if (!handler) return -EINVAL; - for (i = 0; i < sdt.count; i++) { - if (sdt.entry[i].id != id) + for (i = 0; i < sdt_count; i++) { + if (sdt_entry[i].id != id) continue; - handler(sdt.entry[i].pa, sdt.entry[i].size); + handler(sdt_entry[i].pa, sdt_entry[i].size); count++; } @@ -365,7 +369,7 @@ struct acpi_table_rsdp *rsdp) { struct acpi_table_header *header = NULL; - int i, id = 0; + unsigned int i, id = 0; if (!rsdp) return -EINVAL; @@ -377,11 +381,11 @@ struct acpi_table_xsdt *mapped_xsdt = NULL; - sdt.pa = ((struct acpi20_table_rsdp*)rsdp)->xsdt_address; + sdt_pa = ((struct acpi20_table_rsdp*)rsdp)->xsdt_address; /* map in just the header */ header = (struct acpi_table_header *) - __acpi_map_table(sdt.pa, sizeof(struct acpi_table_header)); + __acpi_map_table(sdt_pa, sizeof(struct acpi_table_header)); if (!header) { printk(KERN_WARNING PREFIX "Unable to map XSDT header\n"); @@ -390,7 +394,7 @@ /* remap in the entire table before processing */ mapped_xsdt = (struct acpi_table_xsdt *) - __acpi_map_table(sdt.pa, header->length); + __acpi_map_table(sdt_pa, header->length); if (!mapped_xsdt) { printk(KERN_WARNING PREFIX "Unable to map XSDT\n"); return -ENODEV; @@ -407,15 +411,21 @@ return -ENODEV; } - sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3; - if (sdt.count > ACPI_MAX_TABLES) { + sdt_count = (header->length - sizeof(struct acpi_table_header)) >> 3; + if (sdt_count > ACPI_MAX_TABLES) { printk(KERN_WARNING PREFIX "Truncated %lu XSDT entries\n", - (sdt.count - ACPI_MAX_TABLES)); - sdt.count = ACPI_MAX_TABLES; + (sdt_count - ACPI_MAX_TABLES)); + sdt_count = ACPI_MAX_TABLES; } - for (i = 0; i < sdt.count; i++) - sdt.entry[i].pa = (unsigned long) mapped_xsdt->entry[i]; + sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt)); + if (!sdt_entry) { + printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n"); + return -ENOMEM; + } + + for (i = 0; i < sdt_count; i++) + sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i]; } /* Then check RSDT */ @@ -424,11 +434,11 @@ struct acpi_table_rsdt *mapped_rsdt = NULL; - sdt.pa = rsdp->rsdt_address; + sdt_pa = rsdp->rsdt_address; /* map in just the header */ header = (struct acpi_table_header *) - __acpi_map_table(sdt.pa, sizeof(struct acpi_table_header)); + __acpi_map_table(sdt_pa, sizeof(struct acpi_table_header)); if (!header) { printk(KERN_WARNING PREFIX "Unable to map RSDT header\n"); return -ENODEV; @@ -436,7 +446,7 @@ /* remap in the entire table before processing */ mapped_rsdt = (struct acpi_table_rsdt *) - __acpi_map_table(sdt.pa, header->length); + __acpi_map_table(sdt_pa, header->length); if (!mapped_rsdt) { printk(KERN_WARNING PREFIX "Unable to map RSDT\n"); return -ENODEV; @@ -453,15 +463,21 @@ return -ENODEV; } - sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 2; - if (sdt.count > ACPI_MAX_TABLES) { + sdt_count = (header->length - sizeof(struct acpi_table_header)) >> 2; + if (sdt_count > ACPI_MAX_TABLES) { printk(KERN_WARNING PREFIX "Truncated %lu RSDT entries\n", - (sdt.count - ACPI_TABLE_COUNT)); - sdt.count = ACPI_MAX_TABLES; + (sdt_count - ACPI_MAX_TABLES)); + sdt_count = ACPI_MAX_TABLES; } - for (i = 0; i < sdt.count; i++) - sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i]; + sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt)); + if (!sdt_entry) { + printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n"); + return -ENOMEM; + } + + for (i = 0; i < sdt_count; i++) + sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i]; } else { @@ -469,38 +485,38 @@ return -ENODEV; } - acpi_table_print(header, sdt.pa); + acpi_table_print(header, sdt_pa); - for (i = 0; i < sdt.count; i++) { + for (i = 0; i < sdt_count; i++) { /* map in just the header */ header = (struct acpi_table_header *) - __acpi_map_table(sdt.entry[i].pa, + __acpi_map_table(sdt_entry[i].pa, sizeof(struct acpi_table_header)); if (!header) continue; /* remap in the entire table before processing */ header = (struct acpi_table_header *) - __acpi_map_table(sdt.entry[i].pa, + __acpi_map_table(sdt_entry[i].pa, header->length); if (!header) continue; - acpi_table_print(header, sdt.entry[i].pa); + acpi_table_print(header, sdt_entry[i].pa); if (acpi_table_compute_checksum(header, header->length)) { printk(KERN_WARNING " >>> ERROR: Invalid checksum\n"); continue; } - sdt.entry[i].size = header->length; + sdt_entry[i].size = header->length; for (id = 0; id < ACPI_TABLE_COUNT; id++) { if (!strncmp((char *) &header->signature, acpi_table_signatures[id], sizeof(header->signature))) { - sdt.entry[i].id = id; + sdt_entry[i].id = id; } } } @@ -525,8 +541,6 @@ unsigned long rsdp_phys = 0; int result = 0; - memset(&sdt, 0, sizeof(struct acpi_table_sdt)); - /* Locate and map the Root System Description Table (RSDP) */ rsdp_phys = acpi_find_rsdp(); @@ -541,7 +555,7 @@ return -ENODEV; } - printk(KERN_INFO PREFIX "RSDP (v%3.3d %6.6s ) @ 0x%p\n", + printk(KERN_INFO PREFIX "RSDP (v%3.3d %6.6s ) @ 0x%p\n", rsdp->revision, rsdp->oem_id, (void *) rsdp_phys); if (rsdp->revision < 2) diff -Nru a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c --- a/drivers/acpi/toshiba_acpi.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/toshiba_acpi.c Mon Aug 18 14:54:09 2003 @@ -33,7 +33,7 @@ * */ -#define TOSHIBA_ACPI_VERSION "0.15" +#define TOSHIBA_ACPI_VERSION "0.16" #define PROC_INTERFACE_VERSION 1 #include @@ -108,6 +108,7 @@ int result; char* str2 = kmalloc(n + 1, GFP_KERNEL); if (str2 == 0) return 0; + /* NOTE: don't even _think_ about replacing this with strlcpy */ strncpy(str2, str, n); str2[n] = 0; va_start(args, format); diff -Nru a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c --- a/drivers/acpi/utilities/utglobal.c Mon Aug 18 14:54:09 2003 +++ b/drivers/acpi/utilities/utglobal.c Mon Aug 18 14:54:09 2003 @@ -307,9 +307,9 @@ /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, - /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void **) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, - /* FADT 2 */ {FADT_SIG, FADT_SIG, (void **) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE}, - /* FACS 3 */ {FACS_SIG, FACS_SIG, (void **) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE}, + /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void *) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, + /* FADT 2 */ {FADT_SIG, FADT_SIG, (void *) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE}, + /* FACS 3 */ {FACS_SIG, FACS_SIG, (void *) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE}, /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h --- a/include/acpi/acconfig.h Mon Aug 18 14:54:09 2003 +++ b/include/acpi/acconfig.h Mon Aug 18 14:54:09 2003 @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20030619 +#define ACPI_CA_VERSION 0x20030813 /* Maximum objects in the various object caches */ diff -Nru a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h --- a/include/acpi/acpi_drivers.h Mon Aug 18 14:54:09 2003 +++ b/include/acpi/acpi_drivers.h Mon Aug 18 14:54:09 2003 @@ -174,7 +174,7 @@ #define ACPI_PCI_LINK_FILE_STATUS "state" int acpi_pci_link_check (void); -int acpi_pci_link_get_irq (acpi_handle handle, int index); +int acpi_pci_link_get_irq (acpi_handle handle, int index, int* edge_level, int* active_high_low); int acpi_pci_link_init (void); void acpi_pci_link_exit (void); diff -Nru a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h --- a/include/acpi/platform/acenv.h Mon Aug 18 14:54:09 2003 +++ b/include/acpi/platform/acenv.h Mon Aug 18 14:54:09 2003 @@ -134,6 +134,9 @@ #elif defined(__FreeBSD__) #include "acfreebsd.h" +#elif defined(__NetBSD__) +#include "acnetbsd.h" + #elif defined(MODESTO) #include "acmodesto.h" @@ -187,13 +190,14 @@ #define DEBUGGER_SINGLE_THREADED 0 #define DEBUGGER_MULTI_THREADED 1 +#ifndef DEBUGGER_THREADING #ifdef ACPI_APPLICATION #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #else #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED #endif - +#endif /* !DEBUGGER_THREADING */ /****************************************************************************** * diff -Nru a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h --- a/include/asm-i386/acpi.h Mon Aug 18 14:54:09 2003 +++ b/include/asm-i386/acpi.h Mon Aug 18 14:54:09 2003 @@ -106,30 +106,22 @@ :"0"(n_hi), "1"(n_lo)) -#ifdef CONFIG_ACPI_HT_ONLY -extern int acpi_lapic; -#define acpi_ioapic 0 +#if defined(CONFIG_ACPI_BOOT) && defined(CONFIG_X86_LOCAL_APIC) + extern int acpi_lapic; #else -#ifndef CONFIG_ACPI_BOOT -#define acpi_lapic 0 -#define acpi_ioapic 0 -#else -#ifdef CONFIG_X86_LOCAL_APIC -extern int acpi_lapic; -#else -#define acpi_lapic 0 + #define acpi_lapic 0 #endif -#ifdef CONFIG_X86_IO_APIC -extern int acpi_ioapic; + +#if defined(CONFIG_ACPI_BOOT) && defined(CONFIG_X86_IO_APIC) + extern int acpi_ioapic; #else -#define acpi_ioapic 0 -#endif + #define acpi_ioapic 0 #endif +#ifdef CONFIG_ACPI_BOOT /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */ #define FIX_ACPI_PAGES 4 - -#endif /*CONFIG_ACPI_BOOT*/ +#endif #ifdef CONFIG_ACPI_SLEEP diff -Nru a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h --- a/include/asm-i386/io_apic.h Mon Aug 18 14:54:09 2003 +++ b/include/asm-i386/io_apic.h Mon Aug 18 14:54:09 2003 @@ -144,7 +144,7 @@ extern int io_apic_get_unique_id (int ioapic, int apic_id); extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); -extern int io_apic_set_pci_routing (int ioapic, int pin, int irq); +extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); #endif #else /* !CONFIG_X86_IO_APIC */ diff -Nru a/init/do_mounts.c b/init/do_mounts.c --- a/init/do_mounts.c Mon Aug 18 14:54:09 2003 +++ b/init/do_mounts.c Mon Aug 18 14:54:09 2003 @@ -369,6 +369,14 @@ printk ("VFS: Cannot open root device \"%s\" or %s\n", root_device_name, kdevname (ROOT_DEV)); printk ("Please append a correct \"root=\" boot option\n"); + +#ifdef CONFIG_MOUNT_ROOT_FAILED_MSG + { + extern void mount_root_failed_msg(void); + mount_root_failed_msg(); /* architecture dependent */ + } +#endif + panic("VFS: Unable to mount root fs on %s", kdevname(ROOT_DEV)); }