Call __remap_identity to remap 64-bit addresses into 32-bit addresses. Any of the 64-bit addresses with the most-significant 32 bits all zeroes will be remapped to the identical 32-bit addresses.
#include <sys/types.h> #include <sys/errno.h> #include <sys/remap.h>
REMAP_IDENTITY(nparms) int nparms;
REMAP_IDENTITY_VOID(nparms) int nparms;
The REMAP_IDENTITY macro calls the __remap_identity subroutine to remap 64-bit addresses into 32-bit addresses suitable for passing to the kernel. Any of the 64-bit addresses with the most-significant 32 bits all zeroes will be remapped to the identical 32-bit addresses. This is useful in a situation such as the ioctl arg parameter. If the most-significant 32-bits are all zeroes, it can not be known by the remapping wrapper subroutine whether this parameter is a pointer or an integer because it is device-specific. REMAP_IDENTITY can be used in this case to remap the arg parameter in case it is a pointer, and remap it to the identical 32-bit value in case it is an integer.
This macro should be used in conjunction with the REMAP_DCL(), REMAP_SETUP(), REMAPPED(), and REMAP_HANDLEx macros. The macro is dependent on structures declared by REMAP_DCL and initialized by REMAP_SETUP.
The REMAP_IDENTITY macro is used exactly the same as the REMAP macro. Please see the description of the REMAP macro for example usage.
This service may only be called from a 64-bit user process.
nparms | the number of (32-bit) parameters to be passed on this system call. |
On error, the errno value has been set by __remap_identity and the REMAP_IDENTITY macro calls return to return -1 to the caller of the system call. If the system call is a void, the REMAP_IDENTITY_VOID macro should be used (same syntax). In this case, if there is an error the REMAP_IDENTITY_VOID macro simply calls return with no value.
0 | Successful completion. |
-1 | Unable to complete the remapping due to insufficient resources. In this case ERRNO is set to EINVAL. |
The __remap_identity subroutine is part of Base Operating System (BOS) Runtime. The REMAP_IDENTITY macro is defined in sys/remap.h.
The REMAP macro, REMAP_DCL macro, REMAP_SETUP macro, __remap_identity subroutine, remap_64 kernel service, the as_remap64 kernel service, the as_unremap64 kernel service.
Memory Kernel Services and Understanding Virtual Memory Manager Interfaces in AIX Version 4 Kernel Extensions and Device Support Programming Concepts.