-#define ao_arch_task_members\
- uint8_t *sp; /* saved stack pointer */
-
-#define ao_arch_init_stack(task, start) do { \
- uint8_t *sp = task->stack + AO_STACK_SIZE - 1; \
- uint16_t a = (uint16_t) start; \
- int i; \
- \
- /* Return address */ \
- AVR_PUSH8(sp, a); \
- AVR_PUSH8(sp, (a >> 8)); \
- \
- /* Clear register values */ \
- i = 32; \
- while (i--) \
- AVR_PUSH8(sp, 0); \
- \
- /* SREG with interrupts enabled */ \
- AVR_PUSH8(sp, 0x80); \
- task->sp = sp; \
-} while (0);
+#define ao_arch_init_stack(task, sp, start) \
+ do { \
+ uint16_t a = (uint16_t) start; \
+ int i; \
+ \
+ /* Return address */ \
+ AVR_PUSH8(sp, a); \
+ AVR_PUSH8(sp, (a >> 8)); \
+ \
+ /* Clear register values */ \
+ i = 32; \
+ while (i--) \
+ AVR_PUSH8(sp, 0); \
+ \
+ /* SREG with interrupts enabled */ \
+ AVR_PUSH8(sp, 0x80); \
+ task->sp8 = sp; \
+ } while (0);