Commit 0a029011 authored by Andy Grover's avatar Andy Grover

ACPI:

- Use early table mapping code from acpitable.c (Andi Kleen)
- Make a warning a little more verbose
parent 35e7fac2
...@@ -57,42 +57,40 @@ enum acpi_irq_model_id acpi_irq_model; ...@@ -57,42 +57,40 @@ enum acpi_irq_model_id acpi_irq_model;
#ifdef CONFIG_ACPI_BOOT #ifdef CONFIG_ACPI_BOOT
/* /*
* Use reserved fixmap pages for physical-to-virtual mappings of ACPI tables. * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
* Note that the same range is used for each table, so tables that need to * to map the target physical address. The problem is that set_fixmap()
* persist should be memcpy'd. * 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.
*/ */
char * char *__acpi_map_table(unsigned long phys, unsigned long size)
__acpi_map_table (
unsigned long phys_addr,
unsigned long size)
{ {
unsigned long base = 0; unsigned long base, offset, mapped_size;
unsigned long mapped_phys = phys_addr; int idx;
unsigned long offset = phys_addr & (PAGE_SIZE - 1);
unsigned long mapped_size = PAGE_SIZE - offset;
unsigned long avail_size = mapped_size + (PAGE_SIZE * FIX_ACPI_PAGES);
int idx = FIX_ACPI_BEGIN;
if (!phys_addr || !size)
return NULL;
base = fix_to_virt(FIX_ACPI_BEGIN); if (phys + size < 8*1024*1024)
return __va(phys);
set_fixmap(idx, mapped_phys); 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);
if (size > avail_size) /*
return NULL; * Most cases can be covered by the below.
*/
/* If the table doesn't map completely into the fist page... */ idx = FIX_IO_APIC_BASE_END;
if (size > mapped_size) { while (mapped_size < size) {
do { if (--idx < FIX_IO_APIC_BASE_0)
/* Make sure we don't go past our range */ return 0; /* cannot handle this */
if (idx++ == FIX_ACPI_END) phys += PAGE_SIZE;
return NULL; set_fixmap(idx, phys);
mapped_phys = mapped_phys + PAGE_SIZE; mapped_size += PAGE_SIZE;
set_fixmap(idx, mapped_phys);
mapped_size = mapped_size + PAGE_SIZE;
} while (mapped_size < size);
} }
return ((unsigned char *) base + offset); return ((unsigned char *) base + offset);
......
...@@ -11,7 +11,7 @@ static int __init pci_acpi_init(void) ...@@ -11,7 +11,7 @@ static int __init pci_acpi_init(void)
if (!(pci_probe & PCI_NO_ACPI_ROUTING)) { if (!(pci_probe & PCI_NO_ACPI_ROUTING)) {
if (!acpi_pci_irq_init()) { if (!acpi_pci_irq_init()) {
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi'\n"); printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'\n");
pcibios_scanned++; pcibios_scanned++;
pcibios_enable_irq = acpi_pci_irq_enable; pcibios_enable_irq = acpi_pci_irq_enable;
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment