[ECOS] Re: char array alignment
Thu Jan 22 14:46:00 GMT 2004
"Uwe Kindler" <email@example.com> writes:
> Hello Nick,
> thank you again for the answer.
> One last question - Does the eCos repository sourcecode contain other char
> arrays wich need to be aligned to a certain boundary. I read the mailing
> lists and found the posts from Larice Rober about stack violations and char
> array alignment.
The main things that suffer from these problems will be the
stacks. There are also char arrays in one structure in the POSIX
package which are cast to something else. These should be correctly
aligned relative to the start of the structure. However, this
structure is allocated at the base of a thread stack in
pthread_create(), so it might be necessary to apply the same alignment
operations to this stack as would be done in attach_stack().
> The KPIT crew confirmed that the h8300-elf-gcc compiler does not align char
> arrays to any boundary.
> If this alignement problem could cause serious problems with other char
> arrays within the eCos repository then further development of the EDOSK-2674
> and H8S port is not possible until the h8300-elf-gcc is patched. This
> problem also concerns the H8300 port within the eCos repository which would
> be unusable with this problem.
Yes, it's annoying. The correct solution, I believe is the one we are
working towards: to adjust the alignment of arbitrary pieces of data
to something more useful.
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
More information about the Ecos-discuss