Establishes access to memory-mapped I/O.
#include <sys/types.h>
#include <sys/adspace.h>
void *iomem_att (io_map_ptr)
struct io_map *io_map_ptr;
struct io_map {
int key;
int flags;
int size;
int BID;
long long busaddress;
}
The address of the io_map structure passes the following parameters to the iomem_att kernel service:
key | Set to IO_MEM_MAP. |
flags | Describes the mapping. |
size | Specifies the number of bytes to map. |
bid | Specifies the bus identifier. |
busaddress | Specifies the address of the bus. |
Calling this function on a POWER-based machine causes the system to crash.
The iomem_att kernel service provides temporary addressability to memory-mapped I/O. The iomem_att kernel service does the following:
The addressability is valid only for the context that called iomem_att. The memory is addressable until iomem_det is called. I/O memory must be mapped each time a context is entered and freed before returning.
The size parameter supports from 4096 bytes to 256 MB. The caller can specify a minimum of size bytes, but may choose to map up to 256 MB. The caller must not reference memory beyond size bytes. The size parameter should be set to the minimum value required to address the target device.
Specifying IOM_RDONLY in the flags parameter results in a read-only mapping. A store to memory, mapped in this mode, results in a data storage interrupt. If the flag parameter is 0 (zero) the memory is mapped read-write. All mappings are read-write on 601-based machines.
The iomem_att kernel service can be called from either the process or interrupt environment.
The iomem_att kernel service returns the effective address that can be used to address the I/O memory.
The iomem_det Kernel Service.
Kernel Extension and Device Driver Management Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.