GateDualCore uses disabling and enabling of interrupts as well as a shared
variable between the two M3 cores as the resource locking
mechanism. Such a gate guarantees exclusive access to a resource
shared between the cores.
Each gate consumes one 32 bit word of shared memory.
An array of these gates is shared between the two M3 cores and
therefore the address of this array must be known to both (see
gateArrayAddress).
By default, the array has 4 entries (see
numGates)
and is placed immediately below Core 0's default interrupt
vector table address. It is the responsibility of the user to
configure both cores with the same array address and size.
In a dual core M3 (Ducati) environment, core 0 is responsible
for initializing the shared gate variable, therefore core 0
must be brought up BEFORE core 1 invokes GateDualCore_enter().
This can be achieved by simply running core 0 to its main()
function prior to loading and running core 1.
GateDualCore does not support nesting of
enter/
leave
calls.
Global interrupts are disabled upon return from GateDualCore_enter().
The duration between the enter and leave should be as short as possible
to minimize Hwi latency and stalls by the other M3 core.
Gate zero (0) is reserved for the
ti.sysbios.hal.unicache.Cache
module and is internally configured for its use.
const GateDualCore_Q_BLOCKING |
|
Blocking quality
#define GateDualCore_Q_BLOCKING (Int)1
DETAILS
Gates with this "quality" may cause the calling thread to block;
i.e., suspend execution until another thread leaves the gate.
const GateDualCore_Q_PREEMPTING |
|
Preempting quality
#define GateDualCore_Q_PREEMPTING (Int)2
DETAILS
Gates with this "quality" allow other threads to preempt the thread
that has already entered the gate.
config GateDualCore_A_nestedEnter // module-wide |
|
Assert if nested "enter" called
extern const Assert_Id GateDualCore_A_nestedEnter;
config GateDualCore_E_gateInUse // module-wide |
|
Error raised if a Gate is already in use
extern const Error_Id GateDualCore_E_gateInUse;
config GateDualCore_E_invalidIndex // module-wide |
|
Error raised if an invalid Gate index is provided
extern const Error_Id GateDualCore_E_invalidIndex;
config GateDualCore_enableStats // module-wide |
|
Gate statistics collection flag. Default is disabled
extern const Bool GateDualCore_enableStats;
config GateDualCore_gateArrayAddress // module-wide |
|
Base address of configurable Ducati Gate Array
extern const Ptr GateDualCore_gateArrayAddress;
DETAILS
Each gate consumes one 32 bit word of shared memory.
The array is shared between the two M3 cores and therefore
the address of this array must be the same for both.
By default, the array has 4 entries (see
numGates)
and is placed immediately below Core 1's default interrupt
vector table address of 0x00000800 (see
ti.sysbios.family.arm.m3.Hwi.vectorTableAddress).
Gate zero (0) is reserved for the
ti.sysbios.hal.unicache.Cache module.
config GateDualCore_initGates // module-wide |
|
Gate initialize flag
extern const Bool GateDualCore_initGates;
DETAILS
By default, core 0 initializes all of the
gates in
gateArray.
This behavior can be overridden by explicitly setting this
flag within your config script.
config GateDualCore_numGates // module-wide |
|
Number of Gates that can be created. Default is 4
extern const UInt GateDualCore_numGates;
DETAILS
Each gate consumes one 32 bit word of memory.
(see
gateArrayAddress).
extern GateDualCore_gateArray |
|
Shared array of gate variables
UInt32 GateDualCore_gateArray[
GateDualCore_numGates]; // linked as extern ti_sysbios_family_arm_ducati_GateDualCore_gateArray
DETAILS
This global variable is placed in its own data section
and that section is placed at
gateArrayAddress.
The size of the array is determined by
numGates
GateDualCore_query() // module-wide |
|
Runtime test for a particular gate quality
Bool GateDualCore_query(Int qual);
ARGUMENTS
qual
constant describing a quality
RETURNS
Returns TRUE if the gate has the given quality,
and FALSE otherwise, which includes the case when the gate does not
recognize the constant describing the quality.
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool GateDualCore_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool GateDualCore_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 GateDualCore_Module_getMask();
// Returns the diagnostics mask for this module
Void GateDualCore_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct GateDualCore_Object GateDualCore_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct GateDualCore_Struct GateDualCore_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 GateDualCore_Params {
// Instance config-params structure
// Common per-instance configs
UInt index;
// index of the gate variable in the shared gateArray table
} GateDualCore_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config GateDualCore_index // instance |
|
index of the gate variable in the shared gateArray table
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
GateDualCore_sync() // instance |
|
Sync execution with the other M3 core
ARGUMENTS
handle
handle of a previously-created GateDualCore instance object
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 GateDualCore_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 GateDualCore.Q_BLOCKING |
|
Blocking quality
const GateDualCore.Q_BLOCKING = 1;
DETAILS
Gates with this "quality" may cause the calling thread to block;
i.e., suspend execution until another thread leaves the gate.
C SYNOPSIS
const GateDualCore.Q_PREEMPTING |
|
Preempting quality
const GateDualCore.Q_PREEMPTING = 2;
DETAILS
Gates with this "quality" allow other threads to preempt the thread
that has already entered the gate.
C SYNOPSIS
config GateDualCore.A_nestedEnter // module-wide |
|
Assert if nested "enter" called
msg: "A_nestedEnter: Can't nest 'enter' calls."
};
C SYNOPSIS
config GateDualCore.E_gateInUse // module-wide |
|
Error raised if a Gate is already in use
C SYNOPSIS
config GateDualCore.E_invalidIndex // module-wide |
|
Error raised if an invalid Gate index is provided
msg: "E_invalidIndex %d"
};
C SYNOPSIS
config GateDualCore.enableStats // module-wide |
|
Gate statistics collection flag. Default is disabled
GateDualCore.enableStats = Bool false;
C SYNOPSIS
config GateDualCore.gateArrayAddress // module-wide |
|
Base address of configurable Ducati Gate Array
GateDualCore.gateArrayAddress = Ptr 0x000007f0;
DETAILS
Each gate consumes one 32 bit word of shared memory.
The array is shared between the two M3 cores and therefore
the address of this array must be the same for both.
By default, the array has 4 entries (see
numGates)
and is placed immediately below Core 1's default interrupt
vector table address of 0x00000800 (see
ti.sysbios.family.arm.m3.Hwi.vectorTableAddress).
Gate zero (0) is reserved for the
ti.sysbios.hal.unicache.Cache module.
C SYNOPSIS
config GateDualCore.initGates // module-wide |
|
Gate initialize flag
GateDualCore.initGates = Bool undefined;
DETAILS
By default, core 0 initializes all of the
gates in
gateArray.
This behavior can be overridden by explicitly setting this
flag within your config script.
C SYNOPSIS
config GateDualCore.numGates // module-wide |
|
Number of Gates that can be created. Default is 4
GateDualCore.numGates = UInt 4;
DETAILS
Each gate consumes one 32 bit word of memory.
(see
gateArrayAddress).
C SYNOPSIS
metaonly config GateDualCore.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.
metaonly config GateDualCore.rovViewInfo // module-wide |
|
metaonly GateDualCore.queryMeta() // module-wide |
|
Configuration time test for a particular gate quality
GateDualCore.queryMeta(Int qual) returns Bool
ARGUMENTS
qual
constant describing a quality
RETURNS
Returns TRUE if the gate has the given quality,
and FALSE otherwise, which includes the case when the gate does not
recognize the constant describing the quality.
Instance Config Parameters |
|
var params = new GateDualCore.Params;
// Instance config-params object
params.index = UInt 0;
// index of the gate variable in the shared gateArray table
config GateDualCore.index // instance |
|
index of the gate variable in the shared gateArray table
var params = new GateDualCore.Params;
...
params.index = UInt 0;
C SYNOPSIS
Instance Creation |
|
var params =
new GateDualCore.
Params;
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = GateDualCore.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)