summaryrefslogtreecommitdiffstats
path: root/testsuite/loopback01
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-07-27 08:14:05 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-07-27 08:14:05 -0500
commit04ca0330951c24b7e9aacff25f8c5eb5b0880b27 (patch)
treeaa7ea53edac9fa2b4a26ed19677ce5f69b6fb9de /testsuite/loopback01
parentinit01: Add configuration structure (diff)
downloadrtems-libbsd-04ca0330951c24b7e9aacff25f8c5eb5b0880b27.tar.bz2
loopback01: Does not include rtems specific net files
Diffstat (limited to 'testsuite/loopback01')
-rw-r--r--testsuite/loopback01/.gitignore1
-rw-r--r--testsuite/loopback01/init.c82
-rw-r--r--testsuite/loopback01/test_main.c3
3 files changed, 84 insertions, 2 deletions
diff --git a/testsuite/loopback01/.gitignore b/testsuite/loopback01/.gitignore
new file mode 100644
index 00000000..27bb1279
--- /dev/null
+++ b/testsuite/loopback01/.gitignore
@@ -0,0 +1 @@
+init.c
diff --git a/testsuite/loopback01/init.c b/testsuite/loopback01/init.c
new file mode 100644
index 00000000..eba9e743
--- /dev/null
+++ b/testsuite/loopback01/init.c
@@ -0,0 +1,82 @@
+/*
+ * Shared Network Test Initialization File
+ */
+
+#include <bsp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <freebsd/bsd.h>
+
+/* XXX should these be in a header? */
+void print_test_name(void);
+void test_main(void);
+
+/* XXX temporary until in .h file */
+void rtems_initialize_interfaces(void);
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ print_test_name();
+
+ /*
+ * 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();
+
+ test_main();
+ /* should not return */
+
+ printf( "*** Test main returned and should not have ***\n" );
+ exit( 5 );
+}
+
+/* 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 <rtems/confdefs.h>
+
+/*
+ * FreeBSD TCP/IP Initialization
+ */
+
+#include <freebsd/machine/rtems-bsd-sysinit.h>
+
+#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/loopback01/test_main.c b/testsuite/loopback01/test_main.c
index f8b5b3b0..b21fc87e 100644
--- a/testsuite/loopback01/test_main.c
+++ b/testsuite/loopback01/test_main.c
@@ -6,8 +6,6 @@
#include <stdlib.h>
#include <stdio.h>
-#include <freebsd/bsd.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -17,6 +15,7 @@ void print_test_name(void)
}
+/* XXX remaining init configuration to evaluate */
#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024)
#define CONFIGURE_INIT_TASK_PRIORITY 50
#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \