diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog index 18179196dd..7315cf28a4 100644 --- a/c/src/lib/libbsp/shared/ChangeLog +++ b/c/src/lib/libbsp/shared/ChangeLog @@ -1,3 +1,7 @@ +2008-01-22 Joel Sherrill + + * bootcard.c: Improve comments and clean up argc/argv order. + 2007-12-11 Joel Sherrill * bootcard.c, bsplibc.c: Eliminate copies of the Configuration Table. diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index b36e026f1d..9e4c29adab 100644 --- a/c/src/lib/libbsp/shared/bootcard.c +++ b/c/src/lib/libbsp/shared/bootcard.c @@ -16,12 +16,12 @@ * + back to here eventually * + bspclean.c: bsp_cleanup * - * This style of initialization insures that the C++ global + * This style of initialization ensures that the C++ global * constructors are executed after RTEMS is initialized. + * Thanks to Chris Johns for the idea + * to move C++ global constructors into the first task. * - * Thanks to Chris Johns for this idea. - * - * COPYRIGHT (c) 1989-2006. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -69,6 +69,15 @@ int boot_card(int argc, char **argv, char **envp) if ( envp ) envp_p = envp; + /* + * Set the program name in case some application cares. + */ + + if ((argc > 0) && argv && argv[0]) + rtems_progname = argv[0]; + else + rtems_progname = "RTEMS"; + /* * Invoke Board Support Package initialization routine written in C. */ @@ -82,15 +91,10 @@ int boot_card(int argc, char **argv, char **envp) rtems_initialize_executive_early( &Configuration ); /* - * Call c_rtems_main() and eventually let the first task or the real - * main() invoke the global constructors if there are any. + * Complete initialization of RTEMS and switch to the first task. + * Global C++ constructors will be executed in the context of that task. */ - if ((argc > 0) && argv && argv[0]) - rtems_progname = argv[0]; - else - rtems_progname = "RTEMS"; - rtems_initialize_executive_late( bsp_isr_level ); /*************************************************************** @@ -101,7 +105,7 @@ int boot_card(int argc, char **argv, char **envp) */ /* - * Perform any BSP specific shutdown actions. + * Perform any BSP specific shutdown actions which are written in C. */ bsp_cleanup();