#define AO_NO_TASK_INDEX 0xff
-__xdata struct ao_task * __xdata ao_tasks[AO_NUM_TASKS];
-__data uint8_t ao_num_tasks;
-__xdata struct ao_task *__data ao_cur_task;
+struct ao_task * ao_tasks[AO_NUM_TASKS];
+uint8_t ao_num_tasks;
+struct ao_task *ao_cur_task;
#if !HAS_TASK_QUEUE
-static __data uint8_t ao_cur_task_index;
+static uint8_t ao_cur_task_index;
#endif
#ifdef ao_arch_task_globals
#endif /* HAS_TASK_QUEUE */
void
-ao_add_task(__xdata struct ao_task * task, void (*start)(void), __code char *name) __reentrant
+ao_add_task(struct ao_task * task, void (*start)(void), const char *name)
{
uint8_t task_id;
uint8_t t;
);
}
-__data uint8_t ao_task_minimize_latency;
+uint8_t ao_task_minimize_latency;
/* Task switching function. This must not use any stack variables */
void
if (!ao_list_is_empty(&run_queue))
break;
/* Wait for interrupts when there's nothing ready */
- ao_arch_wait_interrupt();
+ if (ao_task_minimize_latency) {
+ ao_arch_release_interrupts();
+ ao_arch_block_interrupts();
+ } else
+ ao_arch_wait_interrupt();
}
ao_cur_task = ao_list_first_entry(&run_queue, struct ao_task, queue);
#else
{
- __pdata uint8_t ao_last_task_index = ao_cur_task_index;
+ uint8_t ao_last_task_index = ao_cur_task_index;
for (;;) {
++ao_cur_task_index;
if (ao_cur_task_index == ao_num_tasks)
}
uint8_t
-ao_sleep(__xdata void *wchan)
+ao_sleep(void *wchan)
{
#if HAS_TASK_QUEUE
uint32_t flags;
}
void
-ao_wakeup(__xdata void *wchan) __reentrant
+ao_wakeup(void *wchan)
{
ao_validate_cur_stack();
#if HAS_TASK_QUEUE
}
uint8_t
-ao_sleep_for(__xdata void *wchan, uint16_t timeout)
+ao_sleep_for(void *wchan, uint16_t timeout)
{
uint8_t ret;
if (timeout) {
return ret;
}
-static __xdata uint8_t ao_forever;
+static uint8_t ao_forever;
void
ao_delay(uint16_t ticks)
ao_task_info(void)
{
uint8_t i;
- __xdata struct ao_task *task;
+ struct ao_task *task;
uint16_t now = ao_time();
for (i = 0; i < ao_num_tasks; i++) {