arches: use new kernel APIs

Change-Id: I4b6f5264d5295ebf4278991a1f4e2141bef6602f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-11-09 11:10:21 -08:00 committed by Anas Nashif
commit 56f561e15e
7 changed files with 40 additions and 113 deletions

View file

@ -100,8 +100,7 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason,
}
PR_EXC("Current thread ID = %p\n"
"Faulting instruction address = 0x%" PRIx32 "\n",
sys_thread_self_get(),
pEsf->pc);
k_current_get(), pEsf->pc);
/*
* Now that the error has been reported, call the user implemented

View file

@ -117,8 +117,7 @@ static void _FaultThreadShow(const NANO_ESF *esf)
{
PR_EXC(" Executing thread ID (thread): %p\n"
" Faulting instruction address: 0x%" PRIx32 "\n",
sys_thread_self_get(),
esf->pc);
k_current_get(), esf->pc);
}
#if !defined(CONFIG_CPU_CORTEX_M0_M0PLUS)

View file

@ -26,13 +26,7 @@
#include <toolchain.h>
#include <sections.h>
#include <nano_private.h>
#ifdef CONFIG_PRINTK
#include <misc/printk.h>
#define PRINTK(...) printk(__VA_ARGS__)
#else
#define PRINTK(...)
#endif
/**
*
@ -54,30 +48,20 @@
*
* @return N/A
*/
void _SysFatalErrorHandler(unsigned int reason, const NANO_ESF * pEsf)
FUNC_NORETURN void _SysFatalErrorHandler(unsigned int reason,
const NANO_ESF *pEsf)
{
nano_context_type_t curCtx = sys_execution_context_type_get();
ARG_UNUSED(reason);
ARG_UNUSED(pEsf);
if ((curCtx == NANO_CTX_ISR) || _is_thread_essential()) {
PRINTK("Fatal fault in %s ! Spinning...\n",
NANO_CTX_ISR == curCtx
? "ISR"
: NANO_CTX_FIBER == curCtx ? "essential fiber"
: "essential task");
if (k_is_in_isr() || _is_thread_essential()) {
printk("Fatal fault in %s! Spinning...\n",
k_is_in_isr() ? "ISR" : "essential thread");
for (;;)
; /* spin forever */
}
if (NANO_CTX_FIBER == curCtx) {
PRINTK("Fatal fault in fiber ! Aborting fiber.\n");
fiber_abort();
return;
}
PRINTK("Fatal fault in task ! Aborting task.\n");
printk("Fatal fault in thread! Aborting.\n");
k_thread_abort(_current);
CODE_UNREACHABLE;
}