lib: os: add sys_mutex data type

For systems without userspace enabled, these work the same
as a k_mutex.

For systems with userspace, the sys_mutex may exist in user
memory. It is still tracked as a kernel object, but has an
underlying k_mutex that is looked up in the kernel object
table.

Future enhancements will optimize sys_mutex to not require
syscalls for uncontended sys_mutexes, using atomic ops
instead.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-03-27 15:44:52 -07:00 committed by Anas Nashif
commit f0835674a3
6 changed files with 248 additions and 2 deletions

View file

@ -19,3 +19,5 @@ zephyr_sources_if_kconfig(printk.c)
zephyr_sources_if_kconfig(ring_buffer.c)
zephyr_sources_ifdef(CONFIG_ASSERT assert.c)
zephyr_sources_ifdef(CONFIG_USERSPACE mutex.c)