zephyr/kernel/nanokernel
Benjamin Walsh 2858cbf829 idle: fix tasks waiting when NANO_TIMEOUTS is enabled
Fix an issue where, if a task is pending on a nano timeout, the duration
it wants to wait is not taken into account by the tickless idle code.
This could cause a system to wait forever, or to the limit of the timer
hardware (which is forever, for all intents and purposes).

This fix is to add one field in the nanokernel data structure for one
task to record the amount of ticks it will wait on a nano timeout. Only
one task has to be able to record this information, since, these waits
being looping busy waits, the task of highest priority is the only task
that can be actively waiting with a nano timeout. If a task of lower
priority was previously waiting, and a new task is now waiting, it means
that the wait of the original task has been interrupted, which will
cause said task to run the busy loop on the object again when it gets
scheduled, and the number of ticks it wants to wait has to be recomputed
and recorded again.

Change-Id: Ibcf0f288fc42d96897642cfee00ab7359716703f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
..
include idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
compiler_stack_protect.c Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
device.c checkpatch: warning - line_spacing 2016-02-05 20:24:33 -05:00
event_logger.c nano_sema: Simplify nano_xxx_sem_take() API family 2016-02-05 20:25:14 -05:00
idle.c idle: add support for nanokernel tickless idle 2016-02-05 20:25:13 -05:00
int_latency_bench.c x86: streamline irq_lock()/irq_unlock() 2016-02-05 20:25:13 -05:00
Kconfig kconfig: Fix INT_LATENCY_BENCHMARK description 2016-02-05 20:25:13 -05:00
kernel_event_logger.c Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
Makefile x86: streamline irq_lock()/irq_unlock() 2016-02-05 20:25:13 -05:00
nano_context.c Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
nano_fiber.c kernel: rename _nano_fiber_schedule() 2016-02-05 20:24:53 -05:00
nano_fifo.c idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
nano_init.c idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
nano_lifo.c idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
nano_sema.c idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
nano_sleep.c idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
nano_stack.c nano_stack: Simplify nano_xxx_stack_pop() API family 2016-02-05 20:25:14 -05:00
nano_sys_clock.c idle: fix tasks waiting when NANO_TIMEOUTS is enabled 2016-02-05 20:25:24 -05:00
nano_timer.c nano_timers: Simplify nano_xxx_timer_test() API family 2016-02-05 20:25:15 -05:00
ring_buffer.c checkpatch: error - spacing 2016-02-05 20:24:31 -05:00
version.c Change BSD-3 licenses to Apache 2 2016-02-05 20:24:29 -05:00