The implementation of
xdc.runtime.knl.ISync.wait is empty
and returns
FALSE for timeout, since with events the pend call is made outside.
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 SyncEvent requires an Event.Handle. When given a null
Event.Handle, SynEvent will assert.
const SyncEvent_NO_WAIT |
|
Used to specify no waiting
#define SyncEvent_NO_WAIT (UInt)0
const SyncEvent_Q_BLOCKING |
|
Blocking quality
#define SyncEvent_Q_BLOCKING (Int)1
DETAILS
Implementations with this "quality" may cause the calling thread to
block;
const SyncEvent_WAIT_FOREVER |
|
Used to wait forever
#define SyncEvent_WAIT_FOREVER (UInt)~(0)
enum SyncEvent_WaitStatus |
|
Error codes returned by ISync_wait
typedef enum SyncEvent_WaitStatus {
SyncEvent_WaitStatus_ERROR,
SyncEvent_WaitStatus_TIMEOUT,
SyncEvent_WaitStatus_SUCCESS
} SyncEvent_WaitStatus;
config SyncEvent_A_nullHandle // module-wide |
|
Assert when baseHandle is null
extern const Assert_Id SyncEvent_A_nullHandle;
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool SyncEvent_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool SyncEvent_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 SyncEvent_Module_getMask();
// Returns the diagnostics mask for this module
Void SyncEvent_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct SyncEvent_Object SyncEvent_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct SyncEvent_Struct SyncEvent_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 SyncEvent_Params {
// Instance config-params structure
// Common per-instance configs
// Event handle must be provided
UInt eventId;
// Event id to be when signal() gets invoked
} SyncEvent_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config SyncEvent_Params.event // instance |
|
Event handle must be provided
config SyncEvent_Params.eventId // instance |
|
Event id to be when signal() gets invoked
Runtime 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
SyncEvent_query() // instance |
|
Query for a particular quality
ARGUMENTS
handle
handle of a previously-created SyncEvent instance object
qual
quality
RETURNS
TRUE or FALSE.
DETAILS
FALSE is returned if quality not supported.
SyncEvent_signal() // instance |
|
Called at completion of an activity
ARGUMENTS
handle
handle of a previously-created SyncEvent 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.
SyncEvent_wait() // instance |
|
Called to wait/poll for completion of an activity
ARGUMENTS
handle
handle of a previously-created SyncEvent 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 SyncEvent_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
const SyncEvent.NO_WAIT |
|
Used to specify no waiting
const SyncEvent.NO_WAIT = 0;
C SYNOPSIS
const SyncEvent.Q_BLOCKING |
|
Blocking quality
const SyncEvent.Q_BLOCKING = 1;
DETAILS
Implementations with this "quality" may cause the calling thread to
block;
C SYNOPSIS
const SyncEvent.WAIT_FOREVER |
|
Used to wait forever
const SyncEvent.WAIT_FOREVER = ~(0);
C SYNOPSIS
enum SyncEvent.WaitStatus |
|
Error codes returned by ISync_wait
values of type SyncEvent.WaitStatus
const SyncEvent.WaitStatus_ERROR;
const SyncEvent.WaitStatus_TIMEOUT;
const SyncEvent.WaitStatus_SUCCESS;
C SYNOPSIS
config SyncEvent.A_nullHandle // module-wide |
|
Assert when baseHandle is null
msg: "A_nullHandle: Null handle passed to create"
};
C SYNOPSIS
metaonly config SyncEvent.common$ // module-wide |
|
Common module configuration parameters
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
Instance Config Parameters |
|
var params = new SyncEvent.Params;
// Instance config-params object
// Event handle must be provided
// Event id to be when signal() gets invoked
config SyncEvent.Params.event // instance |
|
Event handle must be provided
var params = new SyncEvent.Params;
...
C SYNOPSIS
config SyncEvent.Params.eventId // instance |
|
Event id to be when signal() gets invoked
var params = new SyncEvent.Params;
...
C SYNOPSIS
Static Instance Creation |
|
var params =
new SyncEvent.
Params;
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = SyncEvent.create(params);
// Create an instance-object
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)