From 76cfdc33b19e48e684a85ef2df4c576191c9a6ff Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 19 Dec 2013 11:34:59 +0100 Subject: [PATCH] stack alignment workaround Should be fixed in thread.c instead, this is just a temporary workaround to enable msp-430 threads in the mean time. --- cpu/msp430-common/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/msp430-common/cpu.c b/cpu/msp430-common/cpu.c index c9e854c430..93db47410b 100644 --- a/cpu/msp430-common/cpu.c +++ b/cpu/msp430-common/cpu.c @@ -53,6 +53,10 @@ __attribute__((section (".fini9"))) void __main_epilogue(void) { __asm__("ret"); char *thread_stack_init(void (*task_func)(void), void *stack_start, int stack_size) { unsigned short *stk; + + /* XXX: work around for misalignment, remove once solved properly in thread.c */ + stack_size--; + stk = (unsigned short *)(stack_start + stack_size); *stk = (unsigned short) sched_task_exit;