TransportShmSingle is a simplified version of
TransportShm. This
transport uses the Notify module to do all the real work. The 'put'
function passes the message to the other processor using the 'payload'
parameter to Notify_sendEvent(). The receive side simply casts this
payload parameter to a MessageQ_Msg and enqueues it locally.
The sender will spin in Notify_sendEvent until the receive side has
read the previous message. This is Notify-driver specific.
NotifyDriverShm will spin before sending a new event if the prior event
hasn't been handled. Some Notify drivers may support a FIFO or queue
for these events to mitigate this busy-wait affect.
enum TransportShmNotify_Reason |
|
Reason for error function being called
typedef enum TransportShmNotify_Reason {
TransportShmNotify_Reason_FAILEDPUT,
TransportShmNotify_Reason_INTERNALERR,
TransportShmNotify_Reason_PHYSICALERR,
TransportShmNotify_Reason_FAILEDALLOC
} TransportShmNotify_Reason;
DETAILS
First field in the
errFxn
enum TransportShmNotify_Status |
|
Transport return values
typedef enum TransportShmNotify_Status {
TransportShmNotify_S_SUCCESS,
TransportShmNotify_E_FAIL,
TransportShmNotify_E_ERROR
} TransportShmNotify_Status;
DETAILS
- S_SUCCESS: Operation was successful
- E_FAIL: Operation resulted in a failure
- E_ERROR: Operation resulted in an error.
typedef TransportShmNotify_ErrFxn |
|
Typedef for transport error callback function
DETAILS
First parameter: Why the error function is being called.
Second parameter: Handle of transport that had the error. NULL denotes
that it is a system error, not a specific transport.
Third parameter: Pointer to the message. This is only valid for
Reason_FAILEDPUT.
Fourth parameter: Transport specific information. Refer to individual
transports for more details.
config TransportShmNotify_errFxn // module-wide |
|
Asynchronous error function for the transport module
config TransportShmNotify_notifyEventId // module-wide |
|
Notify event ID for transport
extern const UInt16 TransportShmNotify_notifyEventId;
TransportShmNotify_setErrFxn() // module-wide |
|
Sets the asynchronous error function for the transport module
ARGUMENTS
errFxn
Function that is called when an asynchronous
error occurs.
DETAILS
This API allows the user to set the function that will be called in
case of an asynchronous error by the transport.
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool TransportShmNotify_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool TransportShmNotify_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 TransportShmNotify_Module_getMask();
// Returns the diagnostics mask for this module
Void TransportShmNotify_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct TransportShmNotify_Object TransportShmNotify_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct TransportShmNotify_Struct TransportShmNotify_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 TransportShmNotify_Params {
// Instance config-params structure
// Common per-instance configs
UInt priority;
// Which priority messages should this transport manage
} TransportShmNotify_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config TransportShmNotify_priority // instance |
|
Which priority messages should this transport manage
Instance Creation |
|
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
procId
Remote processor id that this instance
will communicate with.
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)
DETAILS
This function creates a transport instance. The transport is
responsible for registering with MessageQ via the
ti.sdo.ipc.MessageQ.registerTransport API.
Instance Deletion |
|
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
TransportShmNotify_control() // instance |
|
Send a control command to the transport instance
ARGUMENTS
handle
handle of a previously-created TransportShmNotify instance object
cmd
Requested command
cmdArgs
Accompanying field for the command. This is
command specific.
RETURNS
TRUE denotes acceptance of the command. FALSE
denotes failure of the command.
DETAILS
This is function allows transport to specify control commands. Refer
to individual transport implementions for more details.
TransportShmNotify_getStatus() // instance |
|
Status of a Transport instance
ARGUMENTS
handle
handle of a previously-created TransportShmNotify instance object
RETURNS
Returns status of Transport instance
DETAILS
This function returns the status of the transport instance.
TransportShmNotify_put() // instance |
|
Put the message to the remote processor
ARGUMENTS
handle
handle of a previously-created TransportShmNotify instance object
msg
Pointer the message to be sent
RETURNS
TRUE denotes acceptance of the message to
be sent. FALSE denotes the message could not be
sent.
DETAILS
If the transport can accept the message, it returns TRUE. Accepting
a message does not mean that it is transmitted. It simply means that
the transport should be able to send the message. If the actual transfer
fails, the transport calls the {@#ErrFxn} (assuming it is set up via the
{@#setErrFxn} API. If the {@#ErrFxn} is not set, the message is dropped.
(also...should an error be raised or just System_printf?).
If the transport cannot send the message, it returns FALSE and a
filled in Error_Block. The caller still owns the message.
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 TransportShmNotify_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
enum TransportShmNotify.Reason |
|
Reason for error function being called
XDCscript usage |
meta-domain |
values of type TransportShmNotify.Reason
const TransportShmNotify.Reason_FAILEDPUT;
const TransportShmNotify.Reason_INTERNALERR;
const TransportShmNotify.Reason_PHYSICALERR;
const TransportShmNotify.Reason_FAILEDALLOC;
DETAILS
First field in the
errFxn
C SYNOPSIS
enum TransportShmNotify.Status |
|
Transport return values
XDCscript usage |
meta-domain |
values of type TransportShmNotify.Status
const TransportShmNotify.S_SUCCESS;
const TransportShmNotify.E_FAIL;
const TransportShmNotify.E_ERROR;
DETAILS
- S_SUCCESS: Operation was successful
- E_FAIL: Operation resulted in a failure
- E_ERROR: Operation resulted in an error.
C SYNOPSIS
config TransportShmNotify.errFxn // module-wide |
|
Asynchronous error function for the transport module
XDCscript usage |
meta-domain |
C SYNOPSIS
config TransportShmNotify.notifyEventId // module-wide |
|
Notify event ID for transport
XDCscript usage |
meta-domain |
TransportShmNotify.notifyEventId = UInt16 2;
C SYNOPSIS
metaonly config TransportShmNotify.common$ // module-wide |
|
Common module configuration parameters
XDCscript usage |
meta-domain |
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 |
|
XDCscript usage |
meta-domain |
var params = new TransportShmNotify.Params;
// Instance config-params object
params.priority = UInt 0;
// Which priority messages should this transport manage
config TransportShmNotify.priority // instance |
|
Which priority messages should this transport manage
XDCscript usage |
meta-domain |
var params = new TransportShmNotify.Params;
...
params.priority = UInt 0;
C SYNOPSIS
Instance Creation |
|
XDCscript usage |
meta-domain |
var params =
new TransportShmNotify.
Params;
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = TransportShmNotify.create(UInt16 procId, params);
// Create an instance-object
ARGUMENTS
procId
Remote processor id that this instance
will communicate with.
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)
DETAILS
This function creates a transport instance. The transport is
responsible for registering with MessageQ via the
ti.sdo.ipc.MessageQ.registerTransport API.