Additional ARM device-specific APIs are also provided.
For applications requiring extremely low interrupt latency, this Hwi module
allows the user to create FIQ interrupts that bypass the SYS/BIOS interrupt
dispatcher. Though not a precisely correct classification, these interrupts
are referred to as "Zero latency" interrupts.
The ISR handler function for a "Zero latency" interrupt must use the
"interrupt" keyword in the function definition and should have no
parameters. Using the "interrupt" keyword will ensure that the necessary
registers are saved on entry into the interrupt routine and are restored
upon exit from the interrupt routine.
(Constraints of using "FIQ" aka "Zero latency" interrupts)
Interrupts configured to bypass the dispatcher are not allowed
to call ANY SYS/BIOS APIs that effect thread scheduling. Examples
of API that should no be invoked are:
Each VIM interrupt request (source) can be mapped to any of the interrupt
channels (same as intNums). Lower numbered channels in each FIQ and IRQ
have higher priority. Therefore, channel mapping provides a mechanism for
prioritizing the interrupt requests.
Additionally, it is possible to configure a channel interrupt as a wakeup
interrupt so it can bring the core out of low power mode (LPM).
By default, all interrupt request sources are direct mapped to channels
(i.e. interrupt request N is mapped to channel N) and wakeup feature is
enabled for all interrupts.
enum Hwi_MaskingOption |
|
Shorthand interrupt masking options
typedef enum Hwi_MaskingOption {
Hwi_MaskingOption_NONE,
Hwi_MaskingOption_ALL,
Hwi_MaskingOption_SELF,
Hwi_MaskingOption_BITMASK,
Hwi_MaskingOption_LOWER
} Hwi_MaskingOption;
VALUES
MaskingOption_NONE
No interrupts are disabled
MaskingOption_ALL
All interrupts are disabled
MaskingOption_SELF
Only this interrupt is disabled
MaskingOption_BITMASK
User supplies interrupt enable masks
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.
enum Hwi_Type |
|
Interrupt type. IRQ or FIQ
typedef enum Hwi_Type {
Hwi_Type_IRQ,
// IRQ interrupt
Hwi_Type_FIQ
// FIQ interrupt
} Hwi_Type;
typedef Hwi_FuncPtr |
|
Hwi create function type definition
typedef Void (*Hwi_FuncPtr)(UArg);
typedef Hwi_Irp |
|
Interrupt Return Pointer
DETAILS
This is the address of the interrupted instruction.
typedef Hwi_VectorFuncPtr |
|
Hwi vector function type definition
typedef Void (*Hwi_VectorFuncPtr)(Void);
struct Hwi_HookSet |
|
Hwi hook set type definition
typedef struct Hwi_HookSet {
Void (*registerFxn)(Int);
} Hwi_HookSet;
DETAILS
The functions that make up a hookSet have certain restrictions. They
cannot call any Hwi instance functions other than Hwi_getHookContext()
and Hwi_setHookContext(). For all practical purposes, they should treat
the Hwi_Handle passed to these functions as an opaque handle.
struct Hwi_StackInfo |
|
Structure contains Hwi stack usage info
typedef struct Hwi_StackInfo {
SizeT hwiStackPeak;
SizeT hwiStackSize;
Ptr hwiStackBase;
} Hwi_StackInfo;
DETAILS
Used by getStackInfo() and viewGetStackInfo() functions
config Hwi_A_badChannelId // module-wide |
|
Assert raised when an invalid channelId is passed to Hwi_mapChannel()
function
config Hwi_E_alreadyDefined // module-wide |
|
Error raised when Hwi is already defined
extern const Error_Id Hwi_E_alreadyDefined;
config Hwi_E_badIntNum // module-wide |
|
Error raised if an attempt is made to create a Hwi
with an interrupt number greater than Hwi_NUM_INTERRUPTS - 1
config Hwi_E_phantomInterrupt // module-wide |
|
Error raised when a phantom interrupt occurs
extern const Error_Id Hwi_E_phantomInterrupt;
config Hwi_E_undefined // module-wide |
|
Error raised when an undefined interrupt has fired
config Hwi_E_unsupportedMaskingOption // module-wide |
|
Error raised when an unsupported Hwi.MaskingOption used
extern const Error_Id Hwi_E_unsupportedMaskingOption;
config Hwi_LD_end // module-wide |
|
Issued just after return from Hwi function (with interrupts disabled)
config Hwi_LM_begin // module-wide |
|
Issued just prior to Hwi function invocation (with interrupts disabled)
config Hwi_NUM_INTERRUPTS // module-wide |
|
extern const UInt Hwi_NUM_INTERRUPTS;
config Hwi_core0VectorTableAddress // module-wide |
|
Determines the location of Core0's Interrupt Vector Table on a
Dual-Core device. Default is device dependent
extern const Ptr Hwi_core0VectorTableAddress;
DETAILS
On Dual-Core devices, both Cortex-R5 cores share a common reset
vector table. In order to allow the 2 cores to register their own
exception handlers, each core generates its own clone of the reset
vector table and initializes it with its own exception handler
addresses. The core specific vector tables are placed at fixed
addresses so that the exception handler functions called by the
common reset vector table known each core's vector table address
and are able to reference it once they detect which core the
application is currently running on.
The address of Core0's vector table is determined by this parameter.
Here are the default Core0 vector table addresses for all supported
Dual-Core devices:
----------------------------------------------------
| Device name | Core0's default vector table address |
----------------------------------------------------
| RM57D8xx | 0x100 |
----------------------------------------------------
NOTE
If changing Core0's vector table address, it is not necessary to
rebuild Core1's application as it does not need to know the location
of Core0's vector table.
config Hwi_core1VectorTableAddress // module-wide |
|
Determines the location of Core1's Interrupt Vector Table on a
Dual-Core device. Default is device dependent
extern const Ptr Hwi_core1VectorTableAddress;
DETAILS
On Dual-Core devices, both Cortex-R5 cores share a common reset
vector table. In order to allow the 2 cores to register their own
exception handlers, each core generates its own clone of the reset
vector table and initializes it with its own exception handler
addresses. The core specific vector tables are placed at fixed
addresses so that the exception handler functions called by the
common reset vector table known each core's vector table address
and are able to reference it once they detect which core the
application is currently running on.
Core0's vector table is always placed at 0x100 while the address of
Core1's vector table is determined by this parameter.
Here are the default Core1 vector table addresses for all supported
Dual-Core devices:
----------------------------------------------------
| Device name | Core1's default vector table address |
----------------------------------------------------
| RM57D8xx | 0x200000 |
----------------------------------------------------
NOTE
If changing Core1's vector table address, it is important to rebuild
Core0's application with the same change as Core0 owns the common
reset vector table and the common exception handler functions need
to know Core1's vector table address so they can determine the
address of the handler function they need to jump to.
config Hwi_dispatcherAutoNestingSupport // module-wide |
|
Include interrupt nesting logic in interrupt dispatcher?
extern const Bool Hwi_dispatcherAutoNestingSupport;
DETAILS
Default is true.
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 |
|
Controls whether the
dispatcher retains the interrupted thread's return address
extern const Bool Hwi_dispatcherIrpTrackingSupport;
DETAILS
This option is enabled by default.
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?
extern const Bool Hwi_dispatcherSwiSupport;
DETAILS
Default is inherited from
BIOS.swiEnabled, which is true by default.
This option provides the user with the ability to optimize
interrupt dispatcher performance when it is known that Swis
will not be posted from any of their Hwi threads.
WARNING
Setting this parameter to false will disable the logic in
the interrupt dispatcher that invokes the Swi scheduler
prior to returning from an interrupt.
With this setting, Swis MUST NOT be posted from Hwi functions!
config Hwi_dispatcherTaskSupport // module-wide |
|
Include Task scheduling logic in interrupt dispatcher?
extern const Bool Hwi_dispatcherTaskSupport;
DETAILS
Default is inherited from
BIOS.taskEnabled, which is true by default.
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.
config Hwi_errataInitEsm // module-wide |
|
Clear ESM errors for AR1xxx devices. Default is true for AR1xxx devices
extern const Bool Hwi_errataInitEsm;
DETAILS
Errata brief description:
Cortex-R4 on AR14xx devices generates a VIM RAM compare error
during startup due to a ROM code bug. This error needs to be cleared
before SYS/BIOS is started and interrupts are enabled.
config Hwi_fiqStack // module-wide |
|
FIQ stack pointer. Default = null.
(Indicates that stack is to be created using
staticPlace())
extern const Ptr Hwi_fiqStack;
config Hwi_phantomFunc // module-wide |
|
Phantom interrupt handler.
Default is set to internal phantom interrupt handler
config Hwi_resetVIM // module-wide |
|
Reset VIM hardware. Default is true for AR1xxx devices
extern const Bool Hwi_resetVIM;
DETAILS
This feature is available only on certain devices.
Hwi_clearInterrupt() // module-wide |
|
Clear a specific interrupt
Void Hwi_clearInterrupt(UInt intNum);
ARGUMENTS
intNum
interrupt number to clear
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_disableIRQ() // module-wide |
|
Disable IRQ interrupts
RETURNS
previous IRQ interrupt enable/disable state
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
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 SYS/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_enableIRQ() // module-wide |
|
Enable IRQ interrupts
ARGUMENTS
key
enable/disable state to restore
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_getCoreStackInfo() // module-wide |
|
Get Hwi stack usage Info for the specified coreId
Bool Hwi_getCoreStackInfo(
IHwi_StackInfo *
stkInfo,
Bool computeStackDepth,
UInt coreId);
ARGUMENTS
stkInfo
pointer to structure of type StackInfo
computeStackDepth
decides whether to compute stack depth
coreId
core whose stack info needs to be retrieved
RETURNS
boolean to indicate a stack overflow
DETAILS
getCoreStackInfo returns the Hwi stack usage info for the specified
coreId to its calling function by filling stack base address,
stack size and stack peak fields in the
StackInfo structure.
This function should be used only in applications built with
ti.sysbios.BIOS.smpEnabled set to true.
getCoreStackInfo accepts three arguments, a pointer to a structure
of type
StackInfo, a boolean and a coreId. If the boolean
is set to true, the function computes the stack depth and fills the
stack peak field in the StackInfo structure. If a stack overflow
is detected, the stack depth is not computed. If the boolean is
set to false, the function only checks for a stack overflow.
The isr stack is always checked for an overflow and a boolean
is returned to indicate whether an overflow occured.
Below is an example of calling getCoreStackInfo() API:
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/hal/Core.h>
#include <ti/sysbios/knl/Task.h>
...
Void idleTask()
{
UInt idx;
Hwi_StackInfo stkInfo;
Bool stackOverflow = FALSE;
// Request stack depth for each core's Hwi stack and check for
// overflow
for (idx = 0; idx < Core_numCores; idx++) {
stackOverflow = Hwi_getCoreStackInfo(&stkInfo, TRUE, idx);
// Alternately, we can omit the request for stack depth and
// request only the stack base and stack size (the check for
// stack overflow is always performed):
//
// stackOverflow = Hwi_getCoreStackInfo(&stkInfo, FALSE, idx);
if (stackOverflow) {
// isr Stack Overflow detected
}
}
}
Int main(Int argc, char* argv[])
{
...
BIOS_start();
return (0);
}
Hwi_getHandle() // module-wide |
|
Returns pointer to Hwi instance object
ARGUMENTS
intNum
interrupt number
Hwi_getStackInfo() // module-wide |
|
Get Hwi stack usage Info
Bool Hwi_getStackInfo(
IHwi_StackInfo *
stkInfo,
Bool computeStackDepth);
ARGUMENTS
stkInfo
pointer to structure of type StackInfo
computeStackDepth
decides whether to compute stack depth
RETURNS
boolean to indicate a stack overflow
DETAILS
getStackInfo returns the Hwi stack usage info to its calling
function by filling stack base address, stack size and stack
peak fields in the
StackInfo structure.
getStackInfo accepts two arguments, a pointer to a structure
of type
StackInfo and a boolean. If the boolean is set
to true, the function computes the stack depth and fills the
stack peak field in the StackInfo structure. If a stack overflow
is detected, the stack depth is not computed. If the boolean is
set to false, the function only checks for a stack overflow.
The isr stack is always checked for an overflow and a boolean
is returned to indicate whether an overflow occured.
Below is an example of calling getStackInfo() API:
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/knl/Swi.h>
#include <ti/sysbios/knl/Task.h>
Swi_Handle swi0;
volatile Bool swiStackOverflow = FALSE;
Void swi0Fxn(UArg arg1, UArg arg2)
{
Hwi_StackInfo stkInfo;
// Request stack depth
swiStackOverflow = Hwi_getStackInfo(&stkInfo, TRUE);
// Alternately, we can omit the request for stack depth and
// request only the stack base and stack size (the check for
// stack overflow is always performed):
//
// swiStackOverflow = Hwi_getStackInfo(&stkInfo, FALSE);
if (swiStackOverflow) {
// isr Stack Overflow detected
}
}
Void idleTask()
{
Swi_post(swi0);
}
Int main(Int argc, char* argv[])
{
swi0 = Swi_create(swi0Fxn, NULL, NULL);
BIOS_start();
return (0);
}
Hwi_post() // module-wide |
|
Generate an interrupt for test purposes
Void Hwi_post(UInt intNum);
ARGUMENTS
intNum
ID of interrupt to generate
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_restoreIRQ() // module-wide |
|
Restore IRQ interrupts
Void Hwi_restoreIRQ(UInt key);
ARGUMENTS
key
enable/disable state to restore
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
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
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
Instance Config Parameters |
|
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 when object is created? Default is true
Int eventId;
// Interrupt event ID (Interrupt Selection Number)
// Default setting for this Hwi module is IHwi.MaskingOption_LOWER
Int priority;
// Interrupt priority
// Interrupt type (IRQ/FIQ. Default is IRQ
} Hwi_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config Hwi_Params.arg // instance |
|
ISR function argument. Default is 0
config Hwi_Params.enableInt // instance |
|
Enable this interrupt when object is created? Default is true
config Hwi_Params.eventId // instance |
|
Interrupt event ID (Interrupt Selection Number)
DETAILS
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored.
config Hwi_Params.maskSetting // instance |
|
Default setting for this Hwi module is IHwi.MaskingOption_LOWER
config Hwi_Params.priority // instance |
|
Interrupt priority
DETAILS
The default value of -1 is used as a flag to indicate
the lowest (logical) device-specific priority value.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored.
config Hwi_Params.type // instance |
|
Interrupt type (IRQ/FIQ. Default is IRQ
Runtime Instance Creation |
|
// 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 following properties
are specified by a structure of type Hwi_Params.
- 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.
- The maskSetting element defines the dispatcherAutoNestingSupport
behavior of the interrupt.
Hwi_create returns a pointer to the created Hwi object.
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() // 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() // 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
Hwi_getIrp() // instance |
|
Get address of interrupted instruction
ARGUMENTS
handle
handle of a previously-created Hwi instance object
RETURNS
most current IRP of a Hwi
Hwi_reconfig() // instance |
|
Reconfigure a dispatched interrupt
ARGUMENTS
handle
handle of a previously-created Hwi instance object
Hwi_setFunc() // 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() // 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
hookContext
value to write to context
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 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
enum Hwi.MaskingOption |
|
Shorthand interrupt masking options
values of type Hwi.MaskingOption
const Hwi.MaskingOption_NONE;
const Hwi.MaskingOption_ALL;
const Hwi.MaskingOption_SELF;
const Hwi.MaskingOption_BITMASK;
const Hwi.MaskingOption_LOWER;
VALUES
MaskingOption_NONE
No interrupts are disabled
MaskingOption_ALL
All interrupts are disabled
MaskingOption_SELF
Only this interrupt is disabled
MaskingOption_BITMASK
User supplies interrupt enable masks
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.
C SYNOPSIS
enum Hwi.Type |
|
Interrupt type. IRQ or FIQ
values of type Hwi.Type
const Hwi.Type_IRQ;
// IRQ interrupt
const Hwi.Type_FIQ;
// FIQ interrupt
C SYNOPSIS
struct Hwi.HookSet |
|
Hwi hook set type definition
var obj = new Hwi.HookSet;
obj.registerFxn = Void(*)(Int) ...
DETAILS
The functions that make up a hookSet have certain restrictions. They
cannot call any Hwi instance functions other than Hwi_getHookContext()
and Hwi_setHookContext(). For all practical purposes, they should treat
the Hwi_Handle passed to these functions as an opaque handle.
C SYNOPSIS
struct Hwi.StackInfo |
|
Structure contains Hwi stack usage info
var obj = new Hwi.StackInfo;
obj.hwiStackPeak = SizeT ...
obj.hwiStackSize = SizeT ...
obj.hwiStackBase = Ptr ...
DETAILS
Used by getStackInfo() and viewGetStackInfo() functions
C SYNOPSIS
config Hwi.A_badChannelId // module-wide |
|
Assert raised when an invalid channelId is passed to Hwi_mapChannel()
function
msg: "A_badChannelId: ChannelId is either not re-mappable or invalid."
};
C SYNOPSIS
config Hwi.E_alreadyDefined // module-wide |
|
Error raised when Hwi is already defined
msg: "E_alreadyDefined: Hwi already defined: intr# %d"
};
C SYNOPSIS
config Hwi.E_badIntNum // module-wide |
|
Error raised if an attempt is made to create a Hwi
with an interrupt number greater than Hwi_NUM_INTERRUPTS - 1
msg: "E_badIntNum, intnum: %d is out of range"
};
C SYNOPSIS
config Hwi.E_phantomInterrupt // module-wide |
|
Error raised when a phantom interrupt occurs
msg: "E_phantomInterrupt: A phantom interrupt has occurred."
};
C SYNOPSIS
config Hwi.E_undefined // module-wide |
|
Error raised when an undefined interrupt has fired
msg: "E_undefined: Hwi undefined, intnum: %d"
};
C SYNOPSIS
config Hwi.E_unsupportedMaskingOption // module-wide |
|
Error raised when an unsupported Hwi.MaskingOption used
msg: "E_unsupportedMaskingOption: Unsupported masking option passed."
};
C SYNOPSIS
config Hwi.LD_end // module-wide |
|
Issued just after return from Hwi function (with interrupts disabled)
msg: "LD_end: hwi: 0x%x"
};
C SYNOPSIS
config Hwi.LM_begin // module-wide |
|
Issued just prior to Hwi function invocation (with interrupts disabled)
msg: "LM_begin: hwi: 0x%x, func: 0x%x, preThread: %d, intNum: %d, irp: 0x%x"
};
C SYNOPSIS
config Hwi.NUM_INTERRUPTS // module-wide |
|
Hwi.NUM_INTERRUPTS = UInt undefined;
C SYNOPSIS
config Hwi.core0VectorTableAddress // module-wide |
|
Determines the location of Core0's Interrupt Vector Table on a
Dual-Core device. Default is device dependent
Hwi.core0VectorTableAddress = Ptr undefined;
DETAILS
On Dual-Core devices, both Cortex-R5 cores share a common reset
vector table. In order to allow the 2 cores to register their own
exception handlers, each core generates its own clone of the reset
vector table and initializes it with its own exception handler
addresses. The core specific vector tables are placed at fixed
addresses so that the exception handler functions called by the
common reset vector table known each core's vector table address
and are able to reference it once they detect which core the
application is currently running on.
The address of Core0's vector table is determined by this parameter.
Here are the default Core0 vector table addresses for all supported
Dual-Core devices:
----------------------------------------------------
| Device name | Core0's default vector table address |
----------------------------------------------------
| RM57D8xx | 0x100 |
----------------------------------------------------
NOTE
If changing Core0's vector table address, it is not necessary to
rebuild Core1's application as it does not need to know the location
of Core0's vector table.
C SYNOPSIS
config Hwi.core1VectorTableAddress // module-wide |
|
Determines the location of Core1's Interrupt Vector Table on a
Dual-Core device. Default is device dependent
Hwi.core1VectorTableAddress = Ptr undefined;
DETAILS
On Dual-Core devices, both Cortex-R5 cores share a common reset
vector table. In order to allow the 2 cores to register their own
exception handlers, each core generates its own clone of the reset
vector table and initializes it with its own exception handler
addresses. The core specific vector tables are placed at fixed
addresses so that the exception handler functions called by the
common reset vector table known each core's vector table address
and are able to reference it once they detect which core the
application is currently running on.
Core0's vector table is always placed at 0x100 while the address of
Core1's vector table is determined by this parameter.
Here are the default Core1 vector table addresses for all supported
Dual-Core devices:
----------------------------------------------------
| Device name | Core1's default vector table address |
----------------------------------------------------
| RM57D8xx | 0x200000 |
----------------------------------------------------
NOTE
If changing Core1's vector table address, it is important to rebuild
Core0's application with the same change as Core0 owns the common
reset vector table and the common exception handler functions need
to know Core1's vector table address so they can determine the
address of the handler function they need to jump to.
C SYNOPSIS
config Hwi.dispatcherAutoNestingSupport // module-wide |
|
Include interrupt nesting logic in interrupt dispatcher?
Hwi.dispatcherAutoNestingSupport = Bool true;
DETAILS
Default is true.
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.
C SYNOPSIS
config Hwi.dispatcherIrpTrackingSupport // module-wide |
|
Controls whether the
dispatcher retains the interrupted thread's return address
Hwi.dispatcherIrpTrackingSupport = Bool true;
DETAILS
This option is enabled by default.
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.
C SYNOPSIS
config Hwi.dispatcherSwiSupport // module-wide |
|
Include Swi scheduling logic in interrupt dispatcher?
Hwi.dispatcherSwiSupport = Bool undefined;
DETAILS
Default is inherited from
BIOS.swiEnabled, which is true by default.
This option provides the user with the ability to optimize
interrupt dispatcher performance when it is known that Swis
will not be posted from any of their Hwi threads.
WARNING
Setting this parameter to false will disable the logic in
the interrupt dispatcher that invokes the Swi scheduler
prior to returning from an interrupt.
With this setting, Swis MUST NOT be posted from Hwi functions!
C SYNOPSIS
config Hwi.dispatcherTaskSupport // module-wide |
|
Include Task scheduling logic in interrupt dispatcher?
Hwi.dispatcherTaskSupport = Bool undefined;
DETAILS
Default is inherited from
BIOS.taskEnabled, which is true by default.
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.
C SYNOPSIS
config Hwi.errataInitEsm // module-wide |
|
Clear ESM errors for AR1xxx devices. Default is true for AR1xxx devices
Hwi.errataInitEsm = Bool false;
DETAILS
Errata brief description:
Cortex-R4 on AR14xx devices generates a VIM RAM compare error
during startup due to a ROM code bug. This error needs to be cleared
before SYS/BIOS is started and interrupts are enabled.
C SYNOPSIS
config Hwi.fiqStack // module-wide |
|
FIQ stack pointer. Default = null.
(Indicates that stack is to be created using
staticPlace())
C SYNOPSIS
config Hwi.phantomFunc // module-wide |
|
Phantom interrupt handler.
Default is set to internal phantom interrupt handler
Hwi.phantomFunc = Void(*)(Void) undefined;
C SYNOPSIS
config Hwi.resetVIM // module-wide |
|
Reset VIM hardware. Default is true for AR1xxx devices
Hwi.resetVIM = Bool false;
DETAILS
This feature is available only on certain devices.
C SYNOPSIS
metaonly config Hwi.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 Hwi.dataAbortFunc // module-wide |
|
Data abort exception handler.
Default is set to an internal exception handler
Hwi.dataAbortFunc = Void(*)(Void) undefined;
metaonly config Hwi.fiqStackSection // module-wide |
|
Memory section used for FIQ stack
Default is null
Hwi.fiqStackSection = String null;
metaonly config Hwi.fiqStackSize // module-wide |
|
FIQ stack size in MAUs.
Default is 1024 bytes
Hwi.fiqStackSize = SizeT 1024;
metaonly config Hwi.irqFunc // module-wide |
|
IRQ exception handler.
Default is set to internal IRQ dispatcher
Hwi.irqFunc = Void(*)(Void) undefined;
metaonly config Hwi.prefetchAbortFunc // module-wide |
|
Prefetch abort exception handler.
Default is set to an internal exception handler
Hwi.prefetchAbortFunc = Void(*)(Void) undefined;
metaonly config Hwi.reservedFunc // module-wide |
|
Reserved exception handler.
Default is set to an internal exception handler
Hwi.reservedFunc = Void(*)(Void) undefined;
metaonly config Hwi.resetFunc // module-wide |
|
Reset Handler. Default is c_int00
Hwi.resetFunc = Void(*)(Void) undefined;
metaonly config Hwi.swiFunc // module-wide |
|
SWI Handler. Default is internal SWI handler
Hwi.swiFunc = Void(*)(Void) undefined;
metaonly config Hwi.undefinedInstFunc // module-wide |
|
Undefined instruction exception handler.
Default is set to an internal exception handler
Hwi.undefinedInstFunc = Void(*)(Void) undefined;
metaonly Hwi.addHookSet() // module-wide |
|
addHookSet is used in a config file to add a hook set (defined
by struct HookSet)
ARGUMENTS
hook
structure of type HookSet
DETAILS
HookSet structure elements may be omitted, in which case those
elements will not exist.
metaonly Hwi.configChannelMeta() // module-wide |
|
Configure which VIM interrupt request this channel maps to and
whether this channel's interrupt is a wakeup interrupt
Hwi.configChannelMeta(UInt channelId, UInt intRequestId, Bool wakeupEnable) returns Void
ARGUMENTS
channelId
Channel number (intNum)
intRequestId
VIM Interrupt request (source) number
wakeupEnable
Enable wakeup interrupt functionality ?
DETAILS
Each VIM interrupt request (source) can be mapped to any of
the interrupt channels. Lower numbered channels in each FIQ
and IRQ have higher priority. Therefore, channel mapping
provides a mechanism for prioritizing the interrupt requests.
A channel interrupt can also be configured to be a wakeup interrupt
so it can bring the core out of low power mode (LPM).
Instance Config Parameters |
|
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 when object is created? Default is true
params.eventId = Int -1;
// Interrupt event ID (Interrupt Selection Number)
// Default setting for this Hwi module is IHwi.MaskingOption_LOWER
params.priority = Int -1;
// Interrupt priority
// Interrupt type (IRQ/FIQ. Default is IRQ
config Hwi.Params.arg // instance |
|
ISR function argument. Default is 0
var params = new Hwi.Params;
...
params.arg = UArg 0;
C SYNOPSIS
config Hwi.Params.enableInt // instance |
|
Enable this interrupt when object is created? Default is true
var params = new Hwi.Params;
...
params.enableInt = Bool true;
C SYNOPSIS
config Hwi.Params.eventId // instance |
|
Interrupt event ID (Interrupt Selection Number)
var params = new Hwi.Params;
...
params.eventId = Int -1;
DETAILS
Default is -1.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored.
C SYNOPSIS
config Hwi.Params.maskSetting // instance |
|
Default setting for this Hwi module is IHwi.MaskingOption_LOWER
var params = new Hwi.Params;
...
C SYNOPSIS
config Hwi.Params.priority // instance |
|
Interrupt priority
var params = new Hwi.Params;
...
params.priority = Int -1;
DETAILS
The default value of -1 is used as a flag to indicate
the lowest (logical) device-specific priority value.
Not all targets/devices support this instance parameter.
On those that don't, this parameter is ignored.
C SYNOPSIS
config Hwi.Params.type // instance |
|
Interrupt type (IRQ/FIQ. Default is IRQ
var params = new Hwi.Params;
...
C SYNOPSIS
Static Instance Creation |
|
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = Hwi.create(Int intNum, Void(*)(UArg) hwiFxn, params);
// Create an instance-object
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 following properties
are specified by a structure of type Hwi_Params.
- 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.
- The maskSetting element defines the dispatcherAutoNestingSupport
behavior of the interrupt.
Hwi_create returns a pointer to the created Hwi object.