Programming Interfaces Guide

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.

Imported Segment Map

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.

RSMERR_BAD_SEG_HNDL

Invalid segment handle