summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>1999-10-06 16:48:51 +0000
committerEric Norum <WENorum@lbl.gov>1999-10-06 16:48:51 +0000
commite2924848d35e206299c65469383563178de04a54 (patch)
tree94f5d66ffb35b9f3218fe31f2a38eb4700dcaf97 /examples
parent683490f5a623424ef5bafc7dd920fb0a6bfc1a5f (diff)
Useful add-on libraries
Diffstat (limited to 'examples')
-rw-r--r--examples/avl/BuildTests.sh13
-rw-r--r--examples/avl/Makefile70
-rw-r--r--examples/avl/README4
-rw-r--r--examples/avl/init.c51
4 files changed, 138 insertions, 0 deletions
diff --git a/examples/avl/BuildTests.sh b/examples/avl/BuildTests.sh
new file mode 100644
index 0000000..b0cc752
--- /dev/null
+++ b/examples/avl/BuildTests.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -x
+
+SRCDIR=../../avl-1.4.0
+
+for TEST in avl avlt avltr rb
+do
+ rm -f $TEST.c
+ ln -s $SRCDIR/$TEST.c .
+ make TEST=$TEST SRCDIR=$SRCDIR
+ rm -f $TEST.c
+done
diff --git a/examples/avl/Makefile b/examples/avl/Makefile
new file mode 100644
index 0000000..0cbf425
--- /dev/null
+++ b/examples/avl/Makefile
@@ -0,0 +1,70 @@
+#
+# $Id$
+#
+# Templates/Makefile.leaf
+# Template leaf node Makefile
+#
+
+# C source names, if any, go here -- minus the .c
+C_PIECES= init $(TEST)
+C_FILES=$(C_PIECES:%=%.c)
+C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
+
+# C++ source names, if any, go here -- minus the .cc
+CC_PIECES=
+CC_FILES=$(CC_PIECES:%=%.cc)
+CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
+
+H_FILES=
+
+# Assembly source names, if any, go here -- minus the .s
+S_PIECES=
+S_FILES=$(S_PIECES:%=%.s)
+S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
+
+SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
+OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
+
+PGMS=${ARCH}/$(TEST)
+
+#
+# RTEMS managers go here
+#
+MANAGERS=io event message semaphore
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+DEFINES +=
+CPPFLAGS += -I$(SRCDIR) -DSELF_TEST=1 -Dmain=ncchk
+CFLAGS +=
+
+LD_PATHS +=
+LD_LIBS +=
+CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0x200000 # network needs more space
+CFLAGS_DEBUG_V += -DSTACK_CHECKER_ON
+
+#
+# Add your list of files to delete here. The config files
+# already know how to delete some stuff, so you may want
+# to just run 'make clean' first to see what gets missed.
+# 'make clobber' already includes 'make clean'
+#
+
+CLEAN_ADDITIONS +=
+CLOBBER_ADDITIONS +=
+
+all: ${ARCH} $(SRCS) $(PGMS)
+
+${ARCH}/$(TEST): ${OBJS} ${LINK_FILES}
+ $(make-exe)
+
+# Install the program(s), appending _g or _p as appropriate.
+# for include files, just use $(INSTALL)
+install: all
+ $(INSTALL_VARIANT) -m 555 ${PGMS} /usr/local/tftpboot/bootfiles/m68360/
diff --git a/examples/avl/README b/examples/avl/README
new file mode 100644
index 0000000..72cab38
--- /dev/null
+++ b/examples/avl/README
@@ -0,0 +1,4 @@
+This directory contains a script and a makefile to build RTEMS
+executable images of the avl test programs. To build all
+the tests:
+ sh BuildTests.sh
diff --git a/examples/avl/init.c b/examples/avl/init.c
new file mode 100644
index 0000000..eb33c84
--- /dev/null
+++ b/examples/avl/init.c
@@ -0,0 +1,51 @@
+/*
+ * Root task
+ *
+ * $Revision$ $Date$ $Author$
+ */
+#include <bsp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ ***********************************************************************
+ * RTEMS CONFIGURATION *
+ ***********************************************************************
+ */
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_TASKS 20
+#define CONFIGURE_MAXIMUM_SEMAPHORES 10
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10
+
+#define CONFIGURE_MICROSECONDS_PER_TICK 52489
+
+#define CONFIGURE_INIT
+#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
+ RTEMS_NO_TIMESLICE | \
+ RTEMS_NO_ASR | \
+ RTEMS_INTERRUPT_LEVEL(0))
+#define CONFIGURE_INIT_TASK_STACK_SIZE (40*1024)
+#define CONFIGURE_INIT_TASK_PRIORITY 100
+rtems_task Init (rtems_task_argument argument);
+
+#define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
+rtems_driver_address_table Device_drivers[] = {
+ CONSOLE_DRIVER_TABLE_ENTRY,
+ CLOCK_DRIVER_TABLE_ENTRY,
+};
+
+#include <confdefs.h>
+
+extern int main (int argc, char **argv);
+
+/*
+ * RTEMS Startup Task
+ */
+rtems_task
+Init (rtems_task_argument ignored)
+{
+ putenv ("TERM=xterm");
+ main (0, NULL);
+ rtems_task_suspend (RTEMS_SELF);
+}