RSMERR_BAD_SGIO | Invalid scatter-gather structure pointer |
RSMERR_BAD_SEG_HNDL | Invalid segment handle |
RSMERR_BAD_CTLR_HNDL | Invalid controller handle |
RSMERR_BAD_ADDR | Bad address |
RSMERR_BAD_OFFSET | Invalid offset |
RSMERR_BAD_LENGTH | Invalid length |
RSMERR_PERM_DENIED | Permission denied |
RSMERR_BARRIER_FAILURE | I/O completion error |
RSMERR_CONN_ABORTED | Connection aborted |
RSMERR_INSUFFICIENT_RESOURCES | Insufficient resources |
RSMERR_INTERRUPTED | Operation interrupted by signal |
int rsm_create_localmemory_handle(rsmapi_controller_handle_t cntrl_handle, rsm_localmemory_handle_t *local_handle, caddr_t local_vaddr, size_t length);
This function obtains a local handle for use in the I/O vector for subsequent putv or getv calls. Freeing the handle as soon as possible conserves system resources, notably the memory spanned by the local handle, which may be locked down.
Return Values: Returns 0 if successful; returns an error value otherwise.
RSMERR_BAD_CTLR_HNDL | Invalid controller handle |
RSMERR_BAD_LOCALMEM_HNDL | Invalid local memory handle |
RSMERR_BAD_LENGTH | Invalid length |
RSMERR_BAD_ADDR | Invalid address |
RSMERR_INSUFFICIENT_MEM | Insufficient memory |
rsm_free_localmemory_handle(rsmapi_controller_handle_t cntrl_handle, rsm_localmemory_handle_t handle);
This function releases the system resources associated with the local handle. While all handles belonging to a process are freed when the process exits, calling this function conserves system resources.
Return Values: Returns 0 if successful; returns an error value otherwise.
RSMERR_BAD_CTLR_HNDL | Invalid controller handle |
RSMERR_BAD_LOCALMEM_HNDL | Invalid local memory handle |
The following example demonstrates the definition of primary data structures:
Example 2-1 Primary Data Structures
Segment Mapping
Mapping operations are only available for native architecture interconnects such as Dolphin-SCI or NewLink. Mapping a segment grants CPU memory operations access to that segment, saving the overhead of calling memory access primitives.
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);
This function maps an imported segment into the caller address space. If the attribute RSM_MAP_FIXED is specified, the function maps the segment at the value specified in **address.
typedef enum { RSM_MAP_NONE = 0x0, /* system will choose available virtual address */ RSM_MAP_FIXED = 0x1, /* map segment at specified virtual address */ } rsm_map_attr_t; |
Return Values: Returns 0 if successful; returns an error value otherwise.
RSMERR_BAD_SEG_HNDL | Invalid segment handle |
RSMERR_BAD_ADDR | Invalid address |
RSMERR_BAD_LENGTH | Invalid length |
RSMERR_BAD_OFFSET | Invalid offset |
RSMERR_BAD_PERMS | Invalid permissions |
RSMERR_SEG_ALREADY_MAPPED | Segment already mapped |
RSMERR_SEG_NOT_CONNECTED | Segment not connected |
RSMERR_CONN_ABORTED | Connection aborted |
RSMERR_MAP_FAILED | Error during mapping |
RSMERR_BAD_MEM_ALIGNMENT | Address not aligned on page boundary |
Unmap segment
int rsm_memseg_import_unmap(rsm_memseg_import_handle_t im_memseg);
This function unmaps an imported segment from user virtual address space.
Return Values: Returns 0 if successful; returns an error value otherwise.