[U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied

Cedric VINCENT
2005-07-06T09:52:10Z

> Feel free to submit a patch.

OK, maybe the next week.

> But what would happen in your case of a Machine Check? What do you
> suggest to recover from that?

When this spurious "Machine Check Exception" occured, the MSR didn't
contain any known causes. Maybe the function "MachineCheckException"
(from cpu/ppc4xx/traps.c) may be modified with something like this :
---------
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
if (debugger_exception_handler && (*debugger_exception_handler)(regs))
return;
#endif

+ #if defined(CONFIG_USE_XMD)
+ if( SPURIOUS_MCE == (regs->msr & 0x000F0000) )
+ return;
+ #endif

printf("Machine check in kernel mode.\n");
printf("Caused by (from msr): ");
printf("regs %p ",regs);
switch( regs->msr & 0x000F0000) {
---------
where CONFIG_USE_XMD is a macro (to use with care !) defined by user
when he uses XMD (during debugging stage) and SPURIOUS_MCE is the MSR
unknown cause.

This (ugly) stuff makes sense to enable exception after relocation. I
didn't test this, since I disable Machine Check Exception when
debugging my Virtex Board. Maybe it will not work (if this spurious
exception occured more than once). I will try to test next week.

Regards,
Cedric VINCENT.