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]

Re: Re: Wrong declaration of idle_thread_stack


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
things:

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

2.
>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
1.

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


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