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


"Uwe Kindler" <ukindler@htwm.de> writes:

> Hello Eric,
> 
> thank you for the reply. When I use the alignment attribute then the char
> array will be aligned correctly. Here is the result of nm comman.
> 
> 00ffc00c B _bss
> 00ffc00c D _edata
> 00ffc00c b _stack01
> 00ffc01c b _stack02
> 00ffc02c b _stack03
> 00ffc03c b _stack04
> 00ffc040 b _stack05
> 00ffc044 B _count
> 00ffc048 B _ebss
> 
> But this does not solve the eCos idle_thread_stack problem because it is
> inside the kernel and this should be a kernel patch. Also thís would be
> necessary for other char arrays within the eCos source that should be
> aligned.

Fixing all the stack declarations throughout all the code would be a
big job and would perturb lots of stuff. Particularly since it seems
to be the result of strange choices in the GCC port for one processor.

Since this problem only affects the stack checking code, it is
probably best to fix it there. 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
that the aligned base+size is still within the original stack space.

Uwe, if you would like to try this out and send in a patch I'll see
that it gets committed.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


--
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]