Commit f34fa82b authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

x86, acpi: merge __acpi_map_table

and let 64-bit to fall back to use fixmap too.
Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 7b16eb89
...@@ -109,21 +109,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; ...@@ -109,21 +109,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
*/ */
enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
#ifdef CONFIG_X86_64
/* rely on all ACPI tables being in the direct mapping */
char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size)
{
if (!phys_addr || !size)
return NULL;
if (phys_addr+size <= (max_pfn_mapped << PAGE_SHIFT) + PAGE_SIZE)
return __va(phys_addr);
return NULL;
}
#else
/* /*
* Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
...@@ -142,11 +127,15 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) ...@@ -142,11 +127,15 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
unsigned long base, offset, mapped_size; unsigned long base, offset, mapped_size;
int idx; int idx;
if (phys + size < 8 * 1024 * 1024) if (!phys || !size)
return NULL;
if (phys+size <= (max_pfn_mapped << PAGE_SHIFT))
return __va(phys); return __va(phys);
offset = phys & (PAGE_SIZE - 1); offset = phys & (PAGE_SIZE - 1);
mapped_size = PAGE_SIZE - offset; mapped_size = PAGE_SIZE - offset;
clear_fixmap(FIX_ACPI_END);
set_fixmap(FIX_ACPI_END, phys); set_fixmap(FIX_ACPI_END, phys);
base = fix_to_virt(FIX_ACPI_END); base = fix_to_virt(FIX_ACPI_END);
...@@ -158,13 +147,13 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) ...@@ -158,13 +147,13 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
if (--idx < FIX_ACPI_BEGIN) if (--idx < FIX_ACPI_BEGIN)
return NULL; /* cannot handle this */ return NULL; /* cannot handle this */
phys += PAGE_SIZE; phys += PAGE_SIZE;
clear_fixmap(idx);
set_fixmap(idx, phys); set_fixmap(idx, phys);
mapped_size += PAGE_SIZE; mapped_size += PAGE_SIZE;
} }
return ((unsigned char *)base + offset); return ((unsigned char *)base + offset);
} }
#endif
#ifdef CONFIG_PCI_MMCONFIG #ifdef CONFIG_PCI_MMCONFIG
/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define _ASM_FIXMAP_64_H #define _ASM_FIXMAP_64_H
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/acpi.h>
#include <asm/apicdef.h> #include <asm/apicdef.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/vsyscall.h> #include <asm/vsyscall.h>
...@@ -49,6 +50,10 @@ enum fixed_addresses { ...@@ -49,6 +50,10 @@ enum fixed_addresses {
#ifdef CONFIG_PARAVIRT #ifdef CONFIG_PARAVIRT
FIX_PARAVIRT_BOOTMAP, FIX_PARAVIRT_BOOTMAP,
#endif #endif
#ifdef CONFIG_ACPI
FIX_ACPI_BEGIN,
FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
#endif
#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
FIX_OHCI1394_BASE, FIX_OHCI1394_BASE,
#endif #endif
......
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