userspace: assign thread IDs at build time
Kernel object metadata had an extra data field added recently to store bounds for stack objects. Use this data field to assign IDs to thread objects at build time. This has numerous advantages: * Threads can be granted permissions on kernel objects before the thread is initialized. Previously, it was necessary to call k_thread_create() with a K_FOREVER delay, assign permissions, then start the thread. Permissions are still completely cleared when a thread exits. * No need for runtime logic to manage thread IDs * Build error if CONFIG_MAX_THREAD_BYTES is set too low Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
56cab64d70
commit
818a96d3af
7 changed files with 59 additions and 109 deletions
|
@ -398,11 +398,6 @@ struct _thread_base {
|
|||
/* this thread's entry in a timeout queue */
|
||||
struct _timeout timeout;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
/* Bit position in kernel object permissions bitfield for this thread */
|
||||
unsigned int perm_index;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct _thread_base _thread_base_t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue