kernel: support using thread local storage for errno
This enables storing errno in the thread local storage area. With this enabled, a syscall to access errno can be avoided when userspace is also enabled. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
2c8625ea7e
commit
62cf1960ad
5 changed files with 35 additions and 3 deletions
|
@ -266,7 +266,9 @@ struct _mem_domain_info {
|
|||
|
||||
#ifdef CONFIG_THREAD_USERSPACE_LOCAL_DATA
|
||||
struct _thread_userspace_local_data {
|
||||
#if defined(CONFIG_ERRNO) && !defined(CONFIG_ERRNO_IN_TLS)
|
||||
int errno_var;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -329,7 +331,7 @@ struct k_thread {
|
|||
struct _thread_userspace_local_data *userspace_local_data;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ERRNO
|
||||
#if defined(CONFIG_ERRNO) && !defined(CONFIG_ERRNO_IN_TLS)
|
||||
#ifndef CONFIG_USERSPACE
|
||||
/** per-thread errno variable */
|
||||
int errno_var;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue