public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* CYGNUM_HAL_STACK_SIZE_MINIMUM optimization
@ 2010-07-19 15:38 Brian Karr
  0 siblings, 0 replies; only message in thread
From: Brian Karr @ 2010-07-19 15:38 UTC (permalink / raw)
  To: ecos-patches

Hi All,

I sent this a while ago to ecos-discuss, but this is the proper list, so
please excuse the cross-post.

- o -

For applications running from flash with limited RAM, it's useful to
optimize the minimum allowed stack size for the Idle thread.

We’ve seen that the eCos CYGNUM_HAL_STACK_SIZE_MINIMUM which is used for the
Idle thread and for ASSERT of thread creation is too high when the system is
set to CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK.

A suggested change for ARM is included in the diff below. A search of the
list archives did not turn up an equivalent change for this.

Without this the minimum stack size and the size of the idle stack will be
1120 bytes assuming a nesting level of 4.

Best,

Brian





diff -r d6c0c0e0431c packages/hal/arm/arch/current/include/hal_arch.h
--- a/packages/hal/arm/arch/current/include/hal_arch.h          Tue Jan 26
11:27:47
2010 +0000
+++ b/packages/hal/arm/arch/current/include/hal_arch.h      Sun Jan 31
22:52:44
2010 -0800
@@ -400,9 +400,14 @@
 // Space for the maximum number of nested interrupts, plus room to call
functions  #define CYGNUM_HAL_MAX_INTERRUPT_NESTING 4
 
-#define CYGNUM_HAL_STACK_SIZE_MINIMUM \
-        (CYGNUM_HAL_MAX_INTERRUPT_NESTING * CYGNUM_HAL_STACK_INTERRUPT_SIZE
+ \
-         2 * CYGNUM_HAL_STACK_FRAME_SIZE)
+#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
+#define CYGNUM_HAL_STACK_SIZE_MINIMUM \
+        (2 * CYGNUM_HAL_STACK_FRAME_SIZE) #else #define 
+CYGNUM_HAL_STACK_SIZE_MINIMUM \
+        (CYGNUM_HAL_MAX_INTERRUPT_NESTING * 
+CYGNUM_HAL_STACK_INTERRUPT_SIZE  \
+         2 * CYGNUM_HAL_STACK_FRAME_SIZE) #endif
 
 #define CYGNUM_HAL_STACK_SIZE_TYPICAL \
         (CYGNUM_HAL_STACK_SIZE_MINIMUM + \





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-19 15:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 15:38 CYGNUM_HAL_STACK_SIZE_MINIMUM optimization Brian Karr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).