zephyr/arch/x86/core
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
..
debug kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
offsets kernel: remove nano/micro wording and usage 2016-12-19 19:58:03 +00:00
Kconfig doc: Fix terminology in Kconfig files for 'platform' 2016-08-18 21:17:29 +00:00
Makefile kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
cache.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
cache_s.S
cpuhalt.c logging: move event_logger to subsys/logging 2016-12-25 14:34:43 -05:00
crt0.S x86: don't set segment registers if we don't set GDT 2016-11-29 14:51:57 -08:00
excstub.S kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
fatal.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
float.c kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
gdt.c kernel/arch: consolidate tTCS and TNANO definitions 2016-11-12 07:04:52 -05:00
intstub.S kernel/arch: inspect prio/sched_locked together for preemptibility 2017-01-09 20:52:25 +00:00
irq_manage.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
irq_offload.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
msr.c kernel/arch: consolidate tTCS and TNANO definitions 2016-11-12 07:04:52 -05:00
reboot_rst_cnt.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
swap.S kernel/arch: optimize memory use of some thread fields 2017-01-09 20:52:24 +00:00
sys_fatal_error_handler.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
thread.c x86: remove obsolete comment about tasks/fibers 2016-12-19 19:58:42 +00:00