Attach to an I/O mapping
#include <sys/adspace.h> void * io_map (io_handle) io_handle_t io_handle;
The io_map kernel service sets up addressibility to the I/O address space defined by the io_handle_t structure. It returns an effective address representing the start of the mapped region.
This is a replacement call for iomem_att, however, it might replace multiple iomem_att calls depending on the device, the driver, and whether multiple regions were mapped into a single virtual segment. Like iomem_att, this service does not return any kind of failure. If something goes wrong, the system crashes.
There is a major difference between io_map and iomem_att. iomem_att takes an io_map structure containing a bus address and returns a fully qualified effective address with any byte offset from the bus address preserved and computed into the returned effective address. The io_map kernel service always returns a segment-aligned effective address representing the beginning of the I/O segment corresponding to io_handle_t. Manipulation of page and byte offsets within the segment are responsibilities of the device driver.
The io_map kernel service is subject to nesting rules regarding the number of attaches allowed. A total system number of active temporary attaches is 4. However, it is recommended that no more than one active attach be owned by a driver calling the interrupt or DMA kernel services. It is also recommended that no active attaches be owned by a driver when calling other kernel services.
io_handle | Received on a prior successful call to io_map_init. Describes the I/O space to attach to. |
The io_map kernel service can be called from the process or interrupt environment.
The io_map kernel service returns a segment-aligned effective address to access the I/O address spaces.
io_map_init Kernel Service, io_map_clear Kernel Service, and io_unmap Kernel Service.
Programmed I/O (PIO) Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.