]> rtime.felk.cvut.cz Git - rtems-devel.git/blobdiff - rtems-omk-template/appdl/init.c
appdl: use rtems_tarfs_load instead of Untar_FromMemory.
[rtems-devel.git] / rtems-omk-template / appdl / init.c
index 6f27e83f9f824338726dc615ad8e1f4c3bf8014c..488ede51d3e4eb811a3941b892d4ef6356e24c3b 100644 (file)
 #include <rtems/error.h>
 #include <rtems/monitor.h>
 #include <rtems/shell.h>
+
+#define USE_RTEMS_TARFS_LOAD
+
+#ifdef USE_RTEMS_TARFS_LOAD
+#include <rtems/imfs.h>
+#else /*USE_RTEMS_TARFS_LOAD*/
 #include <rtems/untar.h>
+#endif /*USE_RTEMS_TARFS_LOAD*/
 
 #ifdef CONFIG_OC_APP_APPDL_NET
 #include <rtems/rtems_bsdnet.h>
@@ -162,6 +169,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__)
@@ -182,9 +192,13 @@ rtems_task Init(
           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' );