[ECOS] Alignment errors

Erik Aagaard Knudsen EAK@penell.com
Fri Mar 14 15:10:00 GMT 2003

We have come across a problem with alignment in eCos.

In the file:


a buffer for flash write code is allocated. This is done as follows:

static char flashiodev_workspaces[1][FLASH_MIN_WORKSPACE];

Unfortunately not all platforms (in particular not the one we are working
with) support code being executed from non aligned addresses. We have
therefore changed the above line to:

static int flashiodev_workspaces[1][FLASH_MIN_WORKSPACE/sizeof(int)];

and this solved the problem.

Another problem (of the same kind) we have come across, is related to the
examples supplied with eCos. Stack space is most often allocated on char
boundaries. This does not work on all platforms. The stack must be aligned.
Most often on an int boundary.

Best Regards
Erik Aa. Knudsen
Project Engineer, 
Software Engineer, M.Sc.

Phone direct:			+45 9652 0356
E-mail:			eak@penell.com  
Penell A/S - An RTX Company
Plastvaenget 9
DK-9560 Hadsund 
Phone: 			+45 9857 2666
Fax:			+45 9857 2664
Website:			www.penell.com 

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