This module is a proxy to the generic Hwi module functions
Hwi_enable, Hwi_disable, and Hwi_restore as defined in IHwi.xdc.
The actual implementations of the Hwi module functions are
provided by the Hwi module delegates.
Additional, family specific Hwi module APIs may also be provided by
the Hwi module delegates.
Follow the link below to determine which Hwi delegate is used
for your Target/Device:
enum Hwi.MaskingOption |
|
Shorthand interrupt masking options
XDCscript usage |
meta-domain |
values of type Hwi.MaskingOption
const Hwi.MaskingOption_NONE;
// No interrupts are disabled
const Hwi.MaskingOption_ALL;
// All interrupts are disabled
const Hwi.MaskingOption_SELF;
// Only this interrupt is disabled
const Hwi.MaskingOption_BITMASK;
// User supplies IER masks
const Hwi.MaskingOption_LOWER;
// All current and lower priority
interrupts are disabled. Only a few
targets/devices truly support this
masking option. For those that don't,
this setting is treated the same as
MaskingOption_SELF
typedef enum Hwi_MaskingOption {
Hwi_MaskingOption_NONE,
// No interrupts are disabled
Hwi_MaskingOption_ALL,
// All interrupts are disabled
Hwi_MaskingOption_SELF,
// Only this interrupt is disabled
Hwi_MaskingOption_BITMASK,
// User supplies IER masks
Hwi_MaskingOption_LOWER
// All current and lower priority
interrupts are disabled. Only a few
targets/devices truly support this
masking option. For those that don't,
this setting is treated the same as
MaskingOption_SELF
} Hwi_MaskingOption;
typedef Hwi.FuncPtr |
|
Hwi create function type definition
typedef Void (*Hwi_FuncPtr)(UArg);
typedef Hwi.Irp |
|
Interrupt Return Pointer.
This is the address of the interrupted instruction
metaonly struct Hwi.BasicView |
|
XDCscript usage |
meta-domain |
var obj = new Hwi.BasicView;
obj.label = String ...
obj.delegateHwiHandle = String ...
obj.intNum = Int ...
obj.fxn = String ...
obj.arg = UArg ...
struct Hwi.HookSet |
|
Hwi hook set type definition
XDCscript usage |
meta-domain |
var obj = new Hwi.HookSet;
obj.registerFxn = Void(*)(Int) ...
typedef struct Hwi_HookSet {
Void (*registerFxn)(Int);
} Hwi_HookSet;
metaonly struct Hwi.ModuleView |
|
XDCscript usage |
meta-domain |
var obj = new Hwi.ModuleView;
obj.delegateHwiModule = String ...
obj.options = String[4] ...
obj.hwiStackPeak = SizeT ...
obj.hwiStackSize = SizeT ...
obj.hwiStackBase = Ptr ...
config Hwi.dispatcherAutoNestingSupport // module-wide |
|
Include interrupt nesting logic in interrupt dispatcher?
Default is true
XDCscript usage |
meta-domain |
Hwi.dispatcherAutoNestingSupport = Bool true;
extern const Bool Hwi_dispatcherAutoNestingSupport;
DETAILS
This option provides the user with the ability to optimize
interrupt dispatcher performance when support for interrupt
nesting is not required.
Setting this parameter to false will disable the logic in
the interrupt dispatcher that manipulates interrupt mask
registers and enables and disables interrupts before and
after invoking the user's Hwi function.
Set this parameter to false if you don't need interrupts
enabled during the execution of your Hwi functions.
config Hwi.dispatcherIrpTrackingSupport // module-wide |
|
This dispatcher configuration option controls whether the
dispatcher retains the interrupted thread's return address.
This option is enabled by default
XDCscript usage |
meta-domain |
Hwi.dispatcherIrpTrackingSupport = Bool true;
extern const Bool Hwi_dispatcherIrpTrackingSupport;
DETAILS
Setting this parameter to false will disable the logic in
the interrupt dispatcher that keeps track of the interrupt's
return address and provide a small savings in interrupt latency.
The application can get an interrupt's most recent return
address using the
getIrp API.
config Hwi.dispatcherSwiSupport // module-wide |
|
Include Swi scheduling logic in interrupt dispatcher?
Default is inherited from BIOS.swiEnabled, which is true by default
XDCscript usage |
meta-domain |
Hwi.dispatcherSwiSupport = Bool undefined;
extern const Bool Hwi_dispatcherSwiSupport;
DETAILS
This option provides the user with the ability to optimize
interrupt dispatcher performance when it is known that Swi's
will not be posted from any of their Hwi threads.
Setting this parameter to false will disable the logic in
the interrupt dispatcher that invokes the Swi scheduler
prior to returning from an interrupt.
config Hwi.dispatcherTaskSupport // module-wide |
|
Include Task scheduling logic in interrupt dispatcher?
Default is inherited from BIOS.taskEnabled, which is true by default
XDCscript usage |
meta-domain |
Hwi.dispatcherTaskSupport = Bool undefined;
extern const Bool Hwi_dispatcherTaskSupport;
DETAILS
This option provides the user with the ability to optimize
interrupt dispatcher performance when it is known that no
Task scheduling APIs (ie
Semaphore_post()) will be executed from any of their Hwi threads.
Setting this parameter to false will disable the logic in
the interrupt dispatcher that invokes the Task scheduler
prior to returning from an interrupt.
metaonly config Hwi.checkStackFlag // module-wide |
|
Check for Hwi stack overrun during Idle loop
XDCscript usage |
meta-domain |
Hwi.checkStackFlag = Bool true;
DETAILS
If true, then an idle function is added to the idle loop
that checks for a Hwi stack overrun condition and raises
an Error if one is detected.
Default is true.
metaonly config Hwi.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.
metaonly config Hwi.rovViewInfo // module-wide |
|
XDCscript usage |
meta-domain |
Hwi.clearInterrupt( ) // module-wide |
|
Clear a specific interrupt
Void Hwi_clearInterrupt( UInt intNum );
ARGUMENTS
intNum
interrupt number to enable
DETAILS
Clears a specific interrupt's pending status.
The implementation is family specific.
Hwi.disable( ) // module-wide |
|
Globally disable interrupts
macro UInt Hwi_disable( );
RETURNS
opaque key for use by Hwi_restore()
DETAILS
Hwi_disable globally disables hardware interrupts and returns an
opaque key indicating whether interrupts were globally enabled or
disabled on entry to Hwi_disable().
The actual value of the key is target/device specific and is meant
to be passed to Hwi_restore().
Call Hwi_disable before a portion of a function that needs
to run without interruption. When critical processing is complete, call
Hwi_restore or Hwi_enable to reenable hardware interrupts.
Servicing of interrupts that occur while interrupts are disabled is
postponed until interrupts are reenabled. However, if the same type
of interrupt occurs several times while interrupts are disabled,
the interrupt's function is executed only once when interrupts are
reenabled.
A context switch can occur when calling Hwi_enable or Hwi_restore if
an enabled interrupt occurred while interrupts are disabled.
Hwi_disable may be called from main(). However, since Hwi interrupts
are already disabled in main(), such a call has no effect.
CONSTRAINTS
If a Task switching API such as
Semaphore_pend(),
Semaphore_post(),
Task_sleep(), or
Task_yield()
is invoked which results in a context switch while
interrupts are disabled, an embedded call to
Hwi_enable occurs
on the way to the new thread context which unconditionally re-enables
interrupts. Interrupts will remain enabled until a subsequent
Hwi_disable
invocation.
Swis always run with interrupts enabled.
See
Swi_post() for a discussion Swis and
interrupts.
Hwi.disableInterrupt( ) // module-wide |
|
Disable a specific interrupt
UInt Hwi_disableInterrupt( UInt intNum );
ARGUMENTS
intNum
interrupt number to disable
RETURNS
key to restore previous enable/disable state
DETAILS
Disable a specific interrupt identified by an interrupt number.
Hwi.enable( ) // module-wide |
|
Globally enable interrupts
macro UInt Hwi_enable( );
RETURNS
opaque key for use by Hwi_restore()
DETAILS
Hwi_enable globally enables hardware interrupts and returns an
opaque key indicating whether interrupts were globally enabled or
disabled on entry to Hwi_enable().
The actual value of the key is target/device specific and is meant
to be passed to Hwi_restore().
This function is
called as part of BIOS Startup_POST_APP_MAIN phase.
Hardware interrupts are enabled unless a call to Hwi_disable disables
them.
Servicing of interrupts that occur while interrupts are disabled is
postponed until interrupts are reenabled. However, if the same type
of interrupt occurs several times while interrupts are disabled,
the interrupt's function is executed only once when interrupts are
reenabled.
A context switch can occur when calling Hwi_enable or Hwi_restore if
an enabled interrupt occurred while interrupts are disabled.
Any call to Hwi_enable enables interrupts, even if Hwi_disable has
been called several times.
Hwi_enable must not be called from main().
Hwi.enableInterrupt( ) // module-wide |
|
Enable a specific interrupt
UInt Hwi_enableInterrupt( UInt intNum );
ARGUMENTS
intNum
interrupt number to enable
RETURNS
key to restore previous enable/disable state
DETAILS
Enables a specific interrupt identified by an interrupt number.
Hwi.restore( ) // module-wide |
|
Globally restore interrupts
macro Void Hwi_restore( UInt key );
ARGUMENTS
key
enable/disable state to restore
DETAILS
Hwi_restore globally restores interrupts to the state determined
by the key argument provided by a previous invocation of Hwi_disable.
A context switch may occur when calling Hwi_restore if Hwi_restore
reenables interrupts and another Hwi occurred while interrupts were
disabled.
Hwi_restore may be called from main(). However, since Hwi_enable
cannot be called from main(), interrupts are always disabled in
main(), and a call to Hwi_restore has no effect.
Hwi.restoreInterrupt( ) // module-wide |
|
Restore a specific interrupt's enabled/disabled state
Void Hwi_restoreInterrupt( UInt intNum, UInt key );
ARGUMENTS
intNum
interrupt number to restore
key
key returned from enableInt or disableInt
DETAILS
Restores a specific interrupt identified by an interrupt number.
restoreInterrupt is generally used to restore an interrupt to its state
before
disableInterrupt or
enableInterrupt was
invoked
Hwi.startup( ) // module-wide |
|
Initially enable interrupts
DETAILS
Called within BIOS_start
metaonly Hwi.addHookSet( ) // module-wide |
|
addHookSet is used in a config file to add a hook set (defined
by struct HookSet)
XDCscript usage |
meta-domain |
ARGUMENTS
hook
structure of type HookSet
DETAILS
HookSet structure elements may be omitted, in which case those
elements will not exist.
module-wide built-ins |
|
// Get this module's unique id
Bool Hwi_Module_startupDone( );
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Hwi_Module_hasMask( );
// Test whether this module has a diagnostics mask
Bits16 Hwi_Module_getMask( );
// Returns the diagnostics mask for this module
Void Hwi_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module
per-instance object types |
|
typedef struct Hwi_Object Hwi_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct Hwi_Struct Hwi_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
per-instance config parameters |
|
XDCscript usage |
meta-domain |
var params = new Hwi.Params;
// Instance config-params object
params.arg = UArg 0;
// ISR function argument. Default is 0
params.enableInt = Bool true;
// Enable this interrupt now? Default is true
params.eventId = Int -1;
// Interrupt event ID (Interrupt Selection Number)
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored
// maskSetting. Default is {@link #MaskingOption Hwi_MaskingOption_SELF}
params.priority = Int -1;
// Interrupt priority.
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored
typedef struct Hwi_Params {
// Instance config-params structure
// Common per-instance configs
UArg arg;
// ISR function argument. Default is 0
Bool enableInt;
// Enable this interrupt now? Default is true
Int eventId;
// Interrupt event ID (Interrupt Selection Number)
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored
// maskSetting. Default is {@link #MaskingOption Hwi_MaskingOption_SELF}
Int priority;
// Interrupt priority.
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored
} Hwi_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config Hwi.arg // per-instance |
|
ISR function argument. Default is 0
XDCscript usage |
meta-domain |
var params = new Hwi.Params;
...
params.arg = UArg 0;
config Hwi.enableInt // per-instance |
|
Enable this interrupt now? Default is true
XDCscript usage |
meta-domain |
var params = new Hwi.Params;
...
params.enableInt = Bool true;
config Hwi.eventId // per-instance |
|
Interrupt event ID (Interrupt Selection Number)
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored
XDCscript usage |
meta-domain |
var params = new Hwi.Params;
...
params.eventId = Int -1;
config Hwi.maskSetting // per-instance |
|
maskSetting. Default is Hwi_MaskingOption_SELF
XDCscript usage |
meta-domain |
var params = new Hwi.Params;
...
config Hwi.priority // per-instance |
|
Interrupt priority.
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored
XDCscript usage |
meta-domain |
var params = new Hwi.Params;
...
params.priority = Int -1;
per-instance creation |
|
XDCscript usage |
meta-domain |
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = Hwi.create( Int intNum, Void(*)(UArg) hwiFxn, params );
// Create an instance-object
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
intNum
interrupt number
hwiFxn
pointer to ISR function
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
A Hwi dispatcher table entry is created and filled with the
function specified by the fxn parameter and the attributes
specified by the params parameter.
If params is NULL, the Hwi's dispatcher properties are assigned a
default set of values. Otherwise, the Hwi's dispatcher properties
are specified by a structure of type Hwi_Params.
The maskSetting element defines the dispatcherAutoNestingSupport
behavior of the interrupt.
The arg element is a generic argument that is passed to the plugged
function as its only parameter. The default value is 0.
The enableInt element determines whether the interrupt should be
enabled in the IER by create.
Hwi_create returns a pointer to the created Hwi object.
per-instance deletion |
|
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
Hwi.getFunc( ) // per-instance |
|
Get Hwi function and arg
ARGUMENTS
handle
handle of a previously-created Hwi instance object
arg
pointer for returning hwi's ISR function argument
RETURNS
hwi's ISR function
Hwi.getHookContext( ) // per-instance |
|
Get hook instance's context for a hwi
Ptr Hwi_getHookContext(
Hwi_Handle handle,
Int id );
ARGUMENTS
handle
handle of a previously-created Hwi instance object
RETURNS
hook instance's context for hwi
hook instance's context for hwi
DETAILS
The Handle passed to this API must be the handle passed
to any of the Hook functions, not the one returned by
create.
Hwi.getIrp( ) // per-instance |
|
Get address of interrupted instruction
ARGUMENTS
handle
handle of a previously-created Hwi instance object
RETURNS
most current IRP of a hwi
Hwi.setFunc( ) // per-instance |
|
Overwrite Hwi function and arg
ARGUMENTS
handle
handle of a previously-created Hwi instance object
fxn
pointer to ISR function
arg
argument to ISR function
DETAILS
Replaces a Hwi object's hwiFxn function originally
provided in
create.
Hwi.setHookContext( ) // per-instance |
|
Set hook instance's context for a hwi
Void Hwi_setHookContext(
Hwi_Handle handle,
Int id,
Ptr hookContext );
ARGUMENTS
handle
handle of a previously-created Hwi instance object
id
hook instance's ID
hook instance's ID
hookContext
value to write to context
value to write to context
DETAILS
The Handle passed to this API must be the handle passed
to any of the Hook functions, not the one returned by
create.
per-instance convertors |
|
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure
per-instance built-ins |
|
Int Hwi_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