[En-Nut-Discussion] ARM GCC 4.4 Alignment Problems

Ole Reinhardt ole.reinhardt at embedded-it.de
Sat Apr 3 00:21:14 CEST 2010


Hi!

> What should this handler do in addition to what is already implemented
> in nut/arch/arm/debug?

It would not just call the debug code and produce a stack trace but will
"correct" the unaligned access. Let me use Bernds words:

"You either load an aligned 32 bit value into a register or load two
partial data into two registers, then shift and aggregate them."

This fixup needs to be done for every memory access instruction.

The program would not crash and will only work a little slower. For sure
unaligned access should be reported together with the current pc value
to allow easy error detection and correction by the developer.

A quite complex implementation can be found in the linux kernel at 

arch/arm/mm/alignment.c 

Bye,

Ole

-- 

Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting

http://www.embedded-it.de

Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 




More information about the En-Nut-Discussion mailing list