[U-Boot] why bic sp, sp, #7 /* 8-byte alignment for ABI compliance */

Benoît Thébaudeau benoit.thebaudeau at advansee.com
Sun Feb 17 15:04:25 CET 2013


Hi,

On Sunday, February 17, 2013 10:59:10 AM, janpharm wrote:
> Hi All,
> 
> After searching via google,I still can not find the hint for
> 
> I understand the function of bic command,

http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf

Simple bit clear with bit-mask.

> but did not understand :
> 
> why "bic sp, sp, #7" can be implied for "8-byte alignment for ABI
> compliance" ?

http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf

5.2.1.2.

SP has to be double-word (64-bit, 8-byte) aligned, so since this is an
expand-down stack, its lower 3 bits have to be cleared in order to make
it a multiple of 8.

> can someone offer some example?

http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=arch/arm/lib/crt0.S;h=4f60958b1dbf1782863cebd7ffe884733a452b26;hb=HEAD#l110

Best regards,
Benoît


More information about the U-Boot mailing list