[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

remap_64 Kernel Service

Purpose

Registers the input remapping of one or more addresses for the duration of a system call for a 64-bit process.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/adspace.h>
#include <sys/remap.h>

int remap_64 (rh)
remap_handle rh;

Parameter

rh Specifies the remap_handle structure containing a single 64-bit remapping, two 64-bit remappings, or a pointer to an array of remap structures (kremap structure).

Description

The remap_64 service will register an input remapping of one or more 64-bit user addresses as specified by the input remap structure.

The remapping process involves creating a 32-bit name, or alias for each corresponding 64-bit address so that the kernel code, which is 32-bit, can reference user-mode data for 64-bit applications. The __remap subroutine creates the remappings. The remap_64 subroutine registers them with the kernel, so they will be honored when used.

The return value from the subroutine __remap is what gets passed down as input to this routine. The size of this structure depends on the number of parameters passed on the system call. The REMAP_HANDLEx macro is used on the library side to call the kernel extension with x parameters following the remap_handle. This macro ensures that the structure is the correct size and is correctly split into 32 bit registers for the kernel. The R_HANDLEx macro is used on the kernel extension side to declare the correct size remap_handle structure. This structure is passed on to remap_64. Therefore, the last half of the remap_handle structure passed to remap_64 may be invalid. The handle_type field in the first half of the structure (filled in by __remap) indicates how much of the structure is valid.

If the handle_type field indicates R_ONE_REMAP, R_TWO_REMAP, or R_NO_REMAP, the remapping(s) is/are passed in-line in the remap_handle and there is no copyin64 of a kremap structure required. If the handle_type field indicates R_N_REMAP, the remappings could not be passed in-line, and a copyin64 of the kremap structure is required.

This kernel service must be called, in kernel mode, only when the current user process is 64-bits. It does not work for 32-bit user processes.

Execution Environment

The remap_64 kernel service can be called from the process environment only.

Return Values

0 Successful completion.
-1 Indicates an error occurred while accessing the kremap struct. For example, the user has insufficient authority to access the data (or) remap_64 has already been called on this system call. errno is set to EFAULT.
-1 Indicates that the remap struct was invalid (or) current user process not 64-bits. errno is set to EINVAL.

Implementation Specifics

The remap_64 kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The as_remap64 kernel service, as_unremap64 kernel service.

Memory Kernel Services and Understanding Virtual Memory Manager Interfaces in AIX Version 4 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]