diff --git a/arch/x86/core/nanocontext.c b/arch/x86/core/nanocontext.c index 6a8c9f84602..abf36274ab4 100644 --- a/arch/x86/core/nanocontext.c +++ b/arch/x86/core/nanocontext.c @@ -365,40 +365,3 @@ void *_NewContext( return ((void *)ccs); } - - -/******************************************************************************* -* -* _NanoEssentialContextSet - Set ESSENTIAL flag for running fiber or task. -* -* This function is called by the running fiber or task if it deems itself -*essential. -* That is, it cannot terminate or handle any exceptions such as page fault. -* -* RETURNS: N/A -* -* \NOMANUAL -*/ - -void _NanoEssentialContextSet(void) -{ - _nanokernel.current->flags |= ESSENTIAL; -} - -/******************************************************************************* -* -* _NanoEssentialContextClear - Clear ESSENTIAL flag for running fiber or task. -* -* This function is called by the running fiber or task to render it -*non-essential. -* By default, upon creation, a fiber or task is non-essential. -* -* RETURNS: N/A -* -* \NOMANUAL -*/ - -void _NanoEssentialContextClear(void) -{ - _nanokernel.current->flags &= ~ESSENTIAL; -} diff --git a/include/arch/private.h b/include/arch/private.h index 1e3d8da6570..37aef1497d6 100644 --- a/include/arch/private.h +++ b/include/arch/private.h @@ -83,8 +83,8 @@ typedef void (*_ContextEntry)(_ContextArg arg1, _ContextArg arg3); /* Private API to set and clear essential fiber/task flag */ -extern void _NanoEssentialContextSet(void); -extern void _NanoEssentialContextClear(void); +extern void _context_essential_set(void); +extern void _context_essential_clear(void); /* Private API to clean up when a context is aborted */ #if defined(CONFIG_CONTEXT_MONITOR) diff --git a/kernel/nanokernel/nano_context.c b/kernel/nanokernel/nano_context.c index 51532194040..4017c3312d5 100644 --- a/kernel/nanokernel/nano_context.c +++ b/kernel/nanokernel/nano_context.c @@ -78,6 +78,38 @@ nano_context_type_t context_type_get(void) return NANO_CTX_FIBER; } +/******************************************************************************* +* +* _context_essential_set - mark context as essential to system +* +* This function tags the running fiber or task as essential to system +* option; exceptions raised by this context will be treated as a fatal +* system error. +* +* RETURNS: N/A +*/ + +void _context_essential_set(void) +{ + _nanokernel.current->flags |= ESSENTIAL; +} + +/******************************************************************************* +* +* _context_essential_clear - mark context as not essential to system +* +* This function tags the running fiber or task as not essential to system +* option; exceptions raised by this context may be recoverable. +* (This is the default tag for a context.) +* +* RETURNS: N/A +*/ + +void _context_essential_clear(void) +{ + _nanokernel.current->flags &= ~ESSENTIAL; +} + /******************************************************************************* * * _context_essential_check - is the specified context essential?