zephyr/include/linker/kobject-text.ld
Andrew Boie 31bdfc014e 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>
2018-04-24 12:27:54 -07:00

31 lines
932 B
Text

#ifndef KOBJECT_TEXT_AREA
#if ! defined(CONFIG_SIZE_OPTIMIZATIONS) || defined(CONFIG_STACK_CANARIES)
#define KOBJECT_TEXT_AREA 256
#else
#define KOBJECT_TEXT_AREA 128
#endif
#endif
#ifdef CONFIG_USERSPACE
/* We need to reserve room for the gperf generated hash functions.
* Fortunately, unlike the data tables, the size of the code is
* reasonably predictable.
*
* The linker will error out complaining that the location pointer
* is moving backwards if the reserved room isn't large enough.
*/
_kobject_text_area_start = .;
*(".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 */