[ECOS] Re: Wrong declaration of idle_thread_stack

Uwe Kindler ukindler@htwm.de
Thu Jan 22 10:46:00 GMT 2004

Hello Nick,

>In Cyg_HardwareThread::attach_stack() all that would be necessary is to
>adjust s_base and s_size to appropriate boundaries at the beginning of the
function, using
>CYGARC_ALIGNMENT. Similar to what you have already done for the SP in
>HAL_THREAD_INIT_CONTEXT(). The only real gotcha here is to make sure
>hat the aligned base+size is still within the original stack space.

thank you for your quick reply. In order to avoid mistakes I would like to
ask you what does CYGARC_ALIGNMENT exactly define.

For the H8S architecture, compiler and linker I can tell you the following

The stack pointer have to be even  (alignment to a 2 byte boundary)

>From hardware point of view of H8S, every section in different memory region
should start with even address that means ALIGN(2) (least significant bit
should be zero).

So for stack pointer alignement CYGARC_ALIGNMENT have to be 2. But then
stack checking would fail because idle_thread_stack is char and so it is
aligned to 1 byte boundary. So for stack checking CYGARC_ALIGNMENT should be

Therefore my question: what exactly does CYGARC_ALIGNMENT define. I
carefully scanned the h8300-elf-gcc documentation but I did not found any
global compiler switch for alignment of char arrays but I posted a support
request to KPIT, the maintainer of the H8 toolchain.

Regards, Uwe

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

More information about the Ecos-discuss mailing list