This module uses
ti.sysbios.knl.Swi.post to implement
xdc.runtime.knl.ISync.signal
The implementation of
xdc.runtime.knl.ISync.wait is empty and
returns
FALSE for timeout, since Swis are asynchronous in nature.
Modules like
ti.sdo.io.Stream use an ISync.Handle for
selecting the synchronization mechanism. This allows Stream to be
independent of the synchronization mechanism.
An instance of SyncSwi requires an Swi.Handle. When given a null
Swi.Handle, SynSwi will assert.
const SyncSwi_NO_WAIT |
|
Used to specify no waiting
#define SyncSwi_NO_WAIT (UInt)0
const SyncSwi_Q_BLOCKING |
|
Blocking quality
#define SyncSwi_Q_BLOCKING (Int)1
DETAILS
Implementations with this "quality" may cause the calling thread to
block;
const SyncSwi_WAIT_FOREVER |
|
Used to wait forever
#define SyncSwi_WAIT_FOREVER (UInt)~(0)
enum SyncSwi_WaitStatus |
|
Error codes returned by ISync_wait
typedef enum SyncSwi_WaitStatus {
SyncSwi_WaitStatus_ERROR,
SyncSwi_WaitStatus_TIMEOUT,
SyncSwi_WaitStatus_SUCCESS
} SyncSwi_WaitStatus;
config SyncSwi_A_nullHandle // module-wide |
|
Assert when baseHandle is null
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool SyncSwi_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool SyncSwi_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 SyncSwi_Module_getMask();
// Returns the diagnostics mask for this module
Void SyncSwi_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct SyncSwi_Object SyncSwi_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct SyncSwi_Struct SyncSwi_Struct;
// Opaque client structure large enough to hold an instance object
// Convert this instance structure pointer into an instance handle
// Convert this instance handle into an instance structure pointer
Instance Config Parameters |
|
typedef struct SyncSwi_Params {
// Instance config-params structure
// Common per-instance configs
// Swi handle to be used
} SyncSwi_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config SyncSwi_swi // instance |
|
Swi handle to be used
Instance Creation |
|
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
params
per-instance config params, or NULL to select default values (target-domain only)
eb
active error-handling block, or NULL to select default policy (target-domain only)
Instance Deletion |
|
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
SyncSwi_query() // instance |
|
Query for a particular quality
ARGUMENTS
handle
handle of a previously-created SyncSwi instance object
qual
quality
RETURNS
TRUE or FALSE.
DETAILS
FALSE is returned if quality not supported.
SyncSwi_signal() // instance |
|
Called at completion of an activity
ARGUMENTS
handle
handle of a previously-created SyncSwi instance object
DETAILS
This function is non-blocking. It is also required that the underlying
sync be binary in nature.
This function does not take an Error.Block intentionally because
it can be called from ISR context.
SyncSwi_wait() // instance |
|
Called to wait/poll for completion of an activity
ARGUMENTS
handle
handle of a previously-created SyncSwi instance object
timeout
Timeout in microseconds
eb
Hist Pointer to Error.Block
RETURNS
Refer to description above
DETAILS
This function can block. Non-blocking implementations should return
WaitStatus_TIMEOUT to indicate a timeout.
Instance Convertors |
|
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins |
|
Int SyncSwi_Object_count();
// The number of statically-created instance objects
// The handle of the i-th statically-created instance object (array == NULL)
// The handle of the first dynamically-created instance object, or NULL
// The handle of the next dynamically-created instance object, or NULL
// The heap used to allocate dynamically-created instance objects
// The label associated with this instance object
// The name of this instance object