Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: fix CONFIG_THREAD_NAME from user mode.
This mechanism had multiple problems: - Missing parameter documentation strings. - Multiple calls to k_thread_name_set() from user mode would leak memory, since the copied string was never freed - k_thread_name_get() returns memory to user mode with no guarantees on whether user mode can actually read it; in the case where the string was in thread resource pool memory (which happens when k_thread_name_set() is called from user mode) it would never be readable. - There was no test case coverage for these functions from user mode. To properly fix this, thread objects now have a buffer region reserved specifically for the thread name. Setting the thread name copies the string into the buffer. Getting the thread name with k_thread_name_get() still returns a pointer, but the system call has been removed. A new API k_thread_name_copy() is introduced to copy the thread name into a destination buffer, and a system call has been provided for that instead. We now have full test case coverge for these APIs in both user and supervisor mode. Some of the code has been cleaned up to place system call handler functions in proximity with their implementations. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
- Loading branch information
1 parent
1ee0170
commit 38129ce
Showing
6 changed files
with
229 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.