2019-07-16 04:18:36 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Intel Corporation
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <ksched.h>
|
|
|
|
#include <kernel_structs.h>
|
|
|
|
#include <kernel_internal.h>
|
|
|
|
#include <logging/log.h>
|
|
|
|
LOG_MODULE_DECLARE(os);
|
|
|
|
|
2019-11-07 04:26:59 +08:00
|
|
|
void z_x86_exception(z_arch_esf_t *esf)
|
2019-07-16 04:18:36 +08:00
|
|
|
{
|
2019-11-07 04:26:59 +08:00
|
|
|
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;
|
2019-11-06 06:00:30 +08:00
|
|
|
}
|
2019-07-16 04:18:36 +08:00
|
|
|
}
|