aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/osl.c16
-rw-r--r--include/linux/acpi_io.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 5389f9f2e2ff..52ca8721bc9c 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -285,6 +285,22 @@ acpi_map_vaddr_lookup(acpi_physical_address phys, unsigned int size)
285 return NULL; 285 return NULL;
286} 286}
287 287
288void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size)
289{
290 struct acpi_ioremap *map;
291 void __iomem *virt = NULL;
292
293 mutex_lock(&acpi_ioremap_lock);
294 map = acpi_map_lookup(phys, size);
295 if (map) {
296 virt = map->virt + (phys - map->phys);
297 map->refcount++;
298 }
299 mutex_unlock(&acpi_ioremap_lock);
300 return virt;
301}
302EXPORT_SYMBOL_GPL(acpi_os_get_iomem);
303
288/* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */ 304/* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */
289static struct acpi_ioremap * 305static struct acpi_ioremap *
290acpi_map_lookup_virt(void __iomem *virt, acpi_size size) 306acpi_map_lookup_virt(void __iomem *virt, acpi_size size)
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h
index 28a3ae279d7a..4afd7102459d 100644
--- a/include/linux/acpi_io.h
+++ b/include/linux/acpi_io.h
@@ -10,4 +10,6 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
10 return ioremap_cache(phys, size); 10 return ioremap_cache(phys, size);
11} 11}
12 12
13void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
14
13#endif 15#endif