summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-20 20:56:01 -0800
committerKeith Packard <keithp@keithp.com>2016-11-20 20:56:01 -0800
commit83cfc271e37f568cb1d821cf6a96750f3ca3854c (patch)
tree7e2f2811c3f65d1867067494a054e1e802da2f58
parent4ab6776034aeb9837b30e581526aeda07eebc6fe (diff)
altos: Don't wait while idle if trying to minimize interrupt latency
Keeping the scanout running reasonably means keeping interrupt latency constant, and that requires leaving the CPU running. Don't wait for interrupts when the system is running in this mode. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/kernel/ao_task.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/kernel/ao_task.c b/src/kernel/ao_task.c
index e8a092aa..de23ea02 100644
--- a/src/kernel/ao_task.c
+++ b/src/kernel/ao_task.c
@@ -373,7 +373,11 @@ ao_yield(void) ao_arch_naked_define
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