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]

Alignment errors


We have come across a problem with alignment in eCos.

In the file:

packages\io\flash\current\src\flashiodev.c

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 at penell dot com  
----------------------------------------------------------------------------
-------------
Penell A/S - An RTX Company
Plastvaenget 9
DK-9560 Hadsund 
Denmark.
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


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