Optimizations to _NewContext() and _NewContextInternal()

Since the address of the new context is known before _NewContext() is invoked
(due to it being passed a properly aligned stack), there is no longer any
need for _NewContext to return the pointer to the context.

Furthermore, as a direct result of the properly aligned stack, the pointer to
the new context does not need to be passed as a separate parameter since it
will always match the passed stack pointer.

Change-Id: Ie57a9c4ad17f6f13e8b3f659cd701d4f8950ea97
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
Peter Mitsis 2015-05-25 10:21:57 -04:00 committed by Anas Nashif
commit 40b5200c73
9 changed files with 24 additions and 34 deletions

View file

@ -152,8 +152,9 @@ static void nano_init(tCCS *dummyOutContext)
* (or idle task). The entry point for this context is 'main'.
*/
_nanokernel.task =
_NewContext(main_task_stack, /* pStackMem */
_nanokernel.task = (tCCS *) main_task_stack;
_NewContext(main_task_stack, /* pStackMem */
CONFIG_MAIN_STACK_SIZE, /* stackSize */
(_ContextEntry)main, /* pEntry */
(_ContextArg)0, /* parameter1 */