From 4ad07d039a71f43a774e13102ae31d986dcdb7e0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 17 Jul 2007 19:12:31 +0000 Subject: 2007-07-17 Joel Sherrill * hello_world_ada/Makefile.anybsp, hello_world_ada/Makefile.pc386, hello_world_ada/Makefile.score603e, hello_world_ada/init.c: Clean up GNAT_MAIN_STACKSIZE. --- ChangeLog | 6 ++++++ hello_world_ada/Makefile.anybsp | 3 ++- hello_world_ada/Makefile.pc386 | 1 + hello_world_ada/Makefile.score603e | 1 + hello_world_ada/init.c | 18 +++++++----------- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14cd641..de58623 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-07-17 Joel Sherrill + + * hello_world_ada/Makefile.anybsp, hello_world_ada/Makefile.pc386, + hello_world_ada/Makefile.score603e, hello_world_ada/init.c: Clean up + GNAT_MAIN_STACKSIZE. + 2007-07-17 Joel Sherrill * hello_world_ada/Makefile.pc386, hello_world_ada/init.c: Update to gcc diff --git a/hello_world_ada/Makefile.anybsp b/hello_world_ada/Makefile.anybsp index 1e97f13..9020f35 100644 --- a/hello_world_ada/Makefile.anybsp +++ b/hello_world_ada/Makefile.anybsp @@ -27,7 +27,8 @@ endif # Tool helpers rtemsdir=${RTEMS_MAKEFILE_PATH} GNATMAKE=$(AS:as=gnatmake) -CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) +CARGS =-B${rtemsdir}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) +CARGS+=-DGNAT_MAIN_STACKSPACE=100 all: init.o $(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g \ diff --git a/hello_world_ada/Makefile.pc386 b/hello_world_ada/Makefile.pc386 index 8bbbca8..542b500 100644 --- a/hello_world_ada/Makefile.pc386 +++ b/hello_world_ada/Makefile.pc386 @@ -21,6 +21,7 @@ rtemsdir=${RTEMS_MAKEFILE_PATH} GNATMAKE=$(AS:as=gnatmake) CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) \ -Wl,-Ttext,$(RELOCADDR) +CARGS+=-DGNAT_MAIN_STACKSPACE=100 all: init.o $(MAIN) diff --git a/hello_world_ada/Makefile.score603e b/hello_world_ada/Makefile.score603e index e87873f..55ac847 100644 --- a/hello_world_ada/Makefile.score603e +++ b/hello_world_ada/Makefile.score603e @@ -14,6 +14,7 @@ GNATMAKE=${tooldir}/bin/powerpc-rtems-gnatmake SIZE=${tooldir}/bin/powerpc-rtems-size CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems -mcpu=603 +CARGS+=-DGNAT_MAIN_STACKSPACE=100 all: init.o $(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g \ diff --git a/hello_world_ada/init.c b/hello_world_ada/init.c index a3b2bbd..f417d96 100644 --- a/hello_world_ada/init.c +++ b/hello_world_ada/init.c @@ -1,7 +1,6 @@ /* - * COPYRIGHT (c) 1989-1997. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. * * The license and distribution terms for this file may be found in * the file LICENSE in this distribution or at @@ -47,23 +46,23 @@ void *start_gnat_main( void * argument ) extern size_t _ada_pthread_minimum_stack_size(); +#ifndef GNAT_MAIN_STACKSPACE +#define GNAT_MAIN_STACKSPACE 0 +#endif void *POSIX_Init( void *argument ) { pthread_t thread_id; pthread_attr_t attr; - size_t stacksize = _ada_pthread_minimum_stack_size(); + size_t stacksize; int status; printk( "Starting Posix Init thread\n" ); status = pthread_attr_init( &attr ); assert( !status ); -#define GNAT_MAIN_STACKSPACE 100 -#ifdef GNAT_MAIN_STACKSPACE stacksize = GNAT_MAIN_STACKSPACE * 1024; -#else -#define GNAT_MAIN_STACKSPACE 0 -#endif + if ( stacksize < _ada_pthread_minimum_stack_size() ) + stacksize = _ada_pthread_minimum_stack_size(); status = pthread_attr_setstacksize( &attr, stacksize ); assert( !status ); @@ -92,9 +91,6 @@ void *POSIX_Init( void *argument ) #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 #define CONFIGURE_MEMORY_OVERHEAD (GNAT_MAIN_STACKSPACE) -/* -#define CONFIGURE_MEMORY_OVERHEAD (256 + GNAT_MAIN_STACKSPACE) -*/ #define CONFIGURE_INIT -- cgit v1.2.3