Clean up private APIs that mark context as (non)essential

1) Renames APIs to align them with conventions used by other
   general-context nanokernel APIs.

2) Relocates implementation of these APIs to the architecture-
   independent portion of the nanokernel.

Change-Id: I1aa60029aaa96697cd8fcb594bbae23ba6656661
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-05-25 10:44:36 -04:00 committed by Anas Nashif
commit d216a00adc
3 changed files with 34 additions and 39 deletions

View file

@ -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;
}

View file

@ -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)

View file

@ -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?