clarify use of term 'context'

The term 'context' is vague and overloaded. Its usage for 'an execution
context' is now referred as such, in both comments and some APIs' names.
When the execution context can only be a fiber or a task (i.e. not an
ISR), it is referred to as a 'thread', again in comments and everywhere
in the code.

APIs that had their names changed:

  - nano_context_id_t is now nano_thread_id_t
  - context_self_get() is now sys_thread_self_get()
  - context_type_get() is now sys_execution_context_type_get()
  - context_custom_data_set/get() are now
    sys_thread_custom_data_set/get()

The 'context' prefix namespace does not have to be reserved by the
kernel anymore.

The Context Control Structure (CCS) data structure is now the Thread
Control Structure (TCS):

  - struct ccs is now struct tcs
  - tCCS is now tTCS

Change-Id: I7526a76c5b01e7c86333078e2d2e77c9feef5364
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2015-08-20 11:04:01 -04:00 committed by Anas Nashif
commit 0dcad8331b
96 changed files with 1082 additions and 1086 deletions

View file

@ -206,30 +206,30 @@ static void start_task(struct k_task *X, /* ptr to task control block */
void (*func)(void) /* entry point for task */
)
{
unsigned int contextOptions;
unsigned int task_options;
/* Note: the field X->worksize now represents the task size in bytes */
contextOptions = 0;
_START_TASK_ARCH(X, &contextOptions);
task_options = 0;
_START_TASK_ARCH(X, &task_options);
/*
* The 'func' argument to _NewContext() represents the entry point of
* The 'func' argument to _new_thread() 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.
* the thread is a task, rather than a fiber.
*/
_NewContext((char *)X->workspace, /* pStackMem */
_new_thread((char *)X->workspace, /* pStackMem */
X->worksize, /* stackSize */
(_ContextEntry)func, /* pEntry */
(_thread_entry_t)func, /* pEntry */
(void *)0, /* parameter1 */
(void *)0, /* parameter2 */
(void *)0, /* parameter3 */
-1, /* priority */
contextOptions /* options */
task_options /* options */
);
X->fabort = NULL;
@ -249,9 +249,9 @@ static void start_task(struct k_task *X, /* ptr to task control block */
static void abort_task(struct k_task *X)
{
/* Do normal context exit cleanup */
/* Do normal thread exit cleanup */
_context_exit((tCCS *)X->workspace);
_thread_exit((struct tcs *)X->workspace);
/* Set TF_TERM and TF_STOP state flags */