config VirtQueue_PAGE_SIZE // module-wide |
|
extern const UInt VirtQueue_PAGE_SIZE;
config VirtQueue_RP_MSG_NUM_BUFS // module-wide |
|
extern const UInt VirtQueue_RP_MSG_NUM_BUFS;
config VirtQueue_RP_MSG_VRING_ALIGN // module-wide |
|
extern const UInt VirtQueue_RP_MSG_VRING_ALIGN;
config VirtQueue_VQ1_SIZE // module-wide |
|
extern const UInt VirtQueue_VQ1_SIZE;
VirtQueue_startup() // module-wide |
|
Plug interrupts, and if host, initialize vring memory and send
startup sequence events to slave
Void VirtQueue_startup(UInt16 remoteProcId, Bool isHost);
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool VirtQueue_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool VirtQueue_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 VirtQueue_Module_getMask();
// Returns the diagnostics mask for this module
Void VirtQueue_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct VirtQueue_Object VirtQueue_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct VirtQueue_Struct VirtQueue_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 VirtQueue_Params {
// Instance config-params structure
// Common per-instance configs
Fxn callback;
//
Int vqId;
//
} VirtQueue_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config VirtQueue_Params.callback // instance |
|
config VirtQueue_Params.vqId // instance |
|
Runtime Instance Creation |
|
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
[in] remoteProcId Remote processor ID associated with this VirtQueue.
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
Maps to Instance_init function
BRIEF
Initialize at runtime the VirtQueue
RETURNS
Returns a handle to a new initialized VirtQueue.
Instance Deletion |
|
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
VirtQueue_addAvailBuf() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
[in] buf the buffer to be processed by the slave.
BRIEF
Add available buffer to virtqueue's available buffer list.
Only used by Host.
RETURN
Remaining capacity of queue or a negative error.
SA
VirtQueue_getUsedBuf
VirtQueue_addUsedBuf() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
[in] token token of the buffer added to vring used list.
[in] len length of the message being added.
BRIEF
Add used buffer to virtqueue's used buffer list.
Only used by Slave.
RETURN
Remaining capacity of queue or a negative error.
SA
VirtQueue_getAvailBuf
VirtQueue_getAvailBuf() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
[out] buf Pointer to location of available buffer;
[out] len Length of the available buffer message.
BRIEF
Get the next available buffer.
Only used by Slave.
RETURN
Returns a token used to identify the available buffer, to be
passed back into VirtQueue_addUsedBuf();
token is negative if failure to find an available buffer.
SA
VirtQueue_addUsedBuf
VirtQueue_getId() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
DETAILS
Returns VirtQueue instance's queue ID.
BRIEF
VirtQueue instance returns queue ID
VirtQueue_getSwiHandle() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
DETAILS
Returns VirtQueue instance Swi handle
BRIEF
VirtQueue instance returns Swi handle
VirtQueue_getUsedBuf() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
BRIEF
Get the next used buffer.
Only used by Host.
RETURN
Returns NULL or the processed buffer.
SA
VirtQueue_addAvailBuf
VirtQueue_isHost() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
DETAILS
Returns if this VirtQueue instance belongs to a host
BRIEF
VirtQueue instance returns host status
VirtQueue_isSlave() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
DETAILS
Returns if this VirtQueue instance belongs to a slave
BRIEF
VirtQueue instance returns slave status
VirtQueue_kick() // instance |
|
ARGUMENTS
handle
handle of a previously-created VirtQueue instance object
[in] vq the VirtQueue.
DETAILS
After one or more add_buf calls, invoke this to kick the other side.
BRIEF
Notify other processor of new buffers in the queue.
SA
VirtQueue_addBuf
Instance Built-Ins |
|
Int VirtQueue_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