The Exception module is a basic C7x exception handler. It is generally
considered to be a program endpoint, since an exception usually
indicates something fatal to the system.
Function hooks are provided to the user for hooking in their own functions
at different points of an exception. The hook functions are called in the
following order:
(1) exceptionHook - called whenever an exception occurs.
(2) internalHook - called only when an internal exception or page fault
occurs.
(5) returnHook - called whenever an exception occurs.
const Exception_IERRADX |
 |
Address exception
#define Exception_IERRADX (Bits32)0x00002000
const Exception_IERRDFX |
 |
Data fetch exception
#define Exception_IERRDFX (Bits32)0x00000400
const Exception_IERREPX |
 |
Execute packet exception
#define Exception_IERREPX (Bits32)0x00000008
const Exception_IERREXX |
 |
Execution exception
#define Exception_IERREXX (Bits32)0x00001000
const Exception_IERRFPX |
 |
Fetch packet exception
#define Exception_IERRFPX (Bits32)0x00000004
const Exception_IERRIFX |
 |
Instruction fetch exception
#define Exception_IERRIFX (Bits32)0x00000002
const Exception_IERRLBX |
 |
Loop buffer exception
#define Exception_IERRLBX (Bits32)0x00000100
const Exception_IERRMMX |
 |
MMA exception
#define Exception_IERRMMX (Bits32)0x00004000
const Exception_IERRMSX |
 |
Missed stall exception
#define Exception_IERRMSX (Bits32)0x00000200
const Exception_IERROPX |
 |
Illegal opcode exception
#define Exception_IERROPX (Bits32)0x00000010
const Exception_IERRPFX |
 |
Page fault exception
#define Exception_IERRPFX (Bits32)0x00000001
const Exception_IERRPRX |
 |
Priviledge exception
#define Exception_IERRPRX (Bits32)0x00000080
const Exception_IERRRAX |
 |
Resource access exeption
#define Exception_IERRRAX (Bits32)0x00000040
const Exception_IERRRCX |
 |
Resource conflict exception
#define Exception_IERRRCX (Bits32)0x00000020
const Exception_IERRSEX |
 |
Streaming engine exception
#define Exception_IERRSEX (Bits32)0x00000800
const Exception_sizeContextBuf |
 |
#define Exception_sizeContextBuf (UInt32)0x1000
typedef Exception_FuncPtr |
 |
FuncPtr - Hook function type definition
typedef Void (*Exception_FuncPtr)(Void);
struct Exception_Status |
 |
Status - structure filled by getLastStatus()
typedef struct Exception_Status {
Bits64 nrp;
// NMI return pointer register
Bits64 ntsr;
// NMI/Exception task state register
Bits64 ierr;
// Internal Exception report register
Bits64 iear;
// Internal Exception report register
Bits64 iesr;
// Internal Exception report register
// Context structure filled by last exception
} Exception_Status;
config Exception_E_exceptionMax // module-wide |
 |
Error raised when Exception.enablePrint is true
extern const Error_Id Exception_E_exceptionMax;
config Exception_E_exceptionMin // module-wide |
 |
Error raised when Exception.enablePrint is false
extern const Error_Id Exception_E_exceptionMin;
config Exception_enablePrint // module-wide |
 |
enablePrint - Enable print of exception details and Register values
extern const Bool Exception_enablePrint;
config Exception_exceptionHook // module-wide |
 |
exceptionHook - Function hook called by handler
This is called anytime an exception occurs
config Exception_internalHook // module-wide |
 |
internalHook - Function hook called by internalHandler
Function is only called when an internal exception has occurred
config Exception_returnHook // module-wide |
 |
returnHook - Function hook called at the end of Exception_dispatch
config Exception_useInternalBuffer // module-wide |
 |
If true, the exception context is saved to an internal buffer.
If false, the exception context is saved to the bottom of the isr stack
and no memory for the internal buffer is allocated
extern const Bool Exception_useInternalBuffer;
Exception_clearLastStatus() // module-wide |
 |
clearLastStatus - Clears internal Status structure
Void Exception_clearLastStatus();
Exception_getLastStatus() // module-wide |
 |
getLastStatus - Fills passed status structure with the Status
fields that were recorded by the last invocation of
dispatch(), handler() and internalHandler().
The 'excContext' is valid only in the scope of sub-handler
"Hook" functions
Exception_setReturnPtr() // module-wide |
 |
setReturnPtr - Configures dispatch() to "return" (branch) to the
passed ptr
Module-Wide Built-Ins |
 |
// Get this module's unique id
Bool Exception_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Exception_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 Exception_Module_getMask();
// Returns the diagnostics mask for this module
Void Exception_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
const Exception.IERRADX |
 |
Address exception
const Exception.IERRADX = 0x00002000;
C SYNOPSIS
const Exception.IERRDFX |
 |
Data fetch exception
const Exception.IERRDFX = 0x00000400;
C SYNOPSIS
const Exception.IERREPX |
 |
Execute packet exception
const Exception.IERREPX = 0x00000008;
C SYNOPSIS
const Exception.IERREXX |
 |
Execution exception
const Exception.IERREXX = 0x00001000;
C SYNOPSIS
const Exception.IERRFPX |
 |
Fetch packet exception
const Exception.IERRFPX = 0x00000004;
C SYNOPSIS
const Exception.IERRIFX |
 |
Instruction fetch exception
const Exception.IERRIFX = 0x00000002;
C SYNOPSIS
const Exception.IERRLBX |
 |
Loop buffer exception
const Exception.IERRLBX = 0x00000100;
C SYNOPSIS
const Exception.IERRMMX |
 |
MMA exception
const Exception.IERRMMX = 0x00004000;
C SYNOPSIS
const Exception.IERRMSX |
 |
Missed stall exception
const Exception.IERRMSX = 0x00000200;
C SYNOPSIS
const Exception.IERROPX |
 |
Illegal opcode exception
const Exception.IERROPX = 0x00000010;
C SYNOPSIS
const Exception.IERRPFX |
 |
Page fault exception
const Exception.IERRPFX = 0x00000001;
C SYNOPSIS
const Exception.IERRPRX |
 |
Priviledge exception
const Exception.IERRPRX = 0x00000080;
C SYNOPSIS
const Exception.IERRRAX |
 |
Resource access exeption
const Exception.IERRRAX = 0x00000040;
C SYNOPSIS
const Exception.IERRRCX |
 |
Resource conflict exception
const Exception.IERRRCX = 0x00000020;
C SYNOPSIS
const Exception.IERRSEX |
 |
Streaming engine exception
const Exception.IERRSEX = 0x00000800;
C SYNOPSIS
const Exception.sizeContextBuf |
 |
const Exception.sizeContextBuf = 0x1000;
C SYNOPSIS
struct Exception.Status |
 |
Status - structure filled by getLastStatus()
var obj = new Exception.Status;
obj.nrp = Bits64 ...
// NMI return pointer register
obj.ntsr = Bits64 ...
// NMI/Exception task state register
obj.ierr = Bits64 ...
// Internal Exception report register
obj.iear = Bits64 ...
// Internal Exception report register
obj.iesr = Bits64 ...
// Internal Exception report register
// Context structure filled by last exception
C SYNOPSIS
config Exception.E_exceptionMax // module-wide |
 |
Error raised when Exception.enablePrint is true
msg: "E_exceptionMax: pc = 0x%08x, sp = 0x%08x."
};
C SYNOPSIS
config Exception.E_exceptionMin // module-wide |
 |
Error raised when Exception.enablePrint is false
msg: "E_exceptionMin: pc = 0x%08x, sp = 0x%08x.\nTo see more exception detail, use ROV or set 'ti.sysbios.family.c64p.Exception.enablePrint = true;'"
};
C SYNOPSIS
config Exception.enablePrint // module-wide |
 |
enablePrint - Enable print of exception details and Register values
Exception.enablePrint = Bool true;
C SYNOPSIS
config Exception.exceptionHook // module-wide |
 |
exceptionHook - Function hook called by handler
This is called anytime an exception occurs
Exception.exceptionHook = Void(*)(Void) null;
C SYNOPSIS
config Exception.internalHook // module-wide |
 |
internalHook - Function hook called by internalHandler
Function is only called when an internal exception has occurred
Exception.internalHook = Void(*)(Void) null;
C SYNOPSIS
config Exception.returnHook // module-wide |
 |
returnHook - Function hook called at the end of Exception_dispatch
Exception.returnHook = Void(*)(Void) null;
C SYNOPSIS
config Exception.useInternalBuffer // module-wide |
 |
If true, the exception context is saved to an internal buffer.
If false, the exception context is saved to the bottom of the isr stack
and no memory for the internal buffer is allocated
Exception.useInternalBuffer = Bool false;
C SYNOPSIS
metaonly config Exception.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.