userspace: add support for dynamic kernel objects

A red-black tree is maintained containing the metadata for all
dynamically created kernel objects, which are allocated out of the
system heap.

Currently, k_object_alloc() and k_object_free() are supervisor-only.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-11-08 16:38:03 -08:00 committed by Andrew Boie
commit 31bdfc014e
7 changed files with 254 additions and 3 deletions

View file

@ -18,8 +18,13 @@
*(".kobject_data.text*")
_kobject_text_area_end = .;
#ifndef LINKER_PASS2
#ifdef CONFIG_DYNAMIC_OBJECTS
PROVIDE(_k_object_gperf_find = .);
PROVIDE(_k_object_gperf_wordlist_foreach = .);
#else
PROVIDE(_k_object_find = .);
PROVIDE(_k_object_wordlist_foreach = .);
#endif
#endif
. += KOBJECT_TEXT_AREA - (_kobject_text_area_end - _kobject_text_area_start);
#endif /* CONFIG_USERSPACE */