Move debug exception vector to vector_defaults.S
This commit is contained in:
parent
202a5db2d2
commit
58e8763874
4 changed files with 27 additions and 28 deletions
|
@ -241,6 +241,9 @@ void panicHandler(XtExcFrame *frame)
|
|||
|
||||
void xt_unhandled_exception(XtExcFrame *frame)
|
||||
{
|
||||
//Disable all interrupts, so a backtrace isn't interrupted by needless stuff
|
||||
asm volatile("wsr %0,INTENABLE\nesync\n"::"r"(x));
|
||||
|
||||
haltOtherCore();
|
||||
panicPutStr("Guru Meditation Error of type ");
|
||||
int exccause = frame->exccause;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
.global xt_highint5
|
||||
.global _xt_highint5
|
||||
.weak xt_highint5
|
||||
.set xt_highint5, _xt_highint5
|
|
@ -5,10 +5,29 @@
|
|||
#include "soc/soc.h"
|
||||
|
||||
/*
|
||||
This file contains the default handlers for the high interrupt levels. The default behavious
|
||||
is to just exit the interrupt.
|
||||
This file contains the default handlers for the high interrupt levels as well as some specialized exceptions.
|
||||
The default behaviour is to just exit the interrupt or call the panic handler on the exceptions
|
||||
*/
|
||||
|
||||
|
||||
#if XCHAL_HAVE_DEBUG
|
||||
.global xt_debugexception
|
||||
.weak xt_debugexception
|
||||
.set xt_debugexception, _xt_debugexception
|
||||
.section .iram1,"ax"
|
||||
.type _xt_debugexception,@function
|
||||
.align 4
|
||||
|
||||
_xt_debugexception:
|
||||
movi a0,PANIC_RSN_DEBUGEXCEPTION
|
||||
wsr a0,EXCCAUSE
|
||||
call0 _xt_panic /* does not return */
|
||||
rsr a0, EXCSAVE+XCHAL_DEBUGLEVEL
|
||||
rfi XCHAL_DEBUGLEVEL
|
||||
|
||||
#endif /* Debug exception */
|
||||
|
||||
|
||||
#if XCHAL_NUM_INTLEVELS >=2 && XCHAL_EXCM_LEVEL <2 && XCHAL_DEBUGLEVEL !=2
|
||||
.global xt_highint2
|
||||
.weak xt_highint2
|
||||
|
|
|
@ -471,28 +471,10 @@ Debug Exception.
|
|||
.section .DebugExceptionVector.text, "ax"
|
||||
.global _DebugExceptionVector
|
||||
.align 4
|
||||
|
||||
.global xt_debugexception
|
||||
_DebugExceptionVector:
|
||||
|
||||
#ifdef XT_SIMULATOR
|
||||
/*
|
||||
In the simulator, let the debugger (if any) handle the debug exception,
|
||||
or simply stop the simulation:
|
||||
*/
|
||||
wsr a2, EXCSAVE+XCHAL_DEBUGLEVEL /* save a2 where sim expects it */
|
||||
movi a2, SYS_gdb_enter_sktloop
|
||||
simcall /* have ISS handle debug exc. */
|
||||
#elif 0 /* change condition to 1 to use the HAL minimal debug handler */
|
||||
wsr a3, EXCSAVE+XCHAL_DEBUGLEVEL
|
||||
movi a3, xthal_debugexc_defhndlr_nw /* use default debug handler */
|
||||
jx a3
|
||||
#else
|
||||
wsr a0, EXCSAVE+XCHAL_DEBUGLEVEL /* save original a0 somewhere */
|
||||
movi a0,PANIC_RSN_DEBUGEXCEPTION
|
||||
wsr a0,EXCCAUSE
|
||||
call0 _xt_panic /* does not return */
|
||||
rfi XCHAL_DEBUGLEVEL /* make a0 point here not later */
|
||||
#endif
|
||||
wsr a0, EXCSAVE+XCHAL_DEBUGLEVEL /* preserve a0 */
|
||||
call0 xt_debugexception /* load exception handler */
|
||||
|
||||
.end literal_prefix
|
||||
|
||||
|
|
Loading…
Reference in a new issue