Commit d151ce6f authored by frtabu's avatar frtabu

Add a parameter to load_configmodule API to allow an exec to specify that it...

Add a parameter to load_configmodule API to allow an exec to specify that it may be run with only  command line options
parent df603054
...@@ -651,9 +651,9 @@ function main() { ...@@ -651,9 +651,9 @@ function main() {
compilations \ compilations \
lte-simulators coding \ lte-simulators coding \
libcoding.so $dbin/libcoding.so libcoding.so $dbin/libcoding.so
compilations \ # compilations \
lte-simulators $config_libconfig_shlib \ # lte-simulators $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so # lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi fi
# Core simulators # Core simulators
......
...@@ -169,7 +169,7 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) ...@@ -169,7 +169,7 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
return numdefvals; return numdefvals;
} }
configmodule_interface_t *load_configmodule(int argc, char **argv) configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags)
{ {
char *cfgparam=NULL; char *cfgparam=NULL;
char *modeparams=NULL; char *modeparams=NULL;
...@@ -208,10 +208,10 @@ int OoptIdx=-1; ...@@ -208,10 +208,10 @@ int OoptIdx=-1;
/* oad_configmodule function */ /* oad_configmodule function */
if (cfgparam == NULL) { if (cfgparam == NULL) {
tmpflags = tmpflags | CONFIG_NOOOPT; tmpflags = tmpflags | CONFIG_NOOOPT;
if (strstr(argv[0],"uesoftmodem") == NULL || strstr(argv[0],"lsim") == NULL) { if ( initflags & CONFIG_ENABLECMDLINEONLY) {
cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
} else {
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ; cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;
} else {
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
} }
} }
......
...@@ -107,7 +107,8 @@ extern configmodule_interface_t *cfgptr; ...@@ -107,7 +107,8 @@ extern configmodule_interface_t *cfgptr;
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); } #define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
#define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); } #define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); }
extern configmodule_interface_t *load_configmodule(int argc, char **argv); #define CONFIG_ENABLECMDLINEONLY (1<<1)
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
extern void end_configmodule(void); extern void end_configmodule(void);
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */ #endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
...@@ -988,7 +988,7 @@ int main(int argc, char **argv) ...@@ -988,7 +988,7 @@ int main(int argc, char **argv)
if (transmission_mode>1) pa=dBm3; if (transmission_mode>1) pa=dBm3;
printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa); printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa);
AssertFatal(load_configmodule(argc,argv) != NULL, AssertFatal(load_configmodule(argc,argv, CONFIG_ENABLECMDLINEONLY) != NULL,
"cannot load configuration module, exiting\n"); "cannot load configuration module, exiting\n");
logInit(); logInit();
set_glog_onlinelog(true); set_glog_onlinelog(true);
......
...@@ -429,7 +429,7 @@ int main(int argc, char **argv) { ...@@ -429,7 +429,7 @@ int main(int argc, char **argv) {
cpu_freq_GHz = (double)get_cpu_freq_GHz(); cpu_freq_GHz = (double)get_cpu_freq_GHz();
cpuf = cpu_freq_GHz; cpuf = cpu_freq_GHz;
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz); printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
AssertFatal(load_configmodule(argc,argv) != NULL, AssertFatal(load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) != NULL,
"cannot load configuration module, exiting\n"); "cannot load configuration module, exiting\n");
logInit(); logInit();
// enable these lines if you need debug info // enable these lines if you need debug info
......
...@@ -695,7 +695,7 @@ int main( int argc, char **argv ) ...@@ -695,7 +695,7 @@ int main( int argc, char **argv )
#if defined (XFORMS) #if defined (XFORMS)
int ret; int ret;
#endif #endif
if ( load_configmodule(argc,argv) == NULL) { if ( load_configmodule(argc,argv,0) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
} }
......
...@@ -761,7 +761,7 @@ int main( int argc, char **argv ) ...@@ -761,7 +761,7 @@ int main( int argc, char **argv )
#endif #endif
start_background_system(); start_background_system();
if ( load_configmodule(argc,argv) == NULL) { if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
} }
...@@ -887,7 +887,7 @@ int main( int argc, char **argv ) ...@@ -887,7 +887,7 @@ int main( int argc, char **argv )
if (simL1flag==1) { if (simL1flag==1) {
AssertFatal(NULL!=load_configmodule(argc,argv), AssertFatal(NULL!=load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY),
"[SOFTMODEM] Error, configuration module init failed\n"); "[SOFTMODEM] Error, configuration module init failed\n");
RCConfig_sim(); RCConfig_sim();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment