module ti.sysbios.family.arm.exc.Exception |
|
Exception Module
The Exception module is a basic ARM exception handler.
When an exception occurs, the execution state is saved into
a buffer with a structure of type
ExcContext.
[
more ... ]
#include <ti/sysbios/family/arm/exc/Exception.h>
Functions common to all target modules |
|
|
Typedefs |
typedef struct | |
typedef Void | |
typedef enum | |
Constants |
extern const Bool | |
| |
| |
| |
| |
| |
| |
DETAILS
The Exception module is a basic ARM exception handler.
When an exception occurs, the execution state is saved into
a buffer with a structure of type
ExcContext.
By default, a formatted dump of this structure is also sent to
the console using System_printf(). This behavior can be suppressed
by setting the
enableDecode config parameter to 'false'.
An ROV view of the exception context is provided when
attached to the target board with CCS.
NOTES
No attempt is made to return from an exception as these are
generally fatal in nature.
When used, the Exception module will override the default
exception handlers provided by the current Hwi module.
enum Exception_Type |
|
typedef enum Exception_Type {
Exception_Type_Supervisor,
// Supervisor (SWI)
Exception_Type_PreAbort,
// Abort exception
Exception_Type_DataAbort,
// Abort exception
Exception_Type_UndefInst
// Undefined instruction exception
} Exception_Type;
typedef Exception_ExceptionHookFuncPtr |
|
Exception hook function type definition
struct Exception_ExcContext |
|
Exception Context - Register contents at the time of an exception
typedef struct Exception_ExcContext {
Ptr threadHandle;
Ptr threadStack;
SizeT threadStackSize;
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;
Ptr dfsr;
Ptr ifsr;
Ptr dfar;
Ptr ifar;
} Exception_ExcContext;
config Exception_E_dataAbort // module-wide |
|
Error raised when an data abort exception occurs
extern const Error_Id Exception_E_dataAbort;
config Exception_E_prefetchAbort // module-wide |
|
Error raised when an prefetch abort exception occurs
extern const Error_Id Exception_E_prefetchAbort;
config Exception_E_swi // module-wide |
|
Error raised when a SWI exception occurs
config Exception_E_undefinedInstruction // module-wide |
|
Error raised when an undefined instruction exception occurs
extern const Error_Id Exception_E_undefinedInstruction;
config Exception_enableDecode // module-wide |
|
Enable full exception decoding, default is true
extern const Bool Exception_enableDecode;
DETAILS
When enabled, the exception handler will fully
decode an exception and dump the registers to the
system console.
When set to false, only an Error is printed on the console.
In either case, the full exception context is always
saved and visible with ROV.
config Exception_excHookFunc // module-wide |
|
User Exception hook function
DETAILS
Called just after exception context has been initialized.
NOTE
If running in SMP mode and both excHookFunc and excHookFuncs[0]
are set, then excHookFunc is used on Core0.
config Exception_excHookFuncs // module-wide |
|
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
var Exception = xdc.useModule('ti.sysbios.family.arm.exc.Exception');
module-wide constants & types
module-wide config parameters
msg: "E_dataAbort: pc = 0x%08x, lr = 0x%08x."
};
msg: "E_prefetchAbort: pc = 0x%08x, lr = 0x%08x."
};
msg: "E_swi: pc = 0x%08x, lr = 0x%08x."
};
msg: "E_undefinedInstruction: pc = 0x%08x, lr = 0x%08x."
};
enum Exception.Type |
|
values of type Exception.Type
const Exception.Type_Supervisor;
// Supervisor (SWI)
const Exception.Type_PreAbort;
// Abort exception
const Exception.Type_DataAbort;
// Abort exception
const Exception.Type_UndefInst;
// Undefined instruction exception
C SYNOPSIS
struct Exception.ExcContext |
|
Exception Context - Register contents at the time of an exception
var obj = new Exception.ExcContext;
obj.threadHandle = Ptr ...
obj.threadStack = Ptr ...
obj.threadStackSize = SizeT ...
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.dfsr = Ptr ...
obj.ifsr = Ptr ...
obj.dfar = Ptr ...
obj.ifar = Ptr ...
C SYNOPSIS
config Exception.E_dataAbort // module-wide |
|
Error raised when an data abort exception occurs
msg: "E_dataAbort: pc = 0x%08x, lr = 0x%08x."
};
C SYNOPSIS
config Exception.E_prefetchAbort // module-wide |
|
Error raised when an prefetch abort exception occurs
msg: "E_prefetchAbort: pc = 0x%08x, lr = 0x%08x."
};
C SYNOPSIS
config Exception.E_swi // module-wide |
|
Error raised when a SWI exception occurs
msg: "E_swi: pc = 0x%08x, lr = 0x%08x."
};
C SYNOPSIS
config Exception.E_undefinedInstruction // module-wide |
|
Error raised when an undefined instruction exception occurs
msg: "E_undefinedInstruction: pc = 0x%08x, lr = 0x%08x."
};
C SYNOPSIS
config Exception.enableDecode // module-wide |
|
Enable full exception decoding, default is true
Exception.enableDecode = Bool true;
DETAILS
When enabled, the exception handler will fully
decode an exception and dump the registers to the
system console.
When set to false, only an Error is printed on the console.
In either case, the full exception context is always
saved and visible with ROV.
C SYNOPSIS
config Exception.excHookFunc // module-wide |
|
User Exception hook function
DETAILS
Called just after exception context has been initialized.
NOTE
If running in SMP mode and both excHookFunc and excHookFuncs[0]
are set, then excHookFunc is used on Core0.
C SYNOPSIS
config Exception.excHookFuncs // module-wide |
|
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.
metaonly config Exception.excContextBuffer // module-wide |
|
User Exception Context Buffer Address
Exception.excContextBuffer = Ptr undefined;
DETAILS
By default, when an exception occurs, an
ExcContext
structure is allocated on the exception stack and filled in
by the exception handler.
If
excContextBuffer is initialized by the user, the
ExcContext structure will be placed at that address instead.
The buffer must be large enough to contain an
ExcContext
structure.
NOTE
If running in SMP mode and both excContextBuffer and
excContextBuffers[0] are set, then excContextBuffer is used on Core0.
metaonly config Exception.excContextBuffers // module-wide |
|
Exception.excContextBuffers = Ptr[] undefined;
metaonly config Exception.excStackBuffer // module-wide |
|
User Exception Stack Buffer Address
Exception.excStackBuffer = Ptr undefined;
DETAILS
When an exception occurs, a pointer to the base address
of the stack being used by the thread causing the exception is stored
in the ExcContext buffer.
If
excStackBuffer is initialized by the user, the
entire contents of that stack will also be
copied to the address specified.
The buffer must be large enough to contain the largest task stack or ISR
stack defined in the application.
NOTE
If running in SMP mode and both excStackBuffer and
excStackBuffers[0] are set, then excStackBuffer is used on Core0.
metaonly config Exception.excStackBuffers // module-wide |
|
Exception.excStackBuffers = Ptr[] undefined;
metaonly config Exception.excStackSection // module-wide |
|
Memory section used for Exception stack.
Default is null, which results in the stack
being placed in .bss
Exception.excStackSection = String null;
DETAILS
The exception stacks on all cores are placed
in this section.
metaonly config Exception.excStackSize // module-wide |
|
Exception stack size in MAUs.
Default size is same as Hwi stack size
Exception.excStackSize = SizeT undefined;
DETAILS
If running in SMP mode, the exception stacks
on all cores are set to this size.
generated on Thu, 25 May 2017 22:10:00 GMT