zephyr/arch
Andy Ross 8606fabf74 kernel: Scheduler refactoring: use _reschedule_*() always
There was a somewhat promiscuous pattern in the kernel where IPC
mechanisms would do something that might effect the current thread
choice, then check _must_switch_threads() (or occasionally
__must_switch_threads -- don't ask, the distinction is being replaced
by real English words), sometimes _is_in_isr() (but not always, even
in contexts where that looks like it would be a mistake), and then
call _Swap() if everything is OK, otherwise releasing the irq_lock().
Sometimes this was done directly, sometimes via the inverted test,
sometimes (poll, heh) by doing the test when the thread state was
modified and then needlessly passing the result up the call stack to
the point of the _Swap().

And some places were just calling _reschedule_threads(), which did all
this already.

Unify all this madness.  The old _reschedule_threads() function has
split into two variants: _reschedule_yield() and
_reschedule_noyield().  The latter is the "normal" one that respects
the cooperative priority of the current thread (i.e. it won't switch
out even if there is a higher priority thread ready -- the current
thread has to pend itself first), the former is used in the handful of
places where code was doing a swap unconditionally, just to preserve
precise behavior across the refactor.  I'm not at all convinced it
should exist...

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-04-24 03:57:20 +05:30
..
arc arch: arc: add the support of STACK_SENTINEL 2018-04-17 10:50:12 -07:00
arm kernel: Scheduler refactoring: use _reschedule_*() always 2018-04-24 03:57:20 +05:30
common drivers/interrupt_controller: Introduce multi-level interrupt support 2018-02-06 22:39:05 -05:00
nios2 cleanup: replace old jira numbers with GH issues 2018-03-26 13:13:04 -04:00
posix kernel: Scheduler refactoring: use _reschedule_*() always 2018-04-24 03:57:20 +05:30
riscv32 arch: riscv32: fe310: Always-On domain adress definition 2018-04-05 08:08:08 -05:00
x86 arch/quark_se: Enable SPI port 2 as a slave only 2018-04-04 19:02:35 +02:00
xtensa xtensa, kernel/sched: Move next switch_handle selection to the scheduler 2018-03-18 16:58:12 -04:00
CMakeLists.txt
Kconfig arch: arc: Use DTS for all ARC SoCs 2018-03-23 10:13:53 +01:00