From b9ba7aeb165cffecdffb60aec8c3fa8d590d9ca9 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 28 Apr 2000 01:09:25 +0000 Subject: Merge with 2.3.99-pre6. --- arch/ia64/kernel/acpi.c | 55 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'arch/ia64/kernel/acpi.c') diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 078d908c8..72e10a683 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -11,12 +11,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include @@ -27,13 +27,12 @@ #undef ACPI_DEBUG /* Guess what this does? */ #ifdef CONFIG_SMP -extern unsigned long ipi_base_addr; +extern struct smp_boot_data smp; #endif /* These are ugly but will be reclaimed by the kernel */ -int __initdata acpi_cpus = 0; -int __initdata acpi_apic_map[32]; -int __initdata cpu_cnt = 0; +int __initdata available_cpus = 0; +int __initdata total_cpus = 0; void (*pm_idle) (void); @@ -50,7 +49,7 @@ acpi_lsapic(char *p) if ((lsapic->flags & LSAPIC_PRESENT) == 0) return; - printk(" CPU %d (%.04x:%.04x): ", cpu_cnt, lsapic->eid, lsapic->id); + printk(" CPU %d (%.04x:%.04x): ", total_cpus, lsapic->eid, lsapic->id); if ((lsapic->flags & LSAPIC_ENABLED) == 0) { printk("Disabled.\n"); @@ -62,11 +61,17 @@ acpi_lsapic(char *p) if (add) { printk("Available.\n"); - acpi_cpus++; - acpi_apic_map[cpu_cnt] = (lsapic->id << 8) | lsapic->eid; + available_cpus++; +#ifdef CONFIG_SMP +# if LARGE_CPU_ID_OK + smp.cpu_map[total_cpus] = (lsapic->id << 8) | lsapic->eid; +# else + smp.cpu_map[total_cpus] = lsapic->id; +# endif +#endif } - cpu_cnt++; + total_cpus++; } /* @@ -174,7 +179,7 @@ acpi_legacy_irq(char *p) break; } -#ifdef ACPI_DEBUG +#if 1/*def ACPI_DEBUG*/ printk("Legacy ISA IRQ %x -> IA64 Vector %x IOSAPIC Pin %x Active %s %s Trigger\n", legacy->isa_irq, vector, iosapic_pin(vector), ((iosapic_polarity(vector) == IO_SAPIC_POL_LOW) ? "Low" : "High"), @@ -204,11 +209,11 @@ acpi_parse_msapic(acpi_sapic_t *msapic) { char *p, *end; - memset(&acpi_apic_map, -1, sizeof(acpi_apic_map)); + /* Base address of IPI Message Block */ + ipi_base_addr = (unsigned long) ioremap(msapic->interrupt_block, 0); #ifdef CONFIG_SMP - /* Base address of IPI Message Block */ - ipi_base_addr = ioremap(msapic->interrupt_block, 0); + memset(&smp, -1, sizeof(smp)); #endif p = (char *) (msapic + 1); @@ -238,11 +243,22 @@ acpi_parse_msapic(acpi_sapic_t *msapic) } /* Move to next table entry. */ - p += *(p + 1); +#define BAD_ACPI_TABLE +#ifdef BAD_ACPI_TABLE + /* + * Some prototype Lion's have a bad ACPI table + * requiring this fix. Without this fix, those + * machines crash during bootup. + */ + if (p[1] == 0) + p = end; + else +#endif + p += p[1]; } /* Make bootup pretty */ - printk(" %d CPUs available, %d CPUs total\n", acpi_cpus, cpu_cnt); + printk(" %d CPUs available, %d CPUs total\n", available_cpus, total_cpus); } int __init @@ -281,12 +297,15 @@ acpi_parse(acpi_rsdp_t *rsdp) continue; acpi_parse_msapic((acpi_sapic_t *) hdrp); - } /* while() */ + } - if (acpi_cpus == 0) { +#ifdef CONFIG_SMP + if (available_cpus == 0) { printk("ACPI: Found 0 CPUS; assuming 1\n"); - acpi_cpus = 1; /* We've got at least one of these, no? */ + available_cpus = 1; /* We've got at least one of these, no? */ } + smp.cpu_count = available_cpus; +#endif return 1; } -- cgit v1.2.3