Defines an Effective Address [EA] to Real Address [RA] translation region.
#include <sys/ioacc.h> #include <sys/adspace.h>
int rmmap_create (eaddrp, iomp, flags) void **eaddrp; struct io_map *iomp; int flags;
The translation regions created with rmmap_create kernel service are maintained in I/O mapping segments. Any single such segment may translate up to 256 Megabytes of real memory or memory mapped I/O in a single region. The only granularity for which the rmmap_remove service may be invoked is a single mapping created by a single call to the rmmap_create.
There are constraints on the size of the mapping and the flags parameter, described later, which will cause the call to fail regardless of whether adequate effective address space exists.
If rmmap_create kernel service is called with the effective address of zero (0), the function attempts to find free space in the process address space. If successful, an I/O mapping segment is created and the effective address (which is passed by reference) is changed to the effective address which is mapped to the first page of the iomp memory.
If rmmap_create kernel service is called with a non-zero effective address, it is taken as the desired effective address which should translate to the passed iomp memory. This function verifies that the requested range is free. If not, it fails and returns EINVAL. If the mapping at the effective address is not contained in a single segment, the function fails and returns ENOSPC. Otherwise, the region is allocated and the effective address is not modified. The effective address is mapped to the first page of the iomp memory. References outside of the mapped regions but within the same segment are invalid.
The effective address (if provided) and the bus address must be a multiple of PAGESIZE or EINVAL is returned.
If rmmap_create kernel service is called with a length which is either not a multiple of PAGESIZE, is less than PAGESIZE, or is greater than SEGSIZE, EINVAL is returned. This return code takes precedence in cases where otherwise the segment would overflow and ENOSPC is returned.
I/O mapping segments are not inherited by child processes after a fork subroutine, except when RMMAP_INHERIT is specified. These segments are deleted by exec, exit, or rmmap_remove of the last range in a segment.
Only certain combinations of flags are permitted, depending on the type of memory being mapped. For real memory mappings, RMMAP_PAGE_M is required while RMMAP_PAGE_W, RMMAP_PAGE_I, and RMMAP_PAGE_G are not allowed. For I/O mappings, it is valid to specify only RMMAP_PAGE_M, with no other page attribute flags. It is also valid to specify RMMAP_PAGE_I and optionally, either or both of RMMAP_PAGE_M, and RMMAP_PAGE_G. RMMAP_PAGE_W is never allowed.On successful completion, rmmap_create kernel service returns zero and modifies the effective address to the value at which the newly created mapping region was attached to the process address space. Otherwise, it returns one of:
EINVAL | Some type of parameter error occurred. These include, but are not limited to, size errors and mutually exclusive flag selections. |
ENOMEM | The operating system could not allocate the necessary data structures to represent the mapping. |
ENOSPC | Effective address space exhausted in the region indicated by eaddr. |
EPERM | This hardware platform does not implement this service. |
The rmmap.create kernel service is part of the Base Operating System (BOS) Runtime.
This service only functions on PowerPC microprocessors.
The real address range described by the iomp parameter must be unique within this I/O mapping segment.
The rmmap_remove kernel service.
Memory Kernel Services and Understanding Virtual Memory Manager Interfaces in AIX Version 4 Kernel Extensions and Device Support Programming Concepts.