x86: up-level page fault handling

Now in common code for 32-bit and 64-bit.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-11-06 12:26:59 -08:00 committed by Anas Nashif
commit 0b27cacabd
6 changed files with 180 additions and 116 deletions

View file

@ -10,16 +10,16 @@
#include <logging/log.h>
LOG_MODULE_DECLARE(os);
void z_x86_exception(const z_arch_esf_t *esf)
void z_x86_exception(z_arch_esf_t *esf)
{
LOG_ERR("** CPU Exception %ld (code %ld/0x%lx) **",
esf->vector, esf->code, esf->code);
#ifdef CONFIG_THREAD_STACK_INFO
if (z_x86_check_stack_bounds(esf->rsp, 0, esf->cs)) {
z_x86_fatal_error(K_ERR_STACK_CHK_FAIL, esf);
switch (esf->vector) {
case IV_PAGE_FAULT:
z_x86_page_fault_handler(esf);
break;
default:
LOG_ERR("** CPU Exception %ld (code %ld/0x%lx) **",
esf->vector, esf->code, esf->code);
z_x86_fatal_error(K_ERR_CPU_EXCEPTION, esf);
CODE_UNREACHABLE;
}
#endif
z_x86_fatal_error(K_ERR_CPU_EXCEPTION, esf);
}