Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

libfjcmi (3LIB)

Name

libfjcmi - Coherent Memory Interface for Fujitsu Platform

Synopsis

#include <sys/cmi.h>
#include <cmi/fj/cmi_impl.h>

int cmi_ctl(cmi_ctxt *ctxt, int32_t cmd, cmi_ctl_cfg *cfg)
void cmi_mb()
void cmi_wmb()
void cmi_rmb()

Parameters

ctxt

CMI context for calling thread

cmd

Command operation being requested

cfg

CMI Control structure for operation

Description

Coherent Memory Interface (CMI) API is a common API, and the details are described in cmi(3CMI).

This man page only covers Fujitsu Platform specific interfaces for the CMI API, which are optional interfaces to gain the benefits of the Fujitsu Platform. CMI is fully functional without these Fujitsu platform specific interfaces.

To query or configure the CMI system attributes:

int cmi_ctl(cmi_ctxt *ctxt, int32_t cmd, cmi_ctl_cfg *cfg)

CMI clients can query or configure various attributes of the underlying CMI system. The cfg parameter is a value result parameter. For commands that configure or set certain attributes of the underlying CMI implementation, the client can set the values being modified in the cfg parameter. For commands that query CMI state or attributes, the cfg parameter will contain the result of the operation.

The following CMI control command is defined for the Fujitsu platform:

CMI_CTL_FJ_SET_TOKEN

Explicitly set the token provided in ctl_cfg_token for the calling context. Calling context can set the token associated with the segment it is about to access, to remove possible performance penalty.

The following three APIs are macros that have the same effect as the mb_fn(), wmb_fn(), and rmb_fn() functions respectively, and these macros run with less performance overhead.

void cmi_mb()

Memory barrier that orders both loads and stores. Loads and stores preceding the memory barrier are committed to memory before any loads and stores following the memory barrier.

void cmi_wmb()

Write Memory Barrier that only orders stores i.e. stores preceding the memory barrier are committed to memory before any stores following the memory barrier (in program order). Load operations can be re-ordered across the barrier if underlying implementation supports it.

void cmi_rmb()

Read Memory Barrier that only orders loads i.e. loads preceding the memory barrier are completed before loads following the barrier (in program order). Stores can be re-ordered across the barrier if underlying implementation supports it.

Return Values

On successful completion, returns 0. On failure, returns -1.

Errors

The cmi_ctl() function will fail if:

CMI_ERR_INIT

Calling thread is not associated with context

CMI_ERR_INVAL

Provided context or command is invalid

CMI_ERR_PERM

Insufficient permissions for command execution

CMI_ERR_NOMEM

Insufficient resources for memory reservation request

CMI_ERR_NOTSUPP

Requested command/operation is not supported

Attributes

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

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Uncommitted
Availability
system/fjcmi
MT-Level
MT-Safe

See Also

cmi(7), libcmi(3LIB), fjcmi(4D)