*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
-__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
#define SLEEP_HASH_SIZE 17
static struct ao_list run_queue;
static struct ao_list alarm_queue;
#if HAS_TASK_QUEUE
#define SLEEP_HASH_SIZE 17
static struct ao_list run_queue;
static struct ao_list alarm_queue;
ao_list_del(&task->queue);
ao_list_append(&task->queue, &run_queue);
}
ao_list_del(&task->queue);
ao_list_append(&task->queue, &run_queue);
}
ao_list_del(&task->queue);
ao_list_append(&task->queue, ao_task_sleep_queue(wchan));
}
ao_list_del(&task->queue);
ao_list_append(&task->queue, ao_task_sleep_queue(wchan));
}
ao_list_for_each_entry(alarm, &alarm_queue, struct ao_task, alarm_queue) {
if ((int16_t) (alarm->alarm - task->alarm) >= 0) {
ao_list_insert(&task->alarm_queue, alarm->alarm_queue.prev);
ao_list_for_each_entry(alarm, &alarm_queue, struct ao_task, alarm_queue) {
if ((int16_t) (alarm->alarm - task->alarm) >= 0) {
ao_list_insert(&task->alarm_queue, alarm->alarm_queue.prev);
- ao_arch_wait_interrupt();
+ if (ao_task_minimize_latency) {
+ ao_arch_release_interrupts();
+ ao_arch_block_interrupts();
+ } else
+ ao_arch_wait_interrupt();
- printf("%12s: wchan %04x\n",
- task->name,
- (int) task->wchan);
+ printf("%2d: wchan %08x alarm %5d %s\n",
+ task->task_id,
+ (int) task->wchan,
+ task->alarm ? (int16_t) (task->alarm - now) : 9999,
+ task->name);