altos/stm32f4: Align stack to 8 bytes
authorKeith Packard <keithp@keithp.com>
Wed, 12 Sep 2018 01:46:52 +0000 (18:46 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 13 Oct 2018 15:23:25 +0000 (08:23 -0700)
This makes sure that doubles are aligned properly when passed on the stack.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_task.h
src/stm32f4/ao_arch.h

index f3789fa2cd2725a6fd3207561e124263815ed530..709e10c60ce6f602a832a5b2396ee07390eeaaf1 100644 (file)
 #endif
 
 /* arm stacks must be 32-bit aligned */
+#ifndef AO_STACK_ALIGNMENT
 #ifdef __arm__
 #define AO_STACK_ALIGNMENT __attribute__ ((aligned(4)))
-#endif
-#ifdef SDCC
+#else
 #define AO_STACK_ALIGNMENT
 #endif
-#ifdef __AVR__
-#define AO_STACK_ALIGNMENT
 #endif
 
 /* An AltOS task */
index 73eb793fbd0164b5657e4285db724bdb0dd1511a..d4c78f603dc32e04b0dacf6e1dca1c040b792281 100644 (file)
 #include <stm32f4.h>
 
 #ifndef AO_STACK_SIZE
-#define AO_STACK_SIZE  512
+#define AO_STACK_SIZE  1024
 #endif
 
+#define AO_STACK_ALIGNMENT __attribute__ ((aligned(8)))
+
 #define AO_PORT_TYPE   uint16_t
 
 #define ao_arch_nop()          asm("nop")