Skip to content
Snippets Groups Projects
Commit 3a96ad85 authored by Marek Vasut's avatar Marek Vasut
Browse files

PXA: Align stack to 8 bytes


Part of this patch is by: Mikhail Kshevetskiy.

Stack must be aligned to 8 bytes on PXA (possibly all armv5te) for LDRD/STRD
instructions. In case LDRD/STRD is issued on an unaligned address, the behaviour
is undefined.

The issue was observed when working with the NAND code, which was rendered
disfunctional. Also, the vsprintf() function had serious problems with printing
64bit wide long longs. After aligning the stack, this wrong behaviour is no
longer present.

Tested on:
	Marvell Littleton PXA310 board
	Toradex Colibri PXA320 board
	Aeronix Zipit Z2 PXA270 handheld
	Voipac PXA270 board

Signed-off-by: default avatarMarek Vasut <marek.vasut@gmail.com>
parent f986325d
No related branches found
No related tags found
No related merge requests found
...@@ -140,7 +140,10 @@ stack_setup: ...@@ -140,7 +140,10 @@ stack_setup:
#ifdef CONFIG_USE_IRQ #ifdef CONFIG_USE_IRQ
sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ) sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
#endif /* CONFIG_USE_IRQ */ #endif /* CONFIG_USE_IRQ */
sub sp, r0, #12 /* leave 3 words for abort-stack */ sub r0, r0, #12 /* leave 3 words for abort-stack */
bic sp, r0, #7 /* NOTE: stack MUST be aligned to */
/* 8 bytes in case we want to use */
/* 64bit datatypes (eg. VSPRINTF64) */
clear_bss: clear_bss:
ldr r0, _bss_start /* find start of bss segment */ ldr r0, _bss_start /* find start of bss segment */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment