This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
1.3, nonaligned stack
- From: Larice Robert <larice at vidisys dot de>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 28 May 2002 10:22:47 +0200 (CEST)
- Subject: [ECOS] 1.3, nonaligned stack
I've seen access violations caused by non word aligned stacks.
the target is sh4 based.
the problem is in packages/kernel/current/src/common/thread.cxx line 1218
static char idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE];
at least my sh4 gcc toolchain did not align this static char array to
word boundaries (correct behaviour in my opinion).
i've fixed this with
static char idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREADS_IDLE_STACK_SIZE] __attribute__ ((aligned (4)));
but if i remember correctly, i've seen such char [] allocations for stack
space in other places too.
other cpu might allow non alligned access, but with reduced performance.
Robert Larice
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss