aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/osl.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>2007-02-02 11:48:19 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:22 -0500
commitad71860a17ba33eb0e673e9e2cf5ba0d8e3e3fdd (patch)
tree9f60547a2e8782c04d7cd1c41bc874047008458c /drivers/acpi/osl.c
parenta4bbb810dedaecf74d54b16b6dd3c33e95e1024c (diff)
ACPICA: minimal patch to integrate new tables into Linux
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r--drivers/acpi/osl.c47
1 files changed, 19 insertions, 28 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 57ae1e5cde0a..c1c2100fe133 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -36,6 +36,7 @@
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38#include <linux/nmi.h> 38#include <linux/nmi.h>
39#include <linux/acpi.h>
39#include <acpi/acpi.h> 40#include <acpi/acpi.h>
40#include <asm/io.h> 41#include <asm/io.h>
41#include <acpi/acpi_bus.h> 42#include <acpi/acpi_bus.h>
@@ -136,53 +137,43 @@ void acpi_os_vprintf(const char *fmt, va_list args)
136#endif 137#endif
137} 138}
138 139
139acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr) 140acpi_physical_address __init acpi_os_get_root_pointer(void)
140{ 141{
141 if (efi_enabled) { 142 if (efi_enabled) {
142 addr->pointer_type = ACPI_PHYSICAL_POINTER;
143 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) 143 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
144 addr->pointer.physical = efi.acpi20; 144 return efi.acpi20;
145 else if (efi.acpi != EFI_INVALID_TABLE_ADDR) 145 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
146 addr->pointer.physical = efi.acpi; 146 return efi.acpi;
147 else { 147 else {
148 printk(KERN_ERR PREFIX 148 printk(KERN_ERR PREFIX
149 "System description tables not found\n"); 149 "System description tables not found\n");
150 return AE_NOT_FOUND; 150 return 0;
151 } 151 }
152 } else { 152 } else
153 if (ACPI_FAILURE(acpi_find_root_pointer(flags, addr))) { 153 return acpi_find_rsdp();
154 printk(KERN_ERR PREFIX
155 "System description tables not found\n");
156 return AE_NOT_FOUND;
157 }
158 }
159
160 return AE_OK;
161} 154}
162 155
163acpi_status 156void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
164acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
165 void __iomem ** virt)
166{ 157{
167 if (phys > ULONG_MAX) { 158 if (phys > ULONG_MAX) {
168 printk(KERN_ERR PREFIX "Cannot map memory that high\n"); 159 printk(KERN_ERR PREFIX "Cannot map memory that high\n");
169 return AE_BAD_PARAMETER; 160 return 0;
170 } 161 }
171 /* 162 if (acpi_gbl_permanent_mmap)
172 * ioremap checks to ensure this is in reserved space 163 /*
173 */ 164 * ioremap checks to ensure this is in reserved space
174 *virt = ioremap((unsigned long)phys, size); 165 */
175 166 return ioremap((unsigned long)phys, size);
176 if (!*virt) 167 else
177 return AE_NO_MEMORY; 168 return __acpi_map_table((unsigned long)phys, size);
178
179 return AE_OK;
180} 169}
181EXPORT_SYMBOL_GPL(acpi_os_map_memory); 170EXPORT_SYMBOL_GPL(acpi_os_map_memory);
182 171
183void acpi_os_unmap_memory(void __iomem * virt, acpi_size size) 172void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
184{ 173{
185 iounmap(virt); 174 if (acpi_gbl_permanent_mmap) {
175 iounmap(virt);
176 }
186} 177}
187EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); 178EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
188 179