diff --git a/kernel/microkernel/k_task.c b/kernel/microkernel/k_task.c index 3c27576a45e..eb23d32dbd8 100644 --- a/kernel/microkernel/k_task.c +++ b/kernel/microkernel/k_task.c @@ -256,6 +256,33 @@ void abort_task(struct k_proc *X) } } +#ifndef CONFIG_ARCH_HAS_TASK_ABORT +/******************************************************************************* +* +* _TaskAbort - microkernel handler for fatal task errors +* +* To be invoked when a task aborts implicitly, either by returning from its +* entry point or due to a software or hardware fault. +* +* RETURNS: does not return +* +* \NOMANUAL +*/ + +FUNC_NORETURN void _TaskAbort(void) +{ + _task_ioctl(_k_current_task->Ident, TASK_ABORT); + + /* + * Compiler can't tell that _task_ioctl() won't return and issues + * a warning unless we explicitly tell it that control never gets this + * far. + */ + + CODE_UNREACHABLE; +} +#endif + /******************************************************************************* * * task_abort_handler_set - install an abort handler diff --git a/kernel/microkernel/server.c b/kernel/microkernel/server.c index 20dcb335777..ae4ded1966c 100644 --- a/kernel/microkernel/server.c +++ b/kernel/microkernel/server.c @@ -226,30 +226,3 @@ void *_Cget(struct nano_lifo *chan) return element; } - -#ifndef CONFIG_ARCH_HAS_TASK_ABORT -/******************************************************************************* -* -* _TaskAbort - microkernel handler for fatal task errors -* -* To be invoked when a task aborts implicitly, either by returning from its -* entry point or due to a software or hardware fault. -* -* RETURNS: does not return -* -* \NOMANUAL -*/ - -FUNC_NORETURN void _TaskAbort(void) -{ - _task_ioctl(_k_current_task->Ident, TASK_ABORT); - - /* - * Compiler can't tell that _task_ioctl() won't return and issues - * a warning unless we explicitly tell it that control never gets this - * far. - */ - - CODE_UNREACHABLE; -} -#endif