Ticket #1532: psxload01-try2.diff

File psxload01-try2.diff, 8.0 KB (added by Joel Sherrill, on 05/27/10 at 23:37:14)

Patch with new files added

  • testsuites/aclocal/canonicalize-tools.m4

    RCS file: /usr1/CVS/rtems/testsuites/aclocal/canonicalize-tools.m4,v
    retrieving revision 1.2
    diff -u -r1.2 canonicalize-tools.m4
     
    1818
    1919dnl NOTE: These may not be available if not using gnutools
    2020  RTEMS_CHECK_TOOL(OBJCOPY,objcopy,no)
     21  RTEMS_CHECK_TOOL(OBJDUMP,objdump,no)
    2122  RTEMS_CHECK_TOOL(SIZE,size,no)
    2223  RTEMS_CHECK_TOOL(STRIP,strip,:)
    2324])
  • new file testsuites/aclocal/obj-format.m4

    RCS file: testsuites/aclocal/obj-format.m4
    diff -N testsuites/aclocal/obj-format.m4
    - +  
     1#
     2# $Id$
     3#
     4
     5AC_DEFUN([RTEMS_OBJECT_FORMAT],
     6[
     7  AC_MSG_CHECKING([for object file format])
     8
     9  save_CFLAGS="$CFLAGS"
     10  CFLAGS="$CFLAGS -c -o conftest.o"
     11  AC_TRY_COMPILE([],[],
     12    [RTEMS_OBJ_FORMAT=`${OBJDUMP} -f conftest.o | grep .o: | sed -e "s/^.*format //"`],
     13    [RTEMS_OBJ_FORMAT=none])
     14
     15  CFLAGS="$save_CFLAGS"
     16
     17  AC_MSG_RESULT([$RTEMS_OBJ_FORMAT])
     18
     19  AC_SUBST(RTEMS_OBJ_FORMAT)
     20])
  • testsuites/psxtests/Makefile.am

    RCS file: /usr1/CVS/rtems/testsuites/psxtests/Makefile.am,v
    retrieving revision 1.58
    diff -u -r1.58 Makefile.am
     
    1010    psx10 psx11 psx12 psx13 psx14 psxalarm01 \
    1111    psxautoinit01 psxautoinit02 psxbarrier01 \
    1212    psxcancel psxcancel01 psxcleanup psxcleanup01 \
    13     psxcond01 psxenosys psxkey01 psxkey02 \
    14     psxkey03 psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \
     13    psxcond01 psxenosys psxkey01 psxkey02 psxkey03 psxload01 \
     14    psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \
    1515    psxmutexattr01 psxobj01 psxrwlock01 psxsem01 psxsignal01 psxsignal02 \
    1616    psxsignal03 psxsignal04 psxsignal05 psxspin01 psxspin02 psxsysconf \
    1717    psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
  • testsuites/psxtests/configure.ac

    RCS file: /usr1/CVS/rtems/testsuites/psxtests/configure.ac,v
    retrieving revision 1.60
    diff -u -r1.60 configure.ac
     
    2222
    2323RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
    2424
     25RTEMS_OBJECT_FORMAT
     26
    2527AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
    2628
    2729RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
     
    9092psxkey01/Makefile
    9193psxkey02/Makefile
    9294psxkey03/Makefile
     95psxload01/Makefile
    9396psxmount/Makefile
    9497psxmsgq01/Makefile
    9598psxmsgq02/Makefile
  • new file testsuites/psxtests/psxload01/.cvsignore

    RCS file: testsuites/psxtests/psxload01/.cvsignore
    diff -N testsuites/psxtests/psxload01/.cvsignore
    - +  
     1Makefile
     2Makefile.in
  • new file testsuites/psxtests/psxload01/Makefile.am

    RCS file: testsuites/psxtests/psxload01/Makefile.am
    diff -N testsuites/psxtests/psxload01/Makefile.am
    - +  
     1##
     2## $Id: Makefile.am,v 1.25 2009/04/03 12:44:41 ralf Exp $
     3##
     4
     5MANAGERS = all
     6
     7rtems_tests_PROGRAMS = psxload01
     8psxload01_SOURCES = init.c ../include/pmacros.h ../psxfile01/test_cat.c
     9
     10dist_rtems_tests_DATA = psxload01.scn
     11
     12psxload01_LDADD = initial_filesystem_tar.o
     13
     14include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
     15include $(top_srcdir)/../automake/compile.am
     16include $(top_srcdir)/../automake/leaf.am
     17
     18AM_CPPFLAGS += -I$(top_srcdir)/include
     19AM_CPPFLAGS += -I$(top_srcdir)/../support/include
     20
     21LINK_OBJS = $(psxload01_OBJECTS) $(psxload01_LDADD)
     22LINK_LIBS = $(psxload01_LDLIBS)
     23
     24psxload01$(EXEEXT): $(psxload01_OBJECTS) $(psxload01_DEPENDENCIES)
     25        @rm -f psxload01$(EXEEXT)
     26        $(make-exe)
     27
     28initial_filesystem_tar.o: initial_fs/home/test_file
     29        (cd $(srcdir)/initial_fs && \
     30         rm -f symlink && ln -s home/test_file symlink && \
     31         tar cf - home symlink && rm -f symlink ) > initial_filesystem.tar
     32        $(OBJCOPY) -I binary -B $(RTEMS_CPU) -O $(RTEMS_OBJ_FORMAT) \
     33        initial_filesystem.tar $@
     34
     35include $(top_srcdir)/../automake/local.am
  • new file testsuites/psxtests/psxload01/init.c

    RCS file: testsuites/psxtests/psxload01/init.c
    diff -N testsuites/psxtests/psxload01/init.c
    - +  
     1/*
     2 *  COPYRIGHT (c) 1989-2010.
     3 *  On-Line Applications Research Corporation (OAR).
     4 *
     5 *  The license and distribution terms for this file may be
     6 *  found in the file LICENSE in this distribution or at
     7 *  http://www.rtems.com/license/LICENSE.
     8 *
     9 *  $Id: init.c,v 1.17 2009/10/02 11:50:39 joel Exp $
     10 */
     11
     12#include <bsp.h> /* for device driver prototypes */
     13#include <rtems/untar.h>
     14#include <rtems/error.h>
     15
     16#include <stdio.h>
     17#include <stdlib.h>
     18
     19/*
     20 *  The tarfile is built automatically externally so we need to account
     21 *  for the leading symbol on the names.
     22 */
     23#if defined(__sh__)
     24  #define SYM(_x) _x
     25#else
     26  #define SYM(_x) _ ## _x
     27#endif
     28
     29/**
     30 * The initial tarfile parameters.
     31 */
     32extern int SYM(binary_initial_filesystem_tar_start);
     33extern int SYM(binary_initial_filesystem_tar_size);
     34
     35#define TARFILE_START SYM(binary_initial_filesystem_tar_start)
     36#define TARFILE_SIZE  SYM(binary_initial_filesystem_tar_size)
     37
     38void test_cat(
     39  char *file,
     40  int   offset_arg,
     41  int   length
     42);
     43
     44
     45rtems_task Init(
     46  rtems_task_argument ignored
     47)
     48{
     49  printf( "\n\n*** PSXLOAD01 TEST ***\n" );
     50 rtems_status_code sc;
     51
     52  printf("Loading filesystem: ");
     53
     54  sc = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE);
     55  if (sc != RTEMS_SUCCESSFUL) {
     56    printf ("error: untar failed: %s\n", rtems_status_text (sc));
     57    exit(1);
     58   
     59  }
     60  printf ("successful\n");
     61
     62  /******************/
     63  printf( "========= /home/test_file =========\n" );
     64  test_cat( "/home/test_file", 0, 0 );
     65 
     66  /******************/
     67  printf( "========= /symlink =========\n" );
     68  test_cat( "/symlink", 0, 0 );
     69  printf( "*** END OF PSXLOAD01 TEST ***\n" );
     70  exit( 0 );
     71}
     72
     73
     74/* NOTICE: the clock driver is explicitly disabled */
     75#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
     76#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     77
     78#define CONFIGURE_MAXIMUM_TASKS            1
     79#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
     80#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
     81
     82#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
     83
     84#define CONFIGURE_INIT
     85#include <rtems/confdefs.h>
  • new file testsuites/psxtests/psxload01/initial_fs/home/test_file

    RCS file: testsuites/psxtests/psxload01/psxload01.doc
    diff -N testsuites/psxtests/psxload01/psxload01.doc
    RCS file: testsuites/psxtests/psxload01/psxload01.scn
    diff -N testsuites/psxtests/psxload01/psxload01.scn
    RCS file: testsuites/psxtests/psxload01/initial_fs/home/test_file
    diff -N testsuites/psxtests/psxload01/initial_fs/home/test_file
    - +  
     1This is a test of loading an RTEMS filesystem from an
     2initial tar image.