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() {
compilations \
lte-simulators coding \
libcoding.so $dbin/libcoding.so
compilations \
lte-simulators $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
# compilations \
# lte-simulators $config_libconfig_shlib \
# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi
# Core simulators
......
......@@ -169,7 +169,7 @@ int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
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 *modeparams=NULL;
......@@ -208,10 +208,10 @@ int OoptIdx=-1;
/* oad_configmodule function */
if (cfgparam == NULL) {
tmpflags = tmpflags | CONFIG_NOOOPT;
if (strstr(argv[0],"uesoftmodem") == NULL || strstr(argv[0],"lsim") == NULL) {
cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
} else {
if ( initflags & CONFIG_ENABLECMDLINEONLY) {
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;
} else {
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
}
}
......
......@@ -107,7 +107,8 @@ extern configmodule_interface_t *cfgptr;
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 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);
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
......@@ -988,7 +988,7 @@ int main(int argc, char **argv)
if (transmission_mode>1) pa=dBm3;
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");
logInit();
set_glog_onlinelog(true);
......
......@@ -429,7 +429,7 @@ int main(int argc, char **argv) {
cpu_freq_GHz = (double)get_cpu_freq_GHz();
cpuf = 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");
logInit();
// enable these lines if you need debug info
......
......@@ -695,7 +695,7 @@ int main( int argc, char **argv )
#if defined (XFORMS)
int ret;
#endif
if ( load_configmodule(argc,argv) == NULL) {
if ( load_configmodule(argc,argv,0) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
}
......
......@@ -761,7 +761,7 @@ int main( int argc, char **argv )
#endif
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");
}
......@@ -887,7 +887,7 @@ int main( int argc, char **argv )
if (simL1flag==1) {
AssertFatal(NULL!=load_configmodule(argc,argv),
AssertFatal(NULL!=load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY),
"[SOFTMODEM] Error, configuration module init failed\n");
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