From e717e817932a74bd7cf3bb92fc90d386f5bd1801 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 26 Jul 2012 07:18:19 -0500 Subject: link01 - Clean up and split so initialization can be reused in other tests Removed building link_r since we appear to have managed to resolve not pulling in enough of the FreeBSD source or having adequate adapter routines. --- testsuite/link01/Makefile_ldr | 31 ----------------- testsuite/link01/init.c | 79 +++++++++++++++++++++++++++++++++++++++++++ testsuite/link01/test.c | 79 ------------------------------------------- testsuite/link01/test_main.c | 23 +++++++++++++ 4 files changed, 102 insertions(+), 110 deletions(-) delete mode 100644 testsuite/link01/Makefile_ldr create mode 100644 testsuite/link01/init.c delete mode 100644 testsuite/link01/test.c create mode 100644 testsuite/link01/test_main.c diff --git a/testsuite/link01/Makefile_ldr b/testsuite/link01/Makefile_ldr deleted file mode 100644 index 54db09a3..00000000 --- a/testsuite/link01/Makefile_ldr +++ /dev/null @@ -1,31 +0,0 @@ -# -# $Id$ -# - -include ../../config.inc - -PGM=${ARCH}/link01_r.exe - -# optional managers required -MANAGERS=all - -# C source names -C_FILES = test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o) - -AM_CPPFLAGS += -I $(INSTALL_BASE)/include -LINK_LIBS += $(INSTALL_BASE)/libbsd.a -Wl,-r - -include $(RTEMS_MAKEFILE_PATH)/Makefile.inc -include $(RTEMS_CUSTOM) -include $(PROJECT_ROOT)/make/leaf.cfg - -OBJS= $(C_O_FILES) -CLEAN_ADDITIONS += undefined.txt - -all: ${ARCH} $(PGM) - -$(PGM): $(OBJS) - $(make-exe) - -# @test `cat undefined.txt | wc -l` -ne 0 && exit 1 diff --git a/testsuite/link01/init.c b/testsuite/link01/init.c new file mode 100644 index 00000000..422e7f53 --- /dev/null +++ b/testsuite/link01/init.c @@ -0,0 +1,79 @@ +/* + * Simple test program -- simplified version of sample test hello. + * + * $Id$ + */ + +#include +#include +#include +#include + +/* XXX temporary until in .h file */ +void rtems_initialize_interfaces(void); + +rtems_task Init( + rtems_task_argument ignored +) +{ + printf( "\n\n*** LIBFREEBSD INITIALIZATION TEST ***\n" ); + /* + * BSD must support the new "shared IRQ PIC implementation" at this point. + * BSPs must also provide rtems_interrupt_server_initialize() which + * just requires including irq-server.[ch] in their build. + */ + + rtems_bsd_initialize_with_interrupt_server(); + + puts( "Initializing interfaces" ); + rtems_initialize_interfaces(); + + puts( "Sleeping to see what happens" ); + sleep( 5 ); + + printf( "*** END OF LIBFREEBSD INITIALIZATION TEST ***\n" ); + exit( 0 ); +} + +/* configuration information */ + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK +#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM + +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 + +#define CONFIGURE_UNLIMITED_OBJECTS +#define CONFIGURE_UNIFIED_WORK_AREAS + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include + +/* + * FreeBSD TCP/IP Initialization + */ + +#include + +#define CONFIGURE_NEED_NET +/* only include FXP and PCI for i386/pc386 for debug on qemu (for now) */ +#if defined(i386) + #define CONFIGURE_NEED_PCIB + #define CONFIGURE_NEED_NET_IF_FXP +#endif + +/* + * This is correct for the PC + */ +char static_hints[] = { + "hint.fxp.0.prefer_iomap=1\0\n" +}; + +#include "nic-sysinit.h" + +/* end of file */ diff --git a/testsuite/link01/test.c b/testsuite/link01/test.c deleted file mode 100644 index 422e7f53..00000000 --- a/testsuite/link01/test.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - * - * $Id$ - */ - -#include -#include -#include -#include - -/* XXX temporary until in .h file */ -void rtems_initialize_interfaces(void); - -rtems_task Init( - rtems_task_argument ignored -) -{ - printf( "\n\n*** LIBFREEBSD INITIALIZATION TEST ***\n" ); - /* - * BSD must support the new "shared IRQ PIC implementation" at this point. - * BSPs must also provide rtems_interrupt_server_initialize() which - * just requires including irq-server.[ch] in their build. - */ - - rtems_bsd_initialize_with_interrupt_server(); - - puts( "Initializing interfaces" ); - rtems_initialize_interfaces(); - - puts( "Sleeping to see what happens" ); - sleep( 5 ); - - printf( "*** END OF LIBFREEBSD INITIALIZATION TEST ***\n" ); - exit( 0 ); -} - -/* configuration information */ - -/* NOTICE: the clock driver is explicitly disabled */ -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM - -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 - -#define CONFIGURE_UNLIMITED_OBJECTS -#define CONFIGURE_UNIFIED_WORK_AREAS - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT -#include - -/* - * FreeBSD TCP/IP Initialization - */ - -#include - -#define CONFIGURE_NEED_NET -/* only include FXP and PCI for i386/pc386 for debug on qemu (for now) */ -#if defined(i386) - #define CONFIGURE_NEED_PCIB - #define CONFIGURE_NEED_NET_IF_FXP -#endif - -/* - * This is correct for the PC - */ -char static_hints[] = { - "hint.fxp.0.prefer_iomap=1\0\n" -}; - -#include "nic-sysinit.h" - -/* end of file */ diff --git a/testsuite/link01/test_main.c b/testsuite/link01/test_main.c new file mode 100644 index 00000000..3e7c43e8 --- /dev/null +++ b/testsuite/link01/test_main.c @@ -0,0 +1,23 @@ +/* + * This is the body of the test. It does not do much except ensure + * that the target is alive after initializing the TCP/IP stack. + */ + +#include +#include +#include +#include + +void print_test_name(void) +{ + printf( "\n\n*** LIBFREEBSD INITIALIZATION TEST ***\n" ); +} + +void test_main(void) +{ + puts( "Sleeping to see what happens" ); + sleep( 5 ); + + printf( "*** END OF LIBFREEBSD INITIALIZATION TEST ***\n" ); + exit( 0 ); +} -- cgit v1.2.3