Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: Export interfaces for ioremapping/iounmapping ACPI registers

Export remapping and unmapping interfaces - acpi_os_map_generic_address()
and acpi_os_unmap_generic_address() - for ACPI generic registers that are
backed by memory mapped I/O (MMIO).

The acpi_os_map_generic_address() and acpi_os_unmap_generic_address()
declarations may more properly belong in include/acpi/acpiosxf.h next to
acpi_os_read_memory() but I believe that would require the ACPI CA making
them an official part of the ACPI CA - OS interface.

ACPI Generic Address Structure (GAS) reference (ACPI's fixed/generic
hardware registers use the GAS format):
ACPI Specification, Revision 4.0, Section 5.2.3.1, "Generic Address
Structure"

Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Myron Stowe and committed by
Len Brown
6f68c91c bc9ffce2

+7 -2
+4 -2
drivers/acpi/osl.c
··· 431 431 __acpi_unmap_table(virt, size); 432 432 } 433 433 434 - static int acpi_os_map_generic_address(struct acpi_generic_address *gas) 434 + int acpi_os_map_generic_address(struct acpi_generic_address *gas) 435 435 { 436 436 u64 addr; 437 437 void __iomem *virt; ··· 450 450 451 451 return 0; 452 452 } 453 + EXPORT_SYMBOL(acpi_os_map_generic_address); 453 454 454 - static void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) 455 + void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) 455 456 { 456 457 u64 addr; 457 458 struct acpi_ioremap *map; ··· 476 475 477 476 acpi_os_map_cleanup(map); 478 477 } 478 + EXPORT_SYMBOL(acpi_os_unmap_generic_address); 479 479 480 480 #ifdef ACPI_FUTURE_USAGE 481 481 acpi_status
+3
include/linux/acpi_io.h
··· 12 12 13 13 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); 14 14 15 + int acpi_os_map_generic_address(struct acpi_generic_address *addr); 16 + void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); 17 + 15 18 #endif