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.
The io_map kernel service is a replacement call for the iomem_att kernel service, which is deprecated on AIX® 6.1. However, the io_map kernel service might replace multiple iomem_att calls depending on the device, the driver, and whether multiple regions were mapped into a single virtual segment. Like the iomem_att kernel service, 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 took an io_map structure containing a bus address and returned 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.
Item | Description |
---|---|
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.