Eliminate nanokernel/task sub-directory

Relocates start_task() so that it appears in the main microkernel
directory, alongside its complementary routine abort_task();
this corrects a long-standing anomaly in which this microkernel-
specific routine appeared in the nanokernel portion of the tree.

With this move, the start_task.c file and its parent nanokernel/task
sub-directory no longer serve any purpose and are removed. (Note that
no changes are required for ARC architecture support, which does not
support microkernel capabilities and doesn't use this sub-directory.)

Change-Id: I973e1c32c9a8ddcacdc08159069ae7cdfea0f107
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-05-04 12:10:53 -04:00 committed by Anas Nashif
commit 3c8fb4ac7a
4 changed files with 49 additions and 98 deletions

View file

@ -40,7 +40,7 @@
#include <minik.h>
#include <nanok.h>
#include <ktask.h>
#include <start_task_arch.h>
/*******************************************************************************
@ -181,6 +181,54 @@ void set_state_bit(
#endif
}
/*******************************************************************************
*
* start_task - initialize and start a task
*
* RETURNS: N/A
*/
void start_task(struct k_proc *X, /* ptr to task control block */
void (*func)(void) /* entry point for task */
)
{
unsigned int contextOptions;
void *pNewContext;
/* Note: the field X->worksize now represents the task size in bytes */
#ifdef CONFIG_INIT_STACKS
k_memset(X->workspace, 0xaa, X->worksize);
#endif
contextOptions = 0;
_START_TASK_ARCH(X, &contextOptions);
/*
* The 'func' argument to _NewContext() represents the entry point of
* the
* kernel task. The 'parameter1', 'parameter2', & 'parameter3'
* arguments
* are not applicable to such tasks. A 'priority' of -1 indicates that
* the context is a task, rather than a fiber.
*/
pNewContext = (tCCS *)_NewContext((char *)X->workspace, /* pStackMem */
X->worksize, /* stackSize */
(_ContextEntry)func, /* pEntry */
(void *)0, /* parameter1 */
(void *)0, /* parameter2 */
(void *)0, /* parameter3 */
-1, /* priority */
contextOptions /* options */
);
X->workspace = (char *)pNewContext;
X->fabort = NULL;
reset_state_bit(X, TF_STOP | TF_TERM);
}
/*******************************************************************************
*
* abort_task - abort a task