xref: /illumos-gate/usr/src/man/man3rsm/rsm_memseg_import_put.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_MEMSEG_IMPORT_PUT 3RSM "Jun 8, 2001"
NAME
rsm_memseg_import_put, rsm_memseg_import_put8, rsm_memseg_import_put16, rsm_memseg_import_put32, rsm_memseg_import_put64 - write to a segment
SYNOPSIS

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

int rsm_memseg_import_put(rsm_memseg_import_handle_t im_memseg,
 off_t offset, void *src_addr, size_t length);

int rsm_memseg_import_put8(rsm_memseg_import_handle_t im_memseg,
 off_t offset, uint8_t datap, ulong_t rep_cnt);

int rsm_memseg_import_put16(rsm_memseg_import_handle_t im_memseg,
 off_t offset, uint16_t datap, ulong_t rep_cnt);

int rsm_memseg_import_put32(rsm_memseg_import_handle_t im_memseg,
 off_t offset, uint32_t datap, ulong_t rep_cnt);

int rsm_memseg_import_put64(rsm_memseg_import_handle_t im_memseg,
 off_t offset, uint64_t datap, ulong_t rep_cnt);
DESCRIPTION

When using interconnects that allow memory mapping (see rsm_memseg_import_map(3RSM)), standard CPU memory operations may be used for accessing memory of a segment. If, however, a mapping is not provided, then explicitly calling these functions facilitates writing to a segment. Depending on the attributes of the extension library for the interconnect, these functions may involve doing an implicit mapping before performing the data transfer. Applications can be made interconnect-independent with respect to segment writes by using these functions. The data access error detection is performed through the use of barriers (see rsm_memseg_import_open_barrier(3RSM)). The default barrier operation mode is RSM_BARRIER_MODE_IMPLICIT, which means that around every put operation open and close barrier operations are performed automatically. Explicit error handling may also be set up for these functions (see rsm_memseg_import_set_mode(3RSM)).

The rsm_memseg_import_put() function copies length bytes from local memory with start address src_addr to the imported segment im_memseg beginning at location offset from the start of the segment.

The rsm_memseg_import_put8() function copies rep_cnt number of 8-bit quantities from successive local memory locations pointed to by datap to successive locations starting from offset in the imported segment.

The rsm_memseg_import_put16() function copies rep_cnt number of 16-bit quantities from successive local memory locations pointed to by datap to successive locations starting from offset in the imported segment. The offset must be aligned at half-word address boundary.

The rsm_memseg_import_put32() function copies rep_cnt number of 32-bit quantities from successive local memory locations pointed to by datap to successive locations starting from offset in the imported segment. The offset must be aligned at word address boundary.

The rsm_memseg_import_put64() function copies rep_cnt number of 64-bit quantities from successive local memory locations pointed to by datap to successive locations starting from offset in the imported segment. The offset must be aligned at double-word address boundary.

The data transfer functions that transfer small quantities of data (that is, 8-, 16-, 32-, and 64-bit quantities) perform byte swapping prior to the data transfer, in the event that the source and destination have incompatible endian characteristics.

RETURN VALUES

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

ERRORS

These functions can return the following errors: RSMERR_BAD_SEG_HNDL

Invalid segment handle.

RSMERR_BAD_ADDR

Bad address.

RSMERR_BAD_MEM_ALIGNMENT

Invalid memory alignment for pointer.

RSMERR_BAD_OFFSET

Invalid offset.

RSMERR_BAD_LENGTH

Invalid length.

RSMERR_PERM_DENIED

Permission denied.

RSMERR_INSUFFICIENT_RESOURCES

Insufficient resources.

RSMERR_BARRIER_UNINITIALIZED

Barrier not initialized.

RSMERR_BARRIER_FAILURE

I/O completion error.

RSMERR_CONN_ABORTED

Connection aborted.

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_get (3RSM), rsm_memseg_import_init_barrier (3RSM), rsm_memseg_import_open_barrier (3RSM), rsm_memseg_import_set_mode (3RSM), attributes (7)