module ti.sysbios.family.arm.a8.intcps.Hwi

Hardware Interrupt Support Module

This Hwi module provides ARM family-specific implementations of the APIs defined in IHwi. [ more ... ]
C synopsis target-domain sourced in ti/sysbios/family/arm/a8/intcps/Hwi.xdc
#include <ti/sysbios/family/arm/a8/intcps/Hwi.h>
Functions
Void
Void
Void
UInt 
UInt 
Bits32 
Bits32 
Hwi_disableMIR1// (Bits32 mask);
Bits32 
Hwi_disableMIR2// (Bits32 mask);
Bits32 
Hwi_disableMIR3// (Bits32 mask);
UInt 
UInt 
Bits32 
Bits32 
Hwi_enableMIR1// (Bits32 mask);
Bits32 
Hwi_enableMIR2// (Bits32 mask);
Bits32 
Hwi_enableMIR3// (Bits32 mask);
Void
Void 
Void 
Void 
Bits32 
Bits32 
Hwi_restoreMIR1// (Bits32 mask);
Bits32 
Hwi_restoreMIR2// (Bits32 mask);
Bits32 
Hwi_restoreMIR3// (Bits32 mask);
Void 
Hwi_setPriority// Set an interrupt's priority(UInt intNum, UInt priority);
Void 
Functions common to all IHwi modules
Void 
macro UInt 
UInt 
macro UInt 
UInt 
Ptr 
Bool 
macro Void 
Void 
Void 
Void 
Void 
Functions common to all target instances
Functions common to all target modules
Defines
#define
Typedefs
typedef struct
typedef Void 
typedef Hwi_Object *
typedef struct
typedef struct
typedef UArg 
typedef enum
typedef struct
typedef struct
typedef struct
typedef struct
typedef enum
typedef Void 
Constants
extern const Bool 
extern const Bool 
extern const Bool 
extern const Bool 
extern const Ptr 
extern const Error_Id 
extern const Error_Id 
extern const Error_Id 
extern const Error_Id 
extern const Ptr 
extern const Log_Event 
extern const Log_Event 
extern const Bits32 
extern const Bits32 
extern const Bits32 
extern const Bits32 
 
DETAILS
This Hwi module provides ARM family-specific implementations of the APIs defined in IHwi.
Additional ARM device-specific APIs are also provided.
NOTE
In this Hwi module implementation, the instance config parameter value MaskingOption_LOWER is equivalent to MaskingOption_SELF. Statically configuring a Hwi object's Params.maskSetting to MaskingOption_LOWER will result in the generation of a benign build warning. Dynamic usages of MaskingOption_LOWER will be silently converted to MaskingOption_SELF.
 
const Hwi_NUM_INTERRUPTS

intcps supports 128 interrupts

C synopsis target-domain
#define Hwi_NUM_INTERRUPTS (Int)128
 
 
enum Hwi_MaskingOption

Shorthand interrupt masking options

C synopsis target-domain
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

C synopsis target-domain
typedef enum Hwi_Type {
    Hwi_Type_IRQ,
    // IRQ interrupt
    Hwi_Type_FIQ
    // FIQ interrupt
} Hwi_Type;
 
 
typedef Hwi_FuncPtr

Hwi create function type definition

C synopsis target-domain
typedef Void (*Hwi_FuncPtr)(UArg);
 
 
typedef Hwi_Irp

Interrupt Return Pointer

C synopsis target-domain
typedef UArg Hwi_Irp;
 
DETAILS
This is the address of the interrupted instruction.
 
typedef Hwi_VectorFuncPtr

Hwi vector function type definition

C synopsis target-domain
typedef Void (*Hwi_VectorFuncPtr)(Void);
 
 
struct Hwi_ExcContext

Exception Context - Register contents at the time of an exception

C synopsis target-domain
typedef struct Hwi_ExcContext {
    BIOS_ThreadType threadType;
    Ptr threadHandle;
    Ptr threadStack;
    Ptr r0;
    Ptr r1;
    Ptr r2;
    Ptr r3;
    Ptr r4;
    Ptr r5;
    Ptr r6;
    Ptr r7;
    Ptr r8;
    Ptr r9;
    Ptr r10;
    Ptr r11;
    Ptr r12;
    Ptr sp;
    Ptr lr;
    Ptr pc;
    Ptr psr;
} Hwi_ExcContext;
 
 
struct Hwi_HookSet

Hwi hook set type definition

C synopsis target-domain
typedef struct Hwi_HookSet {
    Void (*registerFxn)(Int);
    Void (*createFxn)(IHwi_Handle,Error_Block*);
    Void (*beginFxn)(IHwi_Handle);
    Void (*endFxn)(IHwi_Handle);
    Void (*deleteFxn)(IHwi_Handle);
} 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_Intc

Interrupt Controller. Symbol "Hwi_intc" is physical device

