2019-07-15 13:18:36 -07: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);
|
|
|
|
|
|
|
|
void z_x86_exception(const z_arch_esf_t *esf)
|
|
|
|
{
|
2019-10-10 11:59:16 -07:00
|
|
|
LOG_ERR("** CPU Exception %ld (code %ld/0x%lx) **",
|
2019-07-15 13:18:36 -07:00
|
|
|
esf->vector, esf->code, esf->code);
|
|
|
|
|
2019-11-05 14:00:30 -08:00
|
|
|
#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);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-07-15 13:18:36 -07:00
|
|
|
z_x86_fatal_error(K_ERR_CPU_EXCEPTION, esf);
|
|
|
|
}
|