libfjcmi - Coherent Memory Interface for Fujitsu Platform
#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()
CMI context for calling thread
Command operation being requested
CMI Control structure for operation
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:
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.
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.
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.
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.
On successful completion, returns 0. On failure, returns -1.
The cmi_ctl() function will fail if:
Calling thread is not associated with context
Provided context or command is invalid
Insufficient permissions for command execution
Insufficient resources for memory reservation request
Requested command/operation is not supported
See attributes(7) for descriptions of the following attributes:
|