diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-04 13:43:46 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-04 13:43:46 +0000 |
commit | 67d0f4e1ebb28ca804bfdff9a041430adff40024 (patch) | |
tree | b29ea17506924f8c600e004c5fcd0f2f548ef8cd /c/src/lib/libbsp/shared/bootcard.c | |
parent | Setup environment pointer for getenv/putenv. Patch from Eric Norum (diff) | |
download | rtems-67d0f4e1ebb28ca804bfdff9a041430adff40024.tar.bz2 |
Modified to setup environment pointer on all BSPs. This results
in getenv/putenv working all the time without special assistance
from the BSP.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/shared/bootcard.c | 24 |
1 files changed, 20 insertions, 4 deletions
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. |