as_remap64 Kernel Service

Purpose

Remaps an additional 64-bit address to a 32-bit address that can be used by the kernel.

Syntax

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

int as_remap64 (addr64, len, addr32 )
unsigned long long addr64;
unsigned int len;
unsigned int*addr32;

Parameters

addr64 Specifies the 64-bit effective address of start of range to be remapped.
len Specifies the number of bytes in the range to be remapped.
addr32 Specifies the new 32-bit remapped address (filled in by as_remap64).

Description

The as_remap64 service will create a 32-bit remapped address from the 64-bit address and return that to the caller. This service may be called when another address needs to be remapped after the remap_64 service has already been called in the context of the same system call.

A common example when this may be needed is in a device driver ioctl entry point. If the arg parameter is a 64-bit pointer to a structure, it is remapped by the __remap library routine and remap_64 kernel service before the device driver ioctl entry point is called. If the structure itself contains 64-bit pointers, however, the as_remap64 routine may be used by the device driver to remap these additional pointers.

The as_remap64 kernel service may be called for either a 32-bit or 64-bit process. If called for a 32-bit process and addr64 is a valid 32-bit address, then this address is simply returned in the addr32 parameter.

Execution Environment

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

Return Values

0 Successful completion.
EINVAL The process is 32-bit, and addr64 is not a valid 32-bit address (or)
Unable to remap the address range due to insufficient resources.

Implementation Specifics

The as_remap64 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.