From: Keith Packard Date: Wed, 12 Sep 2018 01:46:52 +0000 (-0700) Subject: altos/stm32f4: Align stack to 8 bytes X-Git-Tag: 1.9~27^2~29 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=23075d174d2bff8ff3f3deef3c3d90b83da6bd2e altos/stm32f4: Align stack to 8 bytes This makes sure that doubles are aligned properly when passed on the stack. Signed-off-by: Keith Packard --- diff --git a/src/kernel/ao_task.h b/src/kernel/ao_task.h index f3789fa2..709e10c6 100644 --- a/src/kernel/ao_task.h +++ b/src/kernel/ao_task.h @@ -27,14 +27,12 @@ #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 */ diff --git a/src/stm32f4/ao_arch.h b/src/stm32f4/ao_arch.h index 73eb793f..d4c78f60 100644 --- a/src/stm32f4/ao_arch.h +++ b/src/stm32f4/ao_arch.h @@ -19,9 +19,11 @@ #include #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")