xref: /illumos-gate/usr/src/man/man3rsm/rsm_create_localmemory_handle.3rsm (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
te
Copyright (c) 2001 by Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
RSM_CREATE_LOCALMEMORY_HANDLE 3RSM "Jun 8, 2001"
NAME
rsm_create_localmemory_handle, rsm_free_localmemory_handle - create or free local memory handle
SYNOPSIS

cc [ flag... ] file... -lrsm [ library... ]
#include <rsmapi.h>

int rsm_create_localmemory_handle(
 rsmapi_controller_handle_t handle,
 rsm_localmemory_handle_t *l_handle,
 caddr_t local_vaddr, size_t length);

int rsm_free_localmemory_handle(
 rsmapi_controller_handle_t handle,
 rsm_localmemory_handle_t l_handle);
DESCRIPTION

The rsm_create_localmemory_handle() and rsm_free_localmemory_handle() functions are supporting functions for rsm_memseg_import_putv(3RSM) and rsm_memseg_import_getv(3RSM).

The rsm_create_localmemory_handle() function creates a local memory handle to be used in the I/O vector component of a scatter-gather list of subsequent rsm_memseg_import_putv() and rsm_memseg_import_getv() calls. The handle argument specifies the controller handle obtained from rsm_get_controller(3RSM). The l_handle argument is a pointer to the location for the function to return the local memory handle. The local_vaddr argument specifies the local virtual address; it should be aligned at a page boundary. The length argument specifies the length of memory spanned by the handle.

The rsm_free_localmemory_handle() function unlocks the memory range for the local handle specified by l_handle and releases the associated system resources. The handle argument specifies the controller handle. All handles created by a process are freed when the process exits, but the process should call rsm_free_localmemory_handle() as soon as possible to free the system resources.

RETURN VALUES

Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error.

ERRORS

The rsm_create_localmemory_handle() and rsm_free_localmemory_handle() functions can return the following errors: RSMERR_BAD_CTLR_HNDL

Invalid controller handle.

RSMERR_BAD_LOCALMEM_HNDL

Invalid local memory handle.

The rsm_create_localmemory_handle() function can return the following errors: RSMERR_BAD_LENGTH

Invalid length.

RSMERR_BAD_ADDRESS

Invalid address.

RSMERR_INSUFFICIENT_MEM

Insufficient memory.

ATTRIBUTES

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Evolving
MT-Level MT-Safe
SEE ALSO

rsm_memseg_import_putv (3RSM), attributes (7)