C synopsis target-domain
typedef struct Hwi_Intc {
    UInt32 REVISION;
    // 0x00 Config Register
    UInt32 hole0[3];
    // 0x04-0x0C
    UInt32 SYSCONFIG;
    // 0x10 Config Register
    UInt32 SYSSTATUS;
    // 0x14 Status Register
    UInt32 hole1[10];
    // 0x18-0x3c
    UInt32 SIR_IRQ;
    // 0x40 Source IRQ Register
    UInt32 SIR_FIQ;
    // 0x44 Source FIQ Register
    UInt32 CONTROL;
    // 0x48 Control Register
    UInt32 PROTECTION;
    // 0x4C Protection Register
    UInt32 IDLE;
    // 0x50 Idle Register
    UInt32 hole2[3];
    // 0x54-0x5C
    UInt32 IRQ_PRIORITY;
    // 0x60 IRQ Priority Register
    UInt32 FIQ_PRIORITY;
    // 0x64 IRQ Priority Register
    UInt32 THRESHOLD;
    // 0x68 Threshold Register
    UInt32 hole3[5];
    // 0x6C-0x7C
    UInt32 ITR0;
    // 0x80 Interrupt Input Register
    UInt32 MIR0;
    // 0x84 Mask Interrupt Register
    UInt32 MIR_CLEAR0;
    // 0x88 MIR Clear Register
    UInt32 MIR_SET0;
    // 0x8C MIR Set Register
    UInt32 ISR_SET0;
    // 0x90 Interrupt Set Register
    UInt32 ISR_CLEAR0;
    // 0x94 Interrupt Clear Register
    UInt32 PENDING_IRQ0;
    // 0x98 Pending IRQ Register
    UInt32 PENDING_FIQ0;
    // 0x9C Pending FIQ Register
    UInt32 ITR1;
    // 0xA0 Interrupt Input Register
    UInt32 MIR1;
    // 0xA4 Mask Interrupt Register
    UInt32 MIR_CLEAR1;
    // 0xA8 MIR Clear Register
    UInt32 MIR_SET1;
    // 0xAC MIR Set Register
    UInt32 ISR_SET1;
    // 0xB0 Interrupt Set Register
    UInt32 ISR_CLEAR1;
    // 0xB4 Interrupt Clear Register
    UInt32 PENDING_IRQ1;
    // 0xB8 Pending IRQ Register
    UInt32 PENDING_FIQ1;
    // 0xBC Pending FIQ Register
    UInt32 ITR2;
    // 0xC0 Interrupt Input Register
    UInt32 MIR2;
    // 0xC4 Mask Interrupt Register
    UInt32 MIR_CLEAR2;
    // 0xC8 MIR Clear Register
    UInt32 MIR_SET2;
    // 0xCC MIR Set Register
    UInt32 ISR_SET2;
    // 0xD0 Interrupt Set Register
    UInt32 ISR_CLEAR2;
    // 0xD4 Interrupt Clear Register
    UInt32 PENDING_IRQ2;
    // 0xD8 Pending IRQ Register
    UInt32 PENDING_FIQ2;
    // 0xDC Pending FIQ Register
    UInt32 ITR3;
    // 0xE0 Interrupt Input Register
    UInt32 MIR3;
    // 0xE4 Mask Interrupt Register
    UInt32 MIR_CLEAR3;
    // 0xE8 MIR Clear Register
    UInt32 MIR_SET3;
    // 0xEC MIR Set Register
    UInt32 ISR_SET3;
    // 0xF0 Interrupt Set Register
    UInt32 ISR_CLEAR3;
    // 0xF4 Interrupt Clear Register
    UInt32 PENDING_IRQ3;
    // 0xF8 Pending IRQ Register
    UInt32 PENDING_FIQ3;
    // 0xFC Pending FIQ Register
    UInt32 ILR[128];
    // 0x100 thru 0x2FC
} Hwi_Intc;
 
 
struct Hwi_StackInfo

Structure contains Hwi stack usage info

C synopsis target-domain
typedef struct Hwi_StackInfo {
    SizeT hwiStackPeak;
    SizeT hwiStackSize;
    Ptr hwiStackBase;
} Hwi_StackInfo;
 
DETAILS
Used by getStackInfo() and viewGetStackInfo() functions
 
config Hwi_E_alreadyDefined  // module-wide

Error raised when an attempt is made to create a Hwi that has already been created

C synopsis target-domain
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 NUM_INTERRUPTS - 1

C synopsis target-domain
extern const Error_Id Hwi_E_badIntNum;
 
 
config Hwi_E_excMin  // module-wide

Error raised when an exception occurs

C synopsis target-domain
extern const Error_Id Hwi_E_excMin;
 
 
config Hwi_E_undefined  // module-wide

Error raised when an undefined interrupt has fired

C synopsis target-domain
extern const Error_Id Hwi_E_undefined;
 
 
config Hwi_LD_end  // module-wide

Issued just after return from Hwi function (with interrupts disabled)

C synopsis target-domain
extern const Log_Event Hwi_LD_end;
 
 
config Hwi_LM_begin  // module-wide

Issued just prior to Hwi function invocation (with interrupts disabled)

C synopsis target-domain
extern const Log_Event Hwi_LM_begin;
 
 
config Hwi_dispatcherAutoNestingSupport  // module-wide

Include interrupt nesting logic in interrupt dispatcher?

C synopsis target-domain
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

C synopsis target-domain
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?

C synopsis target-domain
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.
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?

C synopsis target-domain
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_excStack  // module-wide

Exception stack pointer. Default = null. (Indicates that stack is to be created internally)

C synopsis target-domain
extern const Ptr Hwi_excStack;
 
 
config Hwi_fiqStack  // module-wide

FIQ stack pointer. Default = null. (Indicates that stack is to be created internally)

C synopsis target-domain
extern const Ptr Hwi_fiqStack;
 
 
config Hwi_mir0Mask  // module-wide

Initial MIR0 Interrupt Mask. Default is 0xffffffff

