From e72d576583d98c78aa80656c8ac0d76e1daf192f Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 6 Feb 2008 18:08:21 +0000 Subject: 2008-02-06 Joel Sherrill * Makefile.shared, rtems_init.c: More clean up and more generalization. --- ChangeLog | 4 ++++ Makefile.shared | 8 ++++++-- rtems_init.c | 26 +++++++++++++++++++++++--- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d6835c..29117db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-06 Joel Sherrill + + * Makefile.shared, rtems_init.c: More clean up and more generalization. + 2007-10-17 Joel Sherrill * 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 -- cgit v1.2.3