summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-20 20:56:01 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:22:21 -0800
commit992eee8e0b4c6c774f3355af107fb422019ff4e5 (patch)
tree9c97cdf409d6d36c28e2c1cd79617867d5f81bd5 /src
parentf0c187dd6479996b83f85b6decf303ec0fc70fe5 (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>
Diffstat (limited to 'src')
-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