zephyr/kernel
Andrew Boie bca15da650 userspace: treat thread stacks as kernel objects
We need to track permission on stack memory regions like we do
with other kernel objects. We want stacks to live in a memory
area that is outside the scope of memory domain permission
management. We need to be able track what stacks are in use,
and what stacks may be used by user threads trying to call
k_thread_create().

Some special handling is needed because thread stacks appear as
variously-sized arrays of struct _k_thread_stack_element which is
just a char. We need the entire array to be considered an object,
but also properly handle arrays of stacks.

Validation of stacks also requires that the bounds of the stack
are not exceeded. Various approaches were considered. Storing
the size in some header region of the stack itself would not allow
the stack to live in 'noinit'. Having a stack object be a data
structure that points to the stack buffer would confound our
current APIs for declaring stacks as arrays or struct members.
In the end, the struct _k_object was extended to store this size.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-16 19:02:00 -07:00
..
include userspace handlers: finer control of init state 2017-10-16 19:02:00 -07:00
alert.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
compiler_stack_protect.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
device.c gen_kobject_list.py: device driver support 2017-09-29 13:25:58 -07:00
errno.c kernel: errno: Use per-thread accessor function compatible with Newlib 2017-05-10 20:54:56 -04:00
idle.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
init.c userspace: allow thread IDs to be re-used 2017-10-16 16:16:28 -07:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Kconfig kernel: add memory domain APIs 2017-09-29 16:48:53 -07:00
Kconfig.event_logger kernel: Add thread events to kernel event logger 2017-04-25 02:16:36 +00:00
Kconfig.power_mgmt doc: spelling fixes in Kconfig files 2017-06-12 19:40:51 -04:00
mailbox.c kernel: Use SYS_DLIST_FOR_EACH_CONTAINER whenever possible 2017-08-25 09:08:50 -04:00
Makefile kernel: add syscalls for k_object_access APIs 2017-10-05 12:53:41 -04:00
mem_domain.c mem_domain: fix warning when assertions enabled 2017-10-03 14:46:19 -04:00
mem_slab.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
mempool.c mem_pool: Don't check level_empty() before breaking a block 2017-07-31 09:14:59 -07:00
msg_q.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
mutex.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
pipes.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
poll.c poll: Enable multiple threads to use k_poll in the same object 2017-08-25 09:00:46 -04:00
pthread.c kernel: POSIX thread IPC support 2017-08-15 19:42:07 -04:00
queue.c poll: Enable multiple threads to use k_poll in the same object 2017-08-25 09:00:46 -04:00
sched.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
sem.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
stack.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
sys_clock.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
system_work_q.c kernel: introduce stack definition macros 2017-06-09 18:53:28 -04:00
thread_abort.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
thread.c userspace: treat thread stacks as kernel objects 2017-10-16 19:02:00 -07:00
timer.c kernel: Provide only one _SYSCALL_HANDLER() macro 2017-10-16 13:42:15 -04:00
userspace_handler.c userspace handlers: finer control of init state 2017-10-16 19:02:00 -07:00
userspace.c userspace: treat thread stacks as kernel objects 2017-10-16 19:02:00 -07:00
version.c kernel: version: no need to store version in RAM 2017-09-07 16:34:50 -07:00
work_q.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00