zephyr/kernel
Andy Ross 8bc3b6f673 arch/x86/intel64: Fix assumption with dummy threads
The intel64 switch implementation doesn't actually use a switch handle
per se, just the raw thread struct pointers which get stored into the
handle field.  This works fine for normally initialized threads, but
when switching out of a dummy thread at initialization, nothing has
initialized that field and the code was dumping registers into the
bottom of memory through the resulting NULL pointer.

Fix this by skipping the load of the field value and just using an
offset instead to get the struct address, which is actually slightly
faster anyway (a SUB immediate instruction vs. the load).

Actually for extra credit we could even move the switch_handle field
to the top of the thread struct and eliminate the instruction
entirely, though if we did that it's probably worth adding some
conditional code to make the switch_handle field disappear entirely.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-10-19 12:09:32 -07:00
..
include arch/x86/intel64: Fix assumption with dummy threads 2019-10-19 12:09:32 -07:00
atomic_c.c kernel: fix the bug in atomic_c.c 2019-09-26 21:13:20 -04:00
CMakeLists.txt
compiler_stack_protect.c kernel: Fix gcc-9.2 warning with _StackCheckHandler 2019-10-04 05:22:30 -07:00
device.c [Code coverage]: Fix the issue of function code coverage in device.c. 2019-09-17 12:35:30 +08:00
errno.c userspace: Support for split 64 bit arguments 2019-09-12 11:31:50 +08:00
fatal.c kernel: remove vestigal printk references 2019-10-01 16:15:06 -05:00
futex.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
idle.c kernel: rename boot time globals 2019-09-30 15:25:55 -04:00
init.c logging: abstract log_core_init() 2019-10-01 09:24:02 -04:00
Kconfig kernel/Kconfig: clamp number of CPUs to 4 2019-10-07 19:46:55 -04:00
Kconfig.power_mgmt
mailbox.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
mem_domain.c userspace: adjust arch memory domain interface 2019-08-05 13:25:50 +02:00
mem_slab.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
mempool.c k_mem_pool_alloc(): remove dead code 2019-10-04 18:43:33 -07:00
msg_q.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
mutex.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
pipes.c kernel/thread: Must always initialize is_idle field 2019-09-26 16:54:06 -04:00
poll.c kernel: Introduce k_work_poll 2019-10-04 17:15:17 +02:00
queue.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
sched.c tracing: simplify idle thread detection 2019-09-30 15:25:55 -04:00
sem.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
smp.c
stack.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
system_work_q.c
thread_abort.c kernel: renamespace z_is_in_isr() 2019-09-30 15:25:55 -04:00
thread.c kernel: remove vestigal printk references 2019-10-01 16:15:06 -05:00
timeout.c kernel/timeout: Fix timeslicing edge case in SMP 2019-09-26 16:54:06 -04:00
timer.c kernel: rename thread return value functions 2019-09-30 15:25:55 -04:00
userspace_handler.c kernel: remove vestigal printk references 2019-10-01 16:15:06 -05:00
userspace.c kernel: remove vestigal printk references 2019-10-01 16:15:06 -05:00
version.c
work_q.c coccinelle: standardize k_thread create/define calls with integer timeouts 2019-10-09 08:38:10 -04:00