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:
parent
d04a7efd8d
commit
2dd91eca0e
13 changed files with 20 additions and 85 deletions
|
@ -247,25 +247,6 @@ static ALWAYS_INLINE void _new_thread_init(struct k_thread *thread,
|
|||
#endif /* CONFIG_THREAD_STACK_INFO */
|
||||
}
|
||||
|
||||
#if defined(CONFIG_THREAD_MONITOR)
|
||||
/*
|
||||
* Add a thread to the kernel's list of active threads.
|
||||
*/
|
||||
static ALWAYS_INLINE void thread_monitor_init(struct k_thread *thread)
|
||||
{
|
||||
unsigned int key;
|
||||
|
||||
key = irq_lock();
|
||||
thread->next_thread = _kernel.threads;
|
||||
_kernel.threads = thread;
|
||||
irq_unlock(key);
|
||||
}
|
||||
#else
|
||||
#define thread_monitor_init(thread) \
|
||||
do {/* do nothing */ \
|
||||
} while ((0))
|
||||
#endif /* CONFIG_THREAD_MONITOR */
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#endif /* _kernel_structs__h_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue