X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fao_arch_funcs.h;h=ad46ef32babf9fd52b0f9d58f08fd09e6f534275;hb=d7ef39ba104a1ac6024af875c730a645f282719f;hp=e55ecb743e5f9e4be9cce08dd24a8a69067736ca;hpb=54dd2a6e3a05b940d9daebb3d73f6876c182b3e7;p=fw%2Faltos diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index e55ecb74..ad46ef32 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -475,7 +475,7 @@ ao_arch_irq_check(void) { static inline void ao_arch_init_stack(struct ao_task *task, void *start) { - uint32_t *sp = (uint32_t *) ((void*) task->stack + AO_STACK_SIZE); + uint32_t *sp = &task->stack32[AO_STACK_SIZE>>2]; uint32_t a = (uint32_t) start; int i; @@ -493,7 +493,7 @@ ao_arch_init_stack(struct ao_task *task, void *start) /* BASEPRI with interrupts enabled */ ARM_PUSH32(sp, 0); - task->sp = sp; + task->sp32 = sp; } static inline void ao_arch_save_regs(void) { @@ -517,12 +517,12 @@ static inline void ao_arch_save_regs(void) { static inline void ao_arch_save_stack(void) { uint32_t *sp; asm("mov %0,sp" : "=&r" (sp) ); - ao_cur_task->sp = (sp); + ao_cur_task->sp32 = (sp); } static inline void ao_arch_restore_stack(void) { /* Switch stacks */ - asm("mov sp, %0" : : "r" (ao_cur_task->sp) ); + asm("mov sp, %0" : : "r" (ao_cur_task->sp32) ); #ifdef AO_NONMASK_INTERRUPTS /* Restore BASEPRI */