xref: /illumos-gate/usr/src/man/man3rsm/rsm_memseg_import_map.3rsm (revision 8a2b682e57a046b828f37bcde1776f131ef4629f)
te
Copyright (c) 2002 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_MEMSEG_IMPORT_MAP 3RSM "Nov 26, 2017"
NAME
rsm_memseg_import_map, rsm_memseg_import_unmap - map or unmap imported segment
SYNOPSIS

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

int rsm_memseg_import_map(rsm_memseg_import_handle_t im_memseg,
 void **address, rsm_attribute_t attr,
 rsm_permission_t perm, off_t offset, size_t length);

int rsm_memseg_import_unmap(rsm_memseg_import_handle_t im_memseg);
DESCRIPTION

The rsm_memseg_import_map() and rsm_memseg_import_unmap() functions provide for mapping and unmapping operations on imported segments. The mapping operations are only available for native architecture interconnects such as Dolphin-SCI or Sun Fire Link. Mapping a segment allows that segment to be accessed by CPU memory operations, saving the overhead of calling the memory access primitives described on the rsm_memseg_import_get(3RSM) and rsm_memseg_import_put(3RSM) manual pages.

The rsm_memseg_import_map() function maps an import segment into caller's address space for the segment to be accessed by CPU memory operations. The im_memseg argument represents the import segment that is being mapped. The location where the process's address space is mapped to the segment is pointed to by the address argument. The attr argument can be one of the following: RSM_MAP_NONE

The system will choose available virtual address to map and return its value in the address argument.

RSM_MAP_FIXED

The import segment should be mapped at the requested virtual address specified in the address argument.

The perm argument determines whether read, write or a combination of accesses are permitted to the data being mapped. It can be either RSM_PERM_READ, RSM_PERM_WRITE, or RSM_PERM_RDWR.

The offset argument is the byte offset location from the base of the segment being mapped to address. The length argument indicates the number of bytes from offset to be mapped.

The rsm_memseg_import_unmap() function unmaps a previously mapped import segment.

RETURN VALUES

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

ERRORS

The rsm_memseg_import_map() and rsm_memseg_import_unmap() functions can return the following errors: RSMERR_BAD_SEG_HNDL

Invalid segment handle.

The rsm_memseg_import_map() function can return the following errors: RSMERR_BAD_ADDR

Invalid address.

RSMERR_BAD_LENGTH

Invalid length.

RSMERR_BAD_MEM_ALIGNMENT

The address is not aligned on a page boundary.

RSMERR_BAD_OFFSET

Invalid offset.

RSMERR_BAD_PERMS

Invalid permissions.

RSMERR_CONN_ABORTED

Connection aborted.

RSMERR_MAP_FAILED

Map failure.

RSMERR_SEG_ALREADY_MAPPED

Segment already mapped.

RSMERR_SEG_NOT_CONNECTED

Segment not connected.

ATTRIBUTES

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

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

rsm_memseg_import_connect(3RSM), rsm_memseg_import_get(3RSM), rsm_memseg_import_put(3RSM), rsm_memseg_get_pollfd(3RSM), attributes(5)