x86: get oops reason code more robustly
The code did not consider privilege level stack switches. We have the original stack pointer in the NANO_ESF, just use that. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
4ae33f0b55
commit
21337019b0
1 changed files with 3 additions and 10 deletions
|
@ -229,17 +229,10 @@ FUNC_NORETURN void _arch_syscall_oops(void *ssf_ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_KERNEL_OOPS
|
#ifdef CONFIG_X86_KERNEL_OOPS
|
||||||
/* The reason code gets pushed onto the stack right before the exception is
|
FUNC_NORETURN void _do_kernel_oops(const NANO_ESF *esf)
|
||||||
* triggered, so it would be after the nano_esf data
|
|
||||||
*/
|
|
||||||
struct oops_esf {
|
|
||||||
NANO_ESF nano_esf;
|
|
||||||
unsigned int reason;
|
|
||||||
};
|
|
||||||
|
|
||||||
FUNC_NORETURN void _do_kernel_oops(const struct oops_esf *esf)
|
|
||||||
{
|
{
|
||||||
_NanoFatalErrorHandler(esf->reason, &esf->nano_esf);
|
u32_t *stack_ptr = (u32_t *)esf->esp;
|
||||||
|
_NanoFatalErrorHandler(*stack_ptr, esf);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void (*_kernel_oops_handler)(void);
|
extern void (*_kernel_oops_handler)(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue