This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CYGNUM_HAL_STACK_SIZE_MINIMUM optimization


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 + \






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]