zephyr/kernel
Benjamin Walsh 168695c7ef kernel/arch: inspect prio/sched_locked together for preemptibility
These two fields in the thread structure control the preemptibility of a
thread.

sched_locked is decremented when the scheduler gets locked, which means
that the scheduler is locked for values 0xff to 0x01, since it can be
locked recursively. A thread is coop if its priority is negative, thus
if the prio field value is 0x80 to 0xff when looked at as an unsigned
value.

By putting them end-to-end, this means that a thread is non-preemptible
if the bundled value is greater than or equal to 0x0080. This is the
only thing the interrupt exit code has to check to decide to try a
reschedule or not.

Change-Id: I902d36c14859d0d7a951a6aa1bea164613821aca
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2017-01-09 20:52:25 +00:00
..
configs kernel: add LEGACY_KERNEL option 2017-01-09 19:42:13 +00:00
include kernel/arch: inspect prio/sched_locked together for preemptibility 2017-01-09 20:52:25 +00:00
Kconfig kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
Kconfig.event_logger kernel: kconfig: move event logger options into file 2016-12-19 19:58:37 +00:00
Kconfig.power_mgmt kernel: kconfig: move power management options out 2016-12-19 19:58:37 +00:00
Makefile logging: move event_logger to subsys/logging 2016-12-25 14:34:43 -05:00
alert.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
atomic_c.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
compiler_stack_protect.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
device.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
errno.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
fifo.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
idle.c kernel: fix all nanokernel usage in comments 2016-12-21 18:45:03 +00:00
init.c kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
int_latency_bench.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
legacy_offload.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
legacy_timer.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
lifo.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
mailbox.c kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
mem_pool.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
mem_slab.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
msg_q.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
mutex.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
pipes.c kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
sched.c kernel: do not use sys_dlist_insert_at() in _pend_thread() 2017-01-06 17:32:26 +00:00
sem.c kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
stack.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
sys_clock.c kernel: optimize ms-to-ticks for certain tick frequencies 2016-12-21 19:50:07 +00:00
system_work_q.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
thread.c kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
thread_abort.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
timer.c tracing: rename CONFIG_DEBUG_TRACING_KERNEL_OBJECTS 2016-12-19 14:59:35 -05:00
version.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
work_q.c kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00