From 5b1457e4ab50589175a9f4f10323a6cc4476a3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Sat, 12 Dec 2015 22:32:45 +0100 Subject: [PATCH] cc2538: Fix stack alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the Procedure Call Standard for the ARM Architecture (AAPCS) - ABI r2.09 [1], §5.2.1.2, the stack pointer must be double-word-aligned at a public interface. The stack implementation being full-descending, this requires that the top of stack be double-word-aligned too. [1] http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/startup-gcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc2538/startup-gcc.c b/cpu/cc2538/startup-gcc.c index 231b83f18..e09356e4d 100644 --- a/cpu/cc2538/startup-gcc.c +++ b/cpu/cc2538/startup-gcc.c @@ -103,7 +103,7 @@ void uart1_isr(void); #endif /*---------------------------------------------------------------------------*/ /* Allocate stack space */ -static unsigned long stack[512] __attribute__ ((section(".stack"))); +static uint64_t stack[256] __attribute__ ((section(".stack"))); /*---------------------------------------------------------------------------*/ __attribute__((__section__(".vectors"))) void(*const vectors[])(void) =