C synopsis target-domain
extern const Bits32 Hwi_mir0Mask;
 
 
config Hwi_mir1Mask  // module-wide

Initial MIR1 Interrupt Mask. Default is 0xffffffff

C synopsis target-domain
extern const Bits32 Hwi_mir1Mask;
 
 
config Hwi_mir2Mask  // module-wide

Initial MIR2 Interrupt Mask. Default is 0xffffffff

C synopsis target-domain
extern const Bits32 Hwi_mir2Mask;
 
 
config Hwi_mir3Mask  // module-wide

Initial MIR3 Interrupt Mask. Default is 0xffffffff

C synopsis target-domain
extern const Bits32 Hwi_mir3Mask;
 
 
Hwi_clearInterrupt()  // module-wide

Clear a specific interrupt

C synopsis target-domain
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

C synopsis target-domain
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_disableFIQ()  // module-wide

Disable FIQ interrupts

C synopsis target-domain
UInt Hwi_disableFIQ();
 
RETURNS
previous FIQ interrupt enable/disable state
 
Hwi_disableIRQ()  // module-wide

Disable IRQ interrupts

C synopsis target-domain
UInt Hwi_disableIRQ();
 
RETURNS
previous IRQ interrupt enable/disable state
 
Hwi_disableInterrupt()  // module-wide

Disable a specific interrupt

C synopsis target-domain
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_disableMIR0()  // module-wide

Disable specific interrupts

C synopsis target-domain
Bits32 Hwi_disableMIR0(Bits32 mask);
 
ARGUMENTS
mask — bitmask of interrupts to disable
RETURNS
previous MIR0 settings bitmask
DETAILS
Disables specific interrupts by setting the bits specified by mask in the Mask Interrupts Register (MIR).
 
Hwi_disableMIR1()  // module-wide
C synopsis target-domain
Bits32 Hwi_disableMIR1(Bits32 mask);
 
 
Hwi_disableMIR2()  // module-wide
C synopsis target-domain
Bits32 Hwi_disableMIR2(Bits32 mask);
 
 
Hwi_disableMIR3()  // module-wide
C synopsis target-domain
Bits32 Hwi_disableMIR3(Bits32 mask);
 
 
Hwi_enable()  // module-wide

Globally enable interrupts

C synopsis target-domain
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 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_enableFIQ()  // module-wide

Enable FIQ interrupts

C synopsis target-domain
UInt Hwi_enableFIQ();
 
RETURNS
previous FIQ interrupt enable/disable state
 
Hwi_enableIRQ()  // module-wide

Enable IRQ interrupts

C synopsis target-domain
UInt Hwi_enableIRQ();
 
ARGUMENTS
key — enable/disable state to restore
 
Hwi_enableInterrupt()  // module-wide

Enable a specific interrupt

C synopsis target-domain
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_enableMIR0()  // module-wide

Enable specific interrupts

C synopsis target-domain
Bits32 Hwi_enableMIR0(Bits32 mask);
 
ARGUMENTS
mask — bitmask of interrupts to enable
RETURNS
previous MIR settings bitmask
DETAILS
Enables specific interrupts by clearing the bits specified by mask in the Mask Interrupts Register (MIR).
 
Hwi_enableMIR1()  // module-wide
C synopsis target-domain
Bits32 Hwi_enableMIR1(Bits32 mask);
 
 
Hwi_enableMIR2()  // module-wide
C synopsis target-domain
Bits32 Hwi_enableMIR2(Bits32 mask);
 
 
Hwi_enableMIR3()  // module-wide
C synopsis target-domain
Bits32 Hwi_enableMIR3(Bits32 mask);
 
 
Hwi_getHandle()  // module-wide

Returns Hwi_Handle associated with intNum

C synopsis target-domain
Hwi_Handle Hwi_getHandle(UInt intNum);
 
ARGUMENTS
intNum — interrupt number
 
Hwi_getStackInfo()  // module-wide

Get Hwi stack usage Info

C synopsis target-domain
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_restore()  // module-wide

Globally restore interrupts

C synopsis target-domain
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_restoreFIQ()  // module-wide

Restore FIQ interrupts

C synopsis target-domain
Void Hwi_restoreFIQ(UInt key);
 
ARGUMENTS
key — enable/disable state to restore
 
Hwi_restoreIRQ()  // module-wide

Restore IRQ interrupts

C synopsis target-domain
Void Hwi_restoreIRQ(UInt key);
 
ARGUMENTS
key — enable/disable state to restore
 
Hwi_restoreInterrupt()  // module-wide

Restore a specific interrupt's enabled/disabled state

C synopsis target-domain
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_restoreMIR0()  // module-wide

Restore maskable interrupts to the state they were in when either disableMIR0() or enableMIR0() was called

C synopsis target-domain
Bits32 Hwi_restoreMIR0(Bits32 mask);
 
ARGUMENTS
mask — bitmask of interrupts to restore
RETURNS
previous MIR0 settings bitmask
DETAILS
Simply writes mask to the MIR register.
 
Hwi_restoreMIR1()  // module-wide
C synopsis target-domain
Bits32 Hwi_restoreMIR1(Bits32 mask);
 
 
Hwi_restoreMIR2()  // module-wide
C synopsis target-domain
Bits32 Hwi_restoreMIR2(Bits32 mask);
 
 
Hwi_restoreMIR3()  // module-wide
C synopsis target-domain
Bits32 Hwi_restoreMIR3(Bits32 mask);
 
 
Hwi_setPriority()  // module-wide

Set an interrupt's priority

C synopsis target-domain
Void Hwi_setPriority(UInt intNum, UInt priority);
 
ARGUMENTS
intNum — ID of interrupt
priority — priority
DETAILS
Not an instance function so that it can be used with non-dispatched interrupts.
 
Hwi_setType()  // module-wide

Set an interrupt's type (FIQ/IRQ)

C synopsis target-domain
Void Hwi_setType(UInt intNum, Hwi_Type type);
 
ARGUMENTS
intNum — ID of interrupt
type — type = FIQ/IRQ
DETAILS
Not an instance function so that it can be used with non-dispatched interrupts.
 
Hwi_startup()  // module-wide

Initially enable interrupts

C synopsis target-domain
Void Hwi_startup();
 
DETAILS
Called within BIOS_start
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId Hwi_Module_id();
// Get this module's unique id
 
Bool Hwi_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle Hwi_Module_heap();
// 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

C synopsis target-domain
typedef struct Hwi_Object Hwi_Object;
// Opaque internal representation of an instance object
 
typedef Hwi_Object *Hwi_Handle;
// Client reference to an instance object
 
typedef struct Hwi_Struct Hwi_Struct;
// Opaque client structure large enough to hold an instance object
 
Hwi_Handle Hwi_handle(Hwi_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
Hwi_Struct *Hwi_struct(Hwi_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct Hwi_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // 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)
    IHwi_MaskingOption maskSetting;
    // The interrupt controller is designed for priority based interrupts
    Int priority;
    // Interrupt priority
    Hwi_Type type;
    // Interrupt type (IRQ/FIQ). Default is IRQ
} Hwi_Params;
 
Void Hwi_Params_init(Hwi_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
 
config Hwi_arg  // instance

ISR function argument. Default is 0

C synopsis target-domain
struct Hwi_Params {
      ...
    UArg arg;
 
 
config Hwi_enableInt  // instance

Enable this interrupt when object is created? Default is true

C synopsis target-domain
struct Hwi_Params {
      ...
    Bool enableInt;
 
 
config Hwi_eventId  // instance

Interrupt event ID (Interrupt Selection Number)

C synopsis target-domain
struct Hwi_Params {
      ...
    Int eventId;
 
DETAILS
Default is -1. Not all targets/devices support this instance parameter. On those that don't, this parameter is ignored.
 
config Hwi_maskSetting  // instance

The interrupt controller is designed for priority based interrupts

C synopsis target-domain
struct Hwi_Params {
      ...
    IHwi_MaskingOption maskSetting;
 
 
config Hwi_priority  // instance

Interrupt priority

C synopsis target-domain
struct Hwi_Params {
      ...
    Int priority;
 
DETAILS
Default is -1. Not all targets/devices support this instance parameter. On those that don't, this parameter is ignored.
 
config Hwi_type  // instance

Interrupt type (IRQ/FIQ). Default is IRQ

C synopsis target-domain
struct Hwi_Params {
      ...
    Hwi_Type type;
 
Instance Creation

C synopsis target-domain
Hwi_Handle Hwi_create(Int intNum, IHwi_FuncPtr hwiFxn, const Hwi_Params *params, Error_Block *eb);
// Allocate and initialize a new instance object and return its handle
 
Void Hwi_construct(Hwi_Struct *structP, Int intNum, IHwi_FuncPtr hwiFxn, const Hwi_Params *params, Error_Block *eb);
// 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

C synopsis target-domain
Void Hwi_delete(Hwi_Handle *handleP);
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
 
Void Hwi_destruct(Hwi_Struct *structP);
// Finalize the instance object inside the provided structure
 
Hwi_getFunc()  // instance

Get Hwi function and arg

C synopsis target-domain
IHwi_FuncPtr Hwi_getFunc(Hwi_Handle handle, UArg *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

C synopsis target-domain
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

C synopsis target-domain
IHwi_Irp Hwi_getIrp(Hwi_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created Hwi instance object
RETURNS
most current IRP of a Hwi
 
Hwi_reconfig()  // instance

Reconfigure a dispatched interrupt

C synopsis target-domain
Void Hwi_reconfig(Hwi_Handle handle, Hwi_FuncPtr fxn, Hwi_Params *params);
 
ARGUMENTS
handle — handle of a previously-created Hwi instance object
 
Hwi_setFunc()  // instance

Overwrite Hwi function and arg

C synopsis target-domain
Void Hwi_setFunc(Hwi_Handle handle, IHwi_FuncPtr fxn, UArg 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

C synopsis target-domain
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

C synopsis target-domain
IHwi_Handle Hwi_Handle_upCast(Hwi_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
Hwi_Handle Hwi_Handle_downCast(IHwi_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int Hwi_Object_count();
// The number of statically-created instance objects
 
Hwi_Handle Hwi_Object_get(Hwi_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
Hwi_Handle Hwi_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
Hwi_Handle Hwi_Object_next(Hwi_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle Hwi_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *Hwi_Handle_label(Hwi_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String Hwi_Handle_name(Hwi_Handle handle);
// The name of this instance object
 
XDCscript usage meta-domain sourced in ti/sysbios/family/arm/a8/intcps/Hwi.xdc
var Hwi = xdc.useModule('ti.sysbios.family.arm.a8.intcps.Hwi');
module-wide constants & types
 
        const Hwi.MaskingOption_NONE;
        const Hwi.MaskingOption_ALL;
        const Hwi.MaskingOption_SELF;
        const Hwi.MaskingOption_BITMASK;
        const Hwi.MaskingOption_LOWER;
 
        const Hwi.Type_IRQ// IRQ interrupt;
        const Hwi.Type_FIQ// FIQ interrupt;
 
        obj.threadType = BIOS.ThreadType  ...
        obj.threadHandle = Ptr  ...
        obj.threadStack = Ptr  ...
        obj.r0 = Ptr  ...
        obj.r1 = Ptr  ...
        obj.r2 = Ptr  ...
        obj.r3 = Ptr  ...
        obj.r4 = Ptr  ...
        obj.r5 = Ptr  ...
        obj.r6 = Ptr  ...
        obj.r7 = Ptr  ...
        obj.r8 = Ptr  ...
        obj.r9 = Ptr  ...
        obj.r10 = Ptr  ...
        obj.r11 = Ptr  ...
        obj.r12 = Ptr  ...
        obj.sp = Ptr  ...
        obj.lr = Ptr  ...
        obj.pc = Ptr  ...
        obj.psr = Ptr  ...
 
        obj.registerFxn = Void(*)(Int)  ...
        obj.createFxn = Void(*)(IHwi.Handle,Error.Block*)  ...
        obj.beginFxn = Void(*)(IHwi.Handle)  ...
        obj.endFxn = Void(*)(IHwi.Handle)  ...
        obj.deleteFxn = Void(*)(IHwi.Handle)  ...
 
        obj.REVISION// 0x00 Config Register = UInt32  ...
        obj.hole0// 0x04-0x0C = UInt32[3]  ...
        obj.SYSCONFIG// 0x10 Config Register = UInt32  ...
        obj.SYSSTATUS// 0x14 Status Register = UInt32  ...
        obj.hole1// 0x18-0x3c = UInt32[10]  ...
        obj.SIR_IRQ// 0x40 Source IRQ Register = UInt32  ...
        obj.SIR_FIQ// 0x44 Source FIQ Register = UInt32  ...
        obj.CONTROL// 0x48 Control Register = UInt32  ...
        obj.PROTECTION// 0x4C Protection Register = UInt32  ...
        obj.IDLE// 0x50 Idle Register = UInt32  ...
        obj.hole2// 0x54-0x5C = UInt32[3]  ...
        obj.IRQ_PRIORITY// 0x60 IRQ Priority Register = UInt32  ...
        obj.FIQ_PRIORITY// 0x64 IRQ Priority Register = UInt32  ...
        obj.THRESHOLD// 0x68 Threshold Register = UInt32  ...
        obj.hole3// 0x6C-0x7C = UInt32[5]  ...
        obj.ITR0// 0x80 Interrupt Input Register = UInt32  ...
        obj.MIR0// 0x84 Mask Interrupt Register = UInt32  ...
        obj.MIR_CLEAR0// 0x88 MIR Clear Register = UInt32  ...
        obj.MIR_SET0// 0x8C MIR Set Register = UInt32  ...
        obj.ISR_SET0// 0x90 Interrupt Set Register = UInt32  ...
        obj.ISR_CLEAR0// 0x94 Interrupt Clear Register = UInt32  ...
        obj.PENDING_IRQ0// 0x98 Pending IRQ Register = UInt32  ...
        obj.PENDING_FIQ0// 0x9C Pending FIQ Register = UInt32  ...
        obj.ITR1// 0xA0 Interrupt Input Register = UInt32  ...
        obj.MIR1// 0xA4 Mask Interrupt Register = UInt32  ...
        obj.MIR_CLEAR1// 0xA8 MIR Clear Register = UInt32  ...
        obj.MIR_SET1// 0xAC MIR Set Register = UInt32  ...
        obj.ISR_SET1// 0xB0 Interrupt Set Register = UInt32  ...
        obj.ISR_CLEAR1// 0xB4 Interrupt Clear Register = UInt32  ...
        obj.PENDING_IRQ1// 0xB8 Pending IRQ Register = UInt32  ...
        obj.PENDING_FIQ1// 0xBC Pending FIQ Register = UInt32  ...
        obj.ITR2// 0xC0 Interrupt Input Register = UInt32  ...
        obj.MIR2// 0xC4 Mask Interrupt Register = UInt32  ...
        obj.MIR_CLEAR2// 0xC8 MIR Clear Register = UInt32  ...
        obj.MIR_SET2// 0xCC MIR Set Register = UInt32  ...
        obj.ISR_SET2// 0xD0 Interrupt Set Register = UInt32  ...
        obj.ISR_CLEAR2// 0xD4 Interrupt Clear Register = UInt32  ...
        obj.PENDING_IRQ2// 0xD8 Pending IRQ Register = UInt32  ...
        obj.PENDING_FIQ2// 0xDC Pending FIQ Register = UInt32  ...
        obj.ITR3// 0xE0 Interrupt Input Register = UInt32  ...
        obj.MIR3// 0xE4 Mask Interrupt Register = UInt32  ...
        obj.MIR_CLEAR3// 0xE8 MIR Clear Register = UInt32  ...
        obj.MIR_SET3// 0xEC MIR Set Register = UInt32  ...
        obj.ISR_SET3// 0xF0 Interrupt Set Register = UInt32  ...
        obj.ISR_CLEAR3// 0xF4 Interrupt Clear Register = UInt32  ...
        obj.PENDING_IRQ3// 0xF8 Pending IRQ Register = UInt32  ...
        obj.PENDING_FIQ3// 0xFC Pending FIQ Register = UInt32  ...
        obj.ILR// 0x100 thru 0x2FC = UInt32[128]  ...
 
        obj.hwiStackPeak = SizeT  ...
        obj.hwiStackSize = SizeT  ...
        obj.hwiStackBase = Ptr  ...
module-wide config parameters
        msg: "E_alreadyDefined: Hwi already defined, intnum: %d"
    };
        msg: "E_badIntNum, intnum: %d is out of range"
    };
        msg: "E_exception: pc = 0x%08x, lr = 0x%08x."
    };
        msg: "E_undefined: Hwi undefined, intnum: %d"
    };
        mask: Diags.USER2,
        msg: "LD_end: hwi: 0x%x"
    };
        mask: Diags.USER1 | Diags.USER2,
        msg: "LM_begin: hwi: 0x%x, func: 0x%x, preThread: %d, intNum: %d, irp: 0x%x"
    };
 
    Hwi.resetFunc// Reset Handler. Default is c_int00 = Void(*)(Void) undefined;
module-wide functions
per-instance config parameters
    var params = new Hwi.Params// Instance config-params object;
        params.arg// ISR function argument. Default is 0 = UArg 0;
        params.priority// Interrupt priority = Int 63;
per-instance creation
    var inst = Hwi.create// Create an instance-object(Int intNum, Void(*)(UArg) hwiFxn, params);
 
 
const Hwi.NUM_INTERRUPTS

intcps supports 128 interrupts

XDCscript usage meta-domain
const Hwi.NUM_INTERRUPTS = 128;
 
C SYNOPSIS
 
enum Hwi.MaskingOption

Shorthand interrupt masking options

XDCscript usage meta-domain
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

XDCscript usage meta-domain
values of type Hwi.Type
    const Hwi.Type_IRQ;
    // IRQ interrupt
    const Hwi.Type_FIQ;
    // FIQ interrupt
 
C SYNOPSIS
 
struct Hwi.ExcContext

Exception Context - Register contents at the time of an exception

XDCscript usage meta-domain
var obj = new Hwi.ExcContext;
 
    obj.threadType = BIOS.ThreadType  ...
    obj.threadHandle = Ptr  ...
    obj.threadStack = Ptr  ...
    obj.r0 = Ptr  ...
    obj.r1 = Ptr  ...
    obj.r2 = Ptr  ...
    obj.r3 = Ptr  ...
    obj.r4 = Ptr  ...
    obj.r5 = Ptr  ...
    obj.r6 = Ptr  ...
    obj.r7 = Ptr  ...
    obj.r8 = Ptr  ...
    obj.r9 = Ptr  ...
    obj.r10 = Ptr  ...
    obj.r11 = Ptr  ...
    obj.r12 = Ptr  ...
    obj.sp = Ptr  ...
    obj.lr = Ptr  ...
    obj.pc = Ptr  ...
    obj.psr = Ptr  ...
 
C SYNOPSIS
 
struct Hwi.HookSet

Hwi hook set type definition

XDCscript usage meta-domain
var obj = new Hwi.HookSet;
 
    obj.registerFxn = Void(*)(Int)  ...
    obj.createFxn = Void(*)(IHwi.Handle,Error.Block*)  ...
    obj.beginFxn = Void(*)(IHwi.Handle)  ...
    obj.endFxn = Void(*)(IHwi.Handle)  ...
    obj.deleteFxn = Void(*)(IHwi.Handle)  ...
 
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.Intc

Interrupt Controller. Symbol "Hwi_intc" is physical device

XDCscript usage meta-domain
var obj = new Hwi.Intc;
 
    obj.REVISION = UInt32  ...
    // 0x00 Config Register
    obj.hole0 = UInt32[3]  ...
    // 0x04-0x0C
    obj.SYSCONFIG = UInt32  ...
    // 0x10 Config Register
    obj.SYSSTATUS = UInt32  ...
    // 0x14 Status Register
    obj.hole1 = UInt32[10]  ...
    // 0x18-0x3c
    obj.SIR_IRQ = UInt32  ...
    // 0x40 Source IRQ Register
    obj.SIR_FIQ = UInt32  ...
    // 0x44 Source FIQ Register
    obj.CONTROL = UInt32  ...
    // 0x48 Control Register
    obj.PROTECTION = UInt32  ...
    // 0x4C Protection Register
    obj.IDLE = UInt32  ...
    // 0x50 Idle Register
    obj.hole2 = UInt32[3]  ...
    // 0x54-0x5C
    obj.IRQ_PRIORITY = UInt32  ...
    // 0x60 IRQ Priority Register
    obj.FIQ_PRIORITY = UInt32  ...
    // 0x64 IRQ Priority Register
    obj.THRESHOLD = UInt32  ...
    // 0x68 Threshold Register
    obj.hole3 = UInt32[5]  ...
    // 0x6C-0x7C
    obj.ITR0 = UInt32  ...
    // 0x80 Interrupt Input Register
    obj.MIR0 = UInt32  ...
    // 0x84 Mask Interrupt Register
    obj.MIR_CLEAR0 = UInt32  ...
    // 0x88 MIR Clear Register
    obj.MIR_SET0 = UInt32  ...
    // 0x8C MIR Set Register
    obj.ISR_SET0 = UInt32  ...
    // 0x90 Interrupt Set Register
    obj.ISR_CLEAR0 = UInt32  ...
    // 0x94 Interrupt Clear Register
    obj.PENDING_IRQ0 = UInt32  ...
    // 0x98 Pending IRQ Register
    obj.PENDING_FIQ0 = UInt32  ...
    // 0x9C Pending FIQ Register
    obj.ITR1 = UInt32  ...
    // 0xA0 Interrupt Input Register
    obj.MIR1 = UInt32  ...
    // 0xA4 Mask Interrupt Register
    obj.MIR_CLEAR1 = UInt32  ...
    // 0xA8 MIR Clear Register
    obj.MIR_SET1 = UInt32  ...
    // 0xAC MIR Set Register
    obj.ISR_SET1 = UInt32  ...
    // 0xB0 Interrupt Set Register
    obj.ISR_CLEAR1 = UInt32  ...
    // 0xB4 Interrupt Clear Register
    obj.PENDING_IRQ1 = UInt32  ...
    // 0xB8 Pending IRQ Register
    obj.PENDING_FIQ1 = UInt32  ...
    // 0xBC Pending FIQ Register
    obj.ITR2 = UInt32  ...
    // 0xC0 Interrupt Input Register
    obj.MIR2 = UInt32  ...
    // 0xC4 Mask Interrupt Register
    obj.MIR_CLEAR2 = UInt32  ...
    // 0xC8 MIR Clear Register
    obj.MIR_SET2 = UInt32  ...
    // 0xCC MIR Set Register
    obj.ISR_SET2 = UInt32  ...
    // 0xD0 Interrupt Set Register
    obj.ISR_CLEAR2 = UInt32  ...
    // 0xD4 Interrupt Clear Register
    obj.PENDING_IRQ2 = UInt32  ...
    // 0xD8 Pending IRQ Register
    obj.PENDING_FIQ2 = UInt32  ...
    // 0xDC Pending FIQ Register
    obj.ITR3 = UInt32  ...
    // 0xE0 Interrupt Input Register
    obj.MIR3 = UInt32  ...
    // 0xE4 Mask Interrupt Register
    obj.MIR_CLEAR3 = UInt32  ...
    // 0xE8 MIR Clear Register
    obj.MIR_SET3 = UInt32  ...
    // 0xEC MIR Set Register
    obj.ISR_SET3 = UInt32  ...
    // 0xF0 Interrupt Set Register
    obj.ISR_CLEAR3 = UInt32  ...
    // 0xF4 Interrupt Clear Register
    obj.PENDING_IRQ3 = UInt32  ...
    // 0xF8 Pending IRQ Register
    obj.PENDING_FIQ3 = UInt32  ...
    // 0xFC Pending FIQ Register
    obj.ILR = UInt32[128]  ...
    // 0x100 thru 0x2FC
 
C SYNOPSIS
 
struct Hwi.StackInfo

Structure contains Hwi stack usage info

XDCscript usage meta-domain
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.E_alreadyDefined  // module-wide

Error raised when an attempt is made to create a Hwi that has already been created

XDCscript usage meta-domain
Hwi.E_alreadyDefined = Error.Desc {
    msg: "E_alreadyDefined: Hwi already defined, intnum: %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 NUM_INTERRUPTS - 1

XDCscript usage meta-domain
Hwi.E_badIntNum = Error.Desc {
    msg: "E_badIntNum, intnum: %d is out of range"
};
 
C SYNOPSIS
 
config Hwi.E_excMin  // module-wide

Error raised when an exception occurs

XDCscript usage meta-domain
Hwi.E_excMin = Error.Desc {
    msg: "E_exception: pc = 0x%08x, lr = 0x%08x."
};
 
C SYNOPSIS
 
config Hwi.E_undefined  // module-wide

Error raised when an undefined interrupt has fired

XDCscript usage meta-domain
Hwi.E_undefined = Error.Desc {
    msg: "E_undefined: Hwi undefined, intnum: %d"
};
 
C SYNOPSIS
 
config Hwi.LD_end  // module-wide

Issued just after return from Hwi function (with interrupts disabled)

XDCscript usage meta-domain
Hwi.LD_end = Log.EventDesc {
    mask: Diags.USER2,
    msg: "LD_end: hwi: 0x%x"
};
 
C SYNOPSIS
 
config Hwi.LM_begin  // module-wide

Issued just prior to Hwi function invocation (with interrupts disabled)

XDCscript usage meta-domain
Hwi.LM_begin = Log.EventDesc {
    mask: Diags.USER1 | Diags.USER2,
    msg: "LM_begin: hwi: 0x%x, func: 0x%x, preThread: %d, intNum: %d, irp: 0x%x"
};
 
C SYNOPSIS
 
config Hwi.dispatcherAutoNestingSupport  // module-wide

Include interrupt nesting logic in interrupt dispatcher?

XDCscript usage meta-domain
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

XDCscript usage meta-domain
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?

XDCscript usage meta-domain
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.
Setting this parameter to false will disable the logic in the interrupt dispatcher that invokes the Swi scheduler prior to returning from an interrupt.
C SYNOPSIS
 
config Hwi.dispatcherTaskSupport  // module-wide

Include Task scheduling logic in interrupt dispatcher?

XDCscript usage meta-domain
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.excStack  // module-wide

Exception stack pointer. Default = null. (Indicates that stack is to be created internally)

XDCscript usage meta-domain
Hwi.excStack = Ptr null;
 
C SYNOPSIS
 
config Hwi.fiqStack  // module-wide

FIQ stack pointer. Default = null. (Indicates that stack is to be created internally)

XDCscript usage meta-domain
Hwi.fiqStack = Ptr null;
 
C SYNOPSIS
 
config Hwi.mir0Mask  // module-wide

Initial MIR0 Interrupt Mask. Default is 0xffffffff

XDCscript usage meta-domain
Hwi.mir0Mask = Bits32 0xffffffff;
 
C SYNOPSIS
 
config Hwi.mir1Mask  // module-wide

Initial MIR1 Interrupt Mask. Default is 0xffffffff

XDCscript usage meta-domain
Hwi.mir1Mask = Bits32 0xffffffff;
 
C SYNOPSIS
 
config Hwi.mir2Mask  // module-wide

Initial MIR2 Interrupt Mask. Default is 0xffffffff

XDCscript usage meta-domain
Hwi.mir2Mask = Bits32 0xffffffff;
 
C SYNOPSIS
 
config Hwi.mir3Mask  // module-wide

Initial MIR3 Interrupt Mask. Default is 0xffffffff

XDCscript usage meta-domain
Hwi.mir3Mask = Bits32 0xffffffff;
 
C SYNOPSIS
 
metaonly config Hwi.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
Hwi.common$ = Types.Common$ undefined;
 
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 an internal exception handler

XDCscript usage meta-domain
Hwi.dataAbortFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.enableException  // module-wide

Enable full exception decoding

XDCscript usage meta-domain
Hwi.enableException = Bool false;
 
DETAILS
When this is enabled, the exception handler will fully decode an exception and dump the registers to the system console.
 
metaonly config Hwi.excStackSection  // module-wide

Memory section used for Exception stack Default is null

XDCscript usage meta-domain
Hwi.excStackSection = String null;
 
 
metaonly config Hwi.excStackSize  // module-wide

Exception stack size in MAUs. Default is 1024 bytes

XDCscript usage meta-domain
Hwi.excStackSize = SizeT 1024;
 
 
metaonly config Hwi.fiqFunc  // module-wide

FIQ interrupt handler. Default is internal FIQ dispatcher

XDCscript usage meta-domain
Hwi.fiqFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.fiqStackSection  // module-wide

Memory section used for FIQ stack Default is null

XDCscript usage meta-domain
Hwi.fiqStackSection = String null;
 
 
metaonly config Hwi.fiqStackSize  // module-wide

FIQ stack size in MAUs. Default is 1024 bytes

XDCscript usage meta-domain
Hwi.fiqStackSize = SizeT 1024;
 
 
metaonly config Hwi.irqFunc  // module-wide

IRQ interrupt handler. Default is internal IRQ dispatcher

XDCscript usage meta-domain
Hwi.irqFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.prefetchAbortFunc  // module-wide

Prefetch abort exception handler. Default is an internal exception handler

XDCscript usage meta-domain
Hwi.prefetchAbortFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.reservedFunc  // module-wide

Reserved exception handler. Default is an internal exception handler

XDCscript usage meta-domain
Hwi.reservedFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.resetFunc  // module-wide

Reset Handler. Default is c_int00

XDCscript usage meta-domain
Hwi.resetFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.swiFunc  // module-wide

SWI Handler. Default is internal SWI handler. Default is an internal exception handler

XDCscript usage meta-domain
Hwi.swiFunc = Void(*)(Void) undefined;
 
 
metaonly config Hwi.undefinedInstFunc  // module-wide

Undefined instruction exception handler. Default is an internal exception handler

XDCscript usage meta-domain
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)

XDCscript usage meta-domain
Hwi.addHookSet(IHwi.HookSet hook) returns Void
 
ARGUMENTS
hook — structure of type HookSet
DETAILS
HookSet structure elements may be omitted, in which case those elements will not exist.
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 when object is created? Default is true
    params.eventId = Int -1;
    // Interrupt event ID (Interrupt Selection Number)
    params.maskSetting = IHwi.MaskingOption IHwi.MaskingOption_LOWER;
    // The interrupt controller is designed for priority based interrupts
    params.priority = Int 63;
    // Interrupt priority
    params.type = Hwi.Type Hwi.Type_IRQ;
    // Interrupt type (IRQ/FIQ). Default is IRQ
 
config Hwi.arg  // instance

ISR function argument. Default is 0

XDCscript usage meta-domain
var params = new Hwi.Params;
  ...
params.arg = UArg 0;
 
C SYNOPSIS
 
config Hwi.enableInt  // instance

Enable this interrupt when object is created? Default is true

XDCscript usage meta-domain
var params = new Hwi.Params;
  ...
params.enableInt = Bool true;
 
C SYNOPSIS
 
config Hwi.eventId  // instance

Interrupt event ID (Interrupt Selection Number)

XDCscript usage meta-domain
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.maskSetting  // instance

The interrupt controller is designed for priority based interrupts

XDCscript usage meta-domain
var params = new Hwi.Params;
  ...
 
C SYNOPSIS
 
config Hwi.priority  // instance

Interrupt priority

XDCscript usage meta-domain
var params = new Hwi.Params;
  ...
params.priority = Int 63;
 
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.type  // instance

Interrupt type (IRQ/FIQ). Default is IRQ

XDCscript usage meta-domain
var params = new Hwi.Params;
  ...
params.type = Hwi.Type Hwi.Type_IRQ;
 
C SYNOPSIS
Instance Creation

XDCscript usage meta-domain
var params = new Hwi.Params;
// 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.
generated on Thu, 01 Mar 2012 16:57:32 GMT