kernel: add common bits to support TLS

This adds the common struct fields and functions to support
the implementation of thread local storage in individual
architecture. This uses the thread stack to store TLS data.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2020-09-28 11:27:11 -07:00 committed by Andrew Boie
commit 02b20351cd
7 changed files with 97 additions and 0 deletions

View file

@ -365,6 +365,11 @@ struct k_thread {
/** resource pool */
struct k_mem_pool *resource_pool;
#if defined(CONFIG_THREAD_LOCAL_STORAGE)
/* Pointer to arch-specific TLS area */
uintptr_t tls;
#endif /* CONFIG_THREAD_LOCAL_STORAGE */
/** arch-specifics: must always be at the end */
struct _thread_arch arch;
};