diff options
Diffstat (limited to 'arch/x86/kernel/acpi')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index bba162c81d5b..956c1dee6fbe 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -108,35 +108,18 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; | |||
108 | */ | 108 | */ |
109 | char *__init __acpi_map_table(unsigned long phys, unsigned long size) | 109 | char *__init __acpi_map_table(unsigned long phys, unsigned long size) |
110 | { | 110 | { |
111 | unsigned long base, offset, mapped_size; | ||
112 | int idx; | ||
113 | 111 | ||
114 | if (!phys || !size) | 112 | if (!phys || !size) |
115 | return NULL; | 113 | return NULL; |
116 | 114 | ||
117 | if (phys+size <= (max_low_pfn_mapped << PAGE_SHIFT)) | 115 | return early_ioremap(phys, size); |
118 | return __va(phys); | 116 | } |
119 | 117 | void __init __acpi_unmap_table(char *map, unsigned long size) | |
120 | offset = phys & (PAGE_SIZE - 1); | 118 | { |
121 | mapped_size = PAGE_SIZE - offset; | 119 | if (!map || !size) |
122 | clear_fixmap(FIX_ACPI_END); | 120 | return; |
123 | set_fixmap(FIX_ACPI_END, phys); | ||
124 | base = fix_to_virt(FIX_ACPI_END); | ||
125 | |||
126 | /* | ||
127 | * Most cases can be covered by the below. | ||
128 | */ | ||
129 | idx = FIX_ACPI_END; | ||
130 | while (mapped_size < size) { | ||
131 | if (--idx < FIX_ACPI_BEGIN) | ||
132 | return NULL; /* cannot handle this */ | ||
133 | phys += PAGE_SIZE; | ||
134 | clear_fixmap(idx); | ||
135 | set_fixmap(idx, phys); | ||
136 | mapped_size += PAGE_SIZE; | ||
137 | } | ||
138 | 121 | ||
139 | return ((unsigned char *)base + offset); | 122 | early_iounmap(map, size); |
140 | } | 123 | } |
141 | 124 | ||
142 | #ifdef CONFIG_PCI_MMCONFIG | 125 | #ifdef CONFIG_PCI_MMCONFIG |