From 67d0f4e1ebb28ca804bfdff9a041430adff40024 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 4 Oct 1999 13:43:46 +0000 Subject: Modified to setup environment pointer on all BSPs. This results in getenv/putenv working all the time without special assistance from the BSP. --- c/src/lib/libbsp/shared/bootcard.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index a78792b339..7b97df3dfc 100644 --- a/c/src/lib/libbsp/shared/bootcard.c +++ b/c/src/lib/libbsp/shared/bootcard.c @@ -44,11 +44,27 @@ rtems_interrupt_level bsp_isr_level; * Since there is a forward reference */ -int main(int argc, char **argv); +int main(int argc, char **argv, char **envp); -int boot_card(int argc, char **argv) +int boot_card(int argc, char **argv, char **envp) { - int status; + int status; + static char *argv_pointer = NULL; + static char *envp_pointer = NULL; + char **argv_p = &argv_pointer; + char **envp_p = &envp_pointer; + + /* + * Set things up so main is called with real pointers for argv and envp. + * If the BSP has passed us something useful, then pass it on. + */ + + if ( argv ) + argv_p = argv; + + if ( envp ) + envp_p = envp; + /* * Set default values for the CPU Table fields all ports must have. @@ -104,7 +120,7 @@ int boot_card(int argc, char **argv) _init(); #endif - status = main(argc, argv); + status = main( argc, argv_p, envp_p ); /* * Perform any BSP specific shutdown actions. -- cgit v1.2.3