This is the mail archive of the ecos-discuss@sources.redhat.com 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]

idle thread stack alignment problem


Hello,

in order to debug the serial driver for the EDOSK platform, I created a
simple application with one single thread. As soon, as the common serial
eCos driver calls cyg_drv_cond_wait my application crashs. (At least it does
not respond to GDB anymore).  If only one thread is present,
cyg_drv_cond_wait causes a thread switch to the idle thread. When I create a
second thread with an empty while loop my application runs well. So there
must be a problem with the idle thread. After hours of debugging I found
that the idle thread stack starts at an odd address. But for the H8S
architecture its is required that the SP is always even (word or longword
size operands when using SP). When I changed the declaration of the idle
thread stack in this way:

static short
idle_thread_stack[CYGNUM_KERNEL_CPU_MAX][CYGNUM_KERNEL_THREADS_IDLE_STACK_SI
ZE/2];

everything works fine without a crash.

Is there a way to change the alignment of the thread stack without changing
the thread.cxx sourcecode? I did not found any other way then the one
described above.

Thank you very much for your help

Regards, Uwe

eCos port for Renesas EDOSK-2674
http://www.htwm.de/ukindler/ecos


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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