diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-02-06 18:08:21 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-02-06 18:08:21 +0000 |
commit | e72d576583d98c78aa80656c8ac0d76e1daf192f (patch) | |
tree | 307d14eb3a51711f9f214de33a11b09a3ac8501e | |
parent | 2008-02-06 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | ada-examples-e72d576583d98c78aa80656c8ac0d76e1daf192f.tar.bz2 |
2008-02-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.shared, rtems_init.c: More clean up and more generalization.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Makefile.shared | 8 | ||||
-rw-r--r-- | rtems_init.c | 26 |
3 files changed, 33 insertions, 5 deletions
@@ -1,3 +1,7 @@ +2008-02-06 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.shared, rtems_init.c: More clean up and more generalization. + 2007-10-17 Joel Sherrill <joel.sherrill@oarcorp.com> * Makefile, Makefile.shared, rtems_init.c, irq_test/interrupt_pkg.adb, diff --git a/Makefile.shared b/Makefile.shared index 839b820..4d99bd3 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -27,10 +27,14 @@ ifeq ($(NEED_ROOTFS_FOR_HOST_INFO),yes) CFLAGS += -DENABLE_UNTAR_ROOT_FILESYSTEM -I. endif +CFLAGS += $(DEFINES) + all: $(PROGRAM).exe $(PROGRAM).exe: rtems_init.o $(FILESYSTEM_OBJS) $(PROGRAM).adb $(EXTRA_OBJS) - $(AS:as=gnatmake) -v $(EXTRA_GNATFLAGS) \ + $(AS:as=gnatmake) \ + -I$(RTEMS_MAKEFILE_PATH)/lib/include/adainclude \ + -v $(EXTRA_GNATFLAGS) \ -O -gnata -gnatE -gnato -g $(PROGRAM) -o $(@) \ -bargs -Mgnat_main \ -largs $(CARGS) $(LINKARGS) rtems_init.o $(FILESYSTEM_OBJS) \ @@ -50,7 +54,7 @@ ifeq ($(RTEMS_BSP_FAMILY),pc386) endif rtems_init.o: ../rtems_init.c ../networkconfig.h $(FILESYSTEM_SRCS) - $(CC) $(CFLAGS) $(CPU_CFLAGS) -c $< + $(CC) $(CFLAGS) -I. $(CPU_CFLAGS) -c $< ifeq ($(NEED_ROOTFS_FOR_HOST_INFO),yes) FilesystemImage: ../rootfs/etc/host.conf ../rootfs/etc/hosts diff --git a/rtems_init.c b/rtems_init.c index 3c4d8a9..cc3699a 100644 --- a/rtems_init.c +++ b/rtems_init.c @@ -178,6 +178,17 @@ void *POSIX_Init( void *argument ) rtems_bsdnet_show_inet_routes (); #endif + #if defined(MAIN_CALL_C_INITIALIZE_APPLICATION) + { + extern void initialize_application(); + printk("Invoking C Application Initializion\n"); + initialize_application(); + } + #endif + + /* + * Now create the thread that will be the GNAT Ada main. + */ status = pthread_attr_init( &attr ); assert( !status ); @@ -197,6 +208,10 @@ void *POSIX_Init( void *argument ) /* configuration information */ +#if defined(HAS_EXTRA_CONFIGURATION) +#include "config.h" +#endif + /* Standard output and a clock tick so time passes */ #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER @@ -214,11 +229,16 @@ void *POSIX_Init( void *argument ) /* We want a clock tick every millisecond */ #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1) -/* The initialization task is a POSIX Initialization thread with default attributes */ +/* The initialization task is a POSIX Initialization thread with default + * attributes. + */ #define CONFIGURE_POSIX_INIT_THREAD_TABLE -/* We are using GNAT/RTEMS with a maximum of 20 Ada tasks and no fake Ada tasks. */ -/* A fake Ada task is a task created outside the Ada run-time that calls into Ada. */ +/* We are using GNAT/RTEMS with a maximum of 20 Ada tasks and no fake Ada + * tasks. + * NOTE: A fake Ada task is a task created outside the Ada run-time that + * calls into Ada. + */ #define CONFIGURE_GNAT_RTEMS #define CONFIGURE_MAXIMUM_ADA_TASKS 20 #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |