X-Git-Url: http://rtime.felk.cvut.cz/gitweb/rtems-devel.git/blobdiff_plain/50055cb9df0aa8f780dfbdb8e87801ca09cdcabb..HEAD:/rtems-omk-template/appdl/init.c diff --git a/rtems-omk-template/appdl/init.c b/rtems-omk-template/appdl/init.c index 6f27e83..206e06b 100644 --- a/rtems-omk-template/appdl/init.c +++ b/rtems-omk-template/appdl/init.c @@ -15,16 +15,24 @@ #define CONFIGURE_INIT #include +#include "appl_config.h" #include "system.h" #include "app_def.h" -#include "appl_config.h" #include #include #include #include #include #include +#include + +#define USE_RTEMS_TARFS_LOAD + +#ifdef USE_RTEMS_TARFS_LOAD +#include +#else /*USE_RTEMS_TARFS_LOAD*/ #include +#endif /*USE_RTEMS_TARFS_LOAD*/ #ifdef CONFIG_OC_APP_APPDL_NET #include @@ -47,7 +55,9 @@ #define CONFIGURE_SHELL_COMMANDS_ALL #define CONFIGURE_SHELL_COMMANDS_ALL_NETWORKING #define CONFIGURE_SHELL_MOUNT_MSDOS +#ifdef CONFIG_OC_APP_APPDL_NET #define CONFIGURE_SHELL_MOUNT_NFS +#endif #include @@ -106,7 +116,9 @@ int testcmd_forshell(int argc, char **argv) typedef int (*call_t)(int argc, char* argv[]); -int dlopen_forshell(int argc, char **argv) +volatile int continue_execution; + +int dlrun_forshell(int argc, char **argv) { void * handle; int unresolved; @@ -162,6 +174,9 @@ rtems_task Init( ) { rtems_status_code status; + #ifdef USE_RTEMS_TARFS_LOAD + int res; + #endif /*USE_RTEMS_TARFS_LOAD*/ printf( "\n\nRTEMS v " BUILD_VERSION_STRING(__RTEMS_MAJOR__ ,__RTEMS_MINOR__ ,__RTEMS_REVISION__) @@ -178,13 +193,17 @@ rtems_task Init( #endif /*CONFIG_OC_APP_APPDL_NET*/ - printf( "Starting application " SW_VER_ID " v " + printf( "Starting application " APP_VER_ID " v " BUILD_VERSION_STRING(SW_VER_MAJOR,SW_VER_MINOR,SW_VER_PATCH) "\n" ); + #ifdef USE_RTEMS_TARFS_LOAD + res = rtems_tarfs_load("/", (void*)(&TARFILE_START), (long)&TARFILE_SIZE); + printf("rtems_tarfs_load returned %d\n", res); + #else /*USE_RTEMS_TARFS_LOAD*/ status = Untar_FromMemory((unsigned char *)(&TARFILE_START), (long)&TARFILE_SIZE); - printf("Untar_FromMemory returned %s\n",rtems_status_text(status)); + #endif /*USE_RTEMS_TARFS_LOAD*/ Task_1_name = rtems_build_name( 'T', 'S', 'K', '1' ); @@ -208,9 +227,25 @@ rtems_task Init( "test command for shell", testcmd_forshell); - rtems_shell_add_cmd("dlopen", "app", - "runtime load object and call contained function", - dlopen_forshell); + rtems_shell_add_cmd("dlrun", "rtl", + "runtime load object and run specified function", + dlrun_forshell); + + rtems_shell_add_cmd("dlopen", "rtl", + "runtime load object", + shell_dlopen); + + rtems_shell_add_cmd("dlclose", "rtl", + "close reference to loaded object", + shell_dlclose); + + rtems_shell_add_cmd("dlsym", "rtl", + "obtain reference to symbol in loaded object", + shell_dlsym); + + rtems_shell_add_cmd("dlcall", "rtl", + "call function in loaded object", + shell_dlcall); //rtems_monitor_wakeup();