From 3083373e471be76b1624e0583c5a3f2f455d41c1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Aug 2009 20:25:58 +0000 Subject: Initial import of reorganized examples. --- hello/Makefile | 14 +++++++++++++ hello/both_hello/.cvsignore | 1 + hello/both_hello/Makefile | 27 ++++++++++++++++++++++++ hello/both_hello/test.c | 42 ++++++++++++++++++++++++++++++++++++++ hello/hello_world_c/.cvsignore | 1 + hello/hello_world_c/Makefile | 27 ++++++++++++++++++++++++ hello/hello_world_c/test.c | 35 +++++++++++++++++++++++++++++++ hello/posix_hello_world/.cvsignore | 1 + hello/posix_hello_world/Makefile | 27 ++++++++++++++++++++++++ hello/posix_hello_world/test.c | 34 ++++++++++++++++++++++++++++++ 10 files changed, 209 insertions(+) create mode 100644 hello/Makefile create mode 100644 hello/both_hello/.cvsignore create mode 100644 hello/both_hello/Makefile create mode 100644 hello/both_hello/test.c create mode 100644 hello/hello_world_c/.cvsignore create mode 100644 hello/hello_world_c/Makefile create mode 100644 hello/hello_world_c/test.c create mode 100644 hello/posix_hello_world/.cvsignore create mode 100644 hello/posix_hello_world/Makefile create mode 100644 hello/posix_hello_world/test.c (limited to 'hello') diff --git a/hello/Makefile b/hello/Makefile new file mode 100644 index 0000000..9f3b0c3 --- /dev/null +++ b/hello/Makefile @@ -0,0 +1,14 @@ +# +# $Id$ +# + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(RTEMS_ROOT)/make/directory.cfg + +SUBDIRS=hello_world_c + +# If the POSIX API isn't enabled, we can't build these +ifeq ($(RTEMS_HAS_POSIX_API),yes) +SUBDIRS += posix_hello_world both_hello +endif diff --git a/hello/both_hello/.cvsignore b/hello/both_hello/.cvsignore new file mode 100644 index 0000000..fecf58a --- /dev/null +++ b/hello/both_hello/.cvsignore @@ -0,0 +1 @@ +o-optimize diff --git a/hello/both_hello/Makefile b/hello/both_hello/Makefile new file mode 100644 index 0000000..e9d3ea2 --- /dev/null +++ b/hello/both_hello/Makefile @@ -0,0 +1,27 @@ +# +# $Id$ +# + +# +# RTEMS_MAKEFILE_PATH is typically set in an environment variable +# + +PGM=${ARCH}/both_hello.exe + +# optional managers required +MANAGERS=all + +# C source names +CSRCS = test.c +COBJS = $(CSRCS:%.c=${ARCH}/%.o) + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) + +all: ${ARCH} $(PGM) + +$(PGM): $(OBJS) + $(make-exe) diff --git a/hello/both_hello/test.c b/hello/both_hello/test.c new file mode 100644 index 0000000..f8947b9 --- /dev/null +++ b/hello/both_hello/test.c @@ -0,0 +1,42 @@ +/* + * Simple test program -- simplified version of sample test hello. + */ + +#include + +#include +#include + +rtems_task Init( + rtems_task_argument ignored +) +{ + printf( "Classic -- Hello World\n" ); + rtems_task_delete( RTEMS_SELF ); +} + +void *POSIX_Init( + void *argument +) +{ + printf( "POSIX -- Hello World\n" ); + sleep( 1 ); + exit( 0 ); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 + +#define CONFIGURE_INIT + +#include + +/* end of file */ diff --git a/hello/hello_world_c/.cvsignore b/hello/hello_world_c/.cvsignore new file mode 100644 index 0000000..fecf58a --- /dev/null +++ b/hello/hello_world_c/.cvsignore @@ -0,0 +1 @@ +o-optimize diff --git a/hello/hello_world_c/Makefile b/hello/hello_world_c/Makefile new file mode 100644 index 0000000..9fe9919 --- /dev/null +++ b/hello/hello_world_c/Makefile @@ -0,0 +1,27 @@ +# +# $Id$ +# + +# +# RTEMS_MAKEFILE_PATH is typically set in an environment variable +# + +PGM=${ARCH}/hello.exe + +# optional managers required +MANAGERS=all + +# C source names +CSRCS = test.c +COBJS = $(CSRCS:%.c=${ARCH}/%.o) + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) + +all: ${ARCH} $(PGM) + +$(PGM): $(OBJS) + $(make-exe) diff --git a/hello/hello_world_c/test.c b/hello/hello_world_c/test.c new file mode 100644 index 0000000..d9354f7 --- /dev/null +++ b/hello/hello_world_c/test.c @@ -0,0 +1,35 @@ +/* + * Simple test program -- simplified version of sample test hello. + * + * $Id$ + */ + +#include + +#include +#include + +rtems_task Init( + rtems_task_argument ignored +) +{ + printf( "\n\n*** HELLO WORLD TEST ***\n" ); + printf( "Hello World\n" ); + printf( "*** END OF HELLO WORLD TEST ***\n" ); + exit( 0 ); +} + +/* configuration information */ + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_INIT + +#include + +/* end of file */ diff --git a/hello/posix_hello_world/.cvsignore b/hello/posix_hello_world/.cvsignore new file mode 100644 index 0000000..fecf58a --- /dev/null +++ b/hello/posix_hello_world/.cvsignore @@ -0,0 +1 @@ +o-optimize diff --git a/hello/posix_hello_world/Makefile b/hello/posix_hello_world/Makefile new file mode 100644 index 0000000..bc6693f --- /dev/null +++ b/hello/posix_hello_world/Makefile @@ -0,0 +1,27 @@ +# +# $Id$ +# + +# +# RTEMS_MAKEFILE_PATH is typically set in an environment variable +# + +PGM=${ARCH}/posix_hello.exe + +# optional managers required +MANAGERS=all + +# C source names +CSRCS = test.c +COBJS = $(CSRCS:%.c=${ARCH}/%.o) + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) + +all: ${ARCH} $(PGM) + +$(PGM): $(OBJS) + $(make-exe) diff --git a/hello/posix_hello_world/test.c b/hello/posix_hello_world/test.c new file mode 100644 index 0000000..0386b5b --- /dev/null +++ b/hello/posix_hello_world/test.c @@ -0,0 +1,34 @@ +/* + * Simple test program -- simplified version of sample test hello. + */ + +#include + +#include +#include + +void *POSIX_Init( + void *argument +) +{ + printf( "\n\n*** HELLO WORLD TEST ***\n" ); + printf( "Hello World\n" ); + printf( "*** END OF HELLO WORLD TEST ***\n" ); + exit( 0 ); +} + +/* configuration information */ + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 + +#define CONFIGURE_INIT + +#include + +/* end of file */ -- cgit v1.2.3