summaryrefslogtreecommitdiffstats
path: root/hello_world_ada
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-07-17 19:12:31 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-07-17 19:12:31 +0000
commit4ad07d039a71f43a774e13102ae31d986dcdb7e0 (patch)
tree0675a7b133ab72731e5f1bb80d9002443079fd7d /hello_world_ada
parent2007-07-17 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadada-examples-4ad07d039a71f43a774e13102ae31d986dcdb7e0.tar.bz2
2007-07-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* 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.
Diffstat (limited to 'hello_world_ada')
-rw-r--r--hello_world_ada/Makefile.anybsp3
-rw-r--r--hello_world_ada/Makefile.pc3861
-rw-r--r--hello_world_ada/Makefile.score603e1
-rw-r--r--hello_world_ada/init.c18
4 files changed, 11 insertions, 12 deletions
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