From 2801be129a2bb5887a7a5bc0864c6410dbcd8ecf Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Tue, 14 Apr 2015 14:46:26 -0400 Subject: [PATCH] Eliminate _nano_start() The helper function _nano_start() is no longer required (due to the recent relocation of boot banner and kernel build timestamp code), so the kernel's initialization code calls _nano_fiber_swap() directly. Change-Id: I06b9f473715afbfbdd4105b0def3445f1b2e3583 Signed-off-by: Allan Stephens --- include/nanokernel/arc/v2/init.h | 2 +- include/nanokernel/arm/CortexM/init.h | 2 +- include/nanokernel/x86/arch.h | 2 +- kernel/common/bsp/init.c | 5 ++--- kernel/nanokernel/core/nanofiber.c | 28 --------------------------- kernel/nanokernel/core/nanoinit.c | 5 ++--- 6 files changed, 7 insertions(+), 37 deletions(-) diff --git a/include/nanokernel/arc/v2/init.h b/include/nanokernel/arc/v2/init.h index c5d8ff35c45..0d18e0326e0 100644 --- a/include/nanokernel/arc/v2/init.h +++ b/include/nanokernel/arc/v2/init.h @@ -40,7 +40,7 @@ #ifndef _ASMLANGUAGE extern void _nano_init(nano_context_id_t, int argc, char *argv[], char *envp[]); -extern void _nano_start(void); +extern void _nano_fiber_swap(void); #endif #endif /* _ARCH_ARC_V2_INIT_H_ */ diff --git a/include/nanokernel/arm/CortexM/init.h b/include/nanokernel/arm/CortexM/init.h index b9b7bf7abac..c97bd46423a 100644 --- a/include/nanokernel/arm/CortexM/init.h +++ b/include/nanokernel/arm/CortexM/init.h @@ -40,7 +40,7 @@ ARM-specific nanokernel initialization interface. Included by ARM/arch.h. #ifndef _ASMLANGUAGE extern void _nano_init(nano_context_id_t, int argc, char *argv[], char *envp[]); -extern void _nano_start(void); +extern void _nano_fiber_swap(void); #endif #endif /* _ARCH_ARM_CORTEXM_INIT_H_ */ diff --git a/include/nanokernel/x86/arch.h b/include/nanokernel/x86/arch.h index 11e8ada79b5..63beffcfa3c 100644 --- a/include/nanokernel/x86/arch.h +++ b/include/nanokernel/x86/arch.h @@ -594,7 +594,7 @@ typedef void (*NANO_EOI_GET_FUNC) (void *); extern void _nano_init (nano_context_id_t dummyOutContext, int argc, char *argv[], char *envp[]); -extern void _nano_start (void); +extern void _nano_fiber_swap (void); extern unsigned int find_first_set (unsigned int op); diff --git a/kernel/common/bsp/init.c b/kernel/common/bsp/init.c index cb202888872..45298997d54 100644 --- a/kernel/common/bsp/init.c +++ b/kernel/common/bsp/init.c @@ -168,10 +168,9 @@ FUNC_NORETURN void _Cstart(void) PRINT_BOOT_BANNER(); - /* context switch into the background context (entry function is main()) - */ + /* context switch into background context (entry function is main()) */ - _nano_start(); + _nano_fiber_swap(); /* * Compiler can't tell that the above routines won't return and issues diff --git a/kernel/nanokernel/core/nanofiber.c b/kernel/nanokernel/core/nanofiber.c index 1647b2a54b5..0b1099574cd 100644 --- a/kernel/nanokernel/core/nanofiber.c +++ b/kernel/nanokernel/core/nanofiber.c @@ -298,31 +298,3 @@ FUNC_NORETURN void fiber_abort(void) _nano_fiber_swap(); } #endif - -/******************************************************************************* -* -* _nano_start - start the nanokernel -* -* This routine is invoked as the last step of a BSP's _Cstart() implementation -* to start the nanokernel. The _nano_init() function is called early during -* the execution of _Cstart() to setup the various nanokernel data structures, -* but it's not until _nano_start() is invoked that a context switch into the -* "main" task is performed. -* -* This routine should only be called from a BSP's _Cstart() implementation -* -* RETURNS: This function never returns -*/ - -/* - * Print the boot banner if enabled - */ -#ifdef CONFIG_BOOT_BANNER -void _nano_start(void) -{ - _nano_fiber_swap(); -} - -#else -FUNC_ALIAS(_nano_fiber_swap, _nano_start, void); -#endif diff --git a/kernel/nanokernel/core/nanoinit.c b/kernel/nanokernel/core/nanoinit.c index cc07167ef97..66e145470a4 100644 --- a/kernel/nanokernel/core/nanoinit.c +++ b/kernel/nanokernel/core/nanoinit.c @@ -85,8 +85,7 @@ extern void main(int argc, char *argv[], char *envp[]); * initialization sequence: * * crt0.s -> _Cstart() -> _nano_init() -* -> _nano_start() -> _Swap() (context switch into -*"main") +* -> _nano_fiber_swap() * * main () -> kernel_init () -> task_fiber_start(... K_swapper ...) * @@ -96,7 +95,7 @@ extern void main(int argc, char *argv[], char *envp[]); * the provided tCCS, however _NanoKernel.fiber is set to * NULL. * -* Thus the subsequent invocation of _Swap() depicted above will result +* Thus the subsequent invocation of _nano_fiber_swap() depicted above results * in a context switch into the main() routine. The will * be used as the context save area for the swap. Typically, * is a temp area on the current stack (as setup by crt0.s).