kernel: userspace: reserve stack space to store local data
This enables reserving little space on the top of stack to store data local to thread when CONFIG_USERSPACE. The first customer of this is errno. Note that ARC, due to how it lays out the user stack and privilege stack, sets the pointer itself rather than relying on the common way. Fixes: #9067 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
a5f7e3345b
commit
fc182430c0
5 changed files with 54 additions and 10 deletions
|
@ -29,7 +29,7 @@ int *_impl_z_errno(void)
|
|||
/* Initialized to the lowest address in the stack so the thread can
|
||||
* directly read/write it
|
||||
*/
|
||||
return _current->errno_location;
|
||||
return &_current->userspace_local_data->errno_var;
|
||||
}
|
||||
|
||||
Z_SYSCALL_HANDLER0_SIMPLE(z_errno);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue