kernel: move thread monitor init to common code

The original implementation of CONFIG_THREAD_MONITOR would
try to leverage a thread's initial stack layout to provide
the entry function with arguments for any given thread.

This is problematic:

- Some arches do not have a initial stack layout suitable for
this
- Some arches never enabled this at all (riscv32, nios2)
- Some arches did not enable this properly
- Dropping to user mode would erase or provide incorrect
information.

Just spend a few extra bytes to store this stuff directly
in the k_thread struct and get rid of all the arch-specific
code for this.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2018-06-06 08:45:01 -07:00 committed by Anas Nashif
commit 2dd91eca0e
13 changed files with 20 additions and 85 deletions

View file

@ -77,10 +77,7 @@ void _new_thread(struct k_thread *thread, k_thread_stack_t *stack,
thread->callee_saved.thread_status = (u32_t)thread_status;
posix_new_thread(thread_status);
thread_monitor_init(thread);
}
void posix_new_thread_pre_start(void)