7#ifndef ZEPHYR_LLEXT_SYMBOL_H
8#define ZEPHYR_LLEXT_SYMBOL_H
91#ifdef LL_EXTENSION_BUILD
93#define Z_LL_EXTENSION_SYMBOL(x) \
94 static const struct llext_const_symbol \
95 Z_GENERIC_SECTION(".exported_sym") __used \
96 __llext_sym_ ## x = { \
97 .name = STRINGIFY(x), .addr = (const void *)&x, \
101#define Z_LL_EXTENSION_SYMBOL(x)
116#define LL_EXTENSION_SYMBOL(x) Z_LL_EXTENSION_SYMBOL(x)
119#if defined(LL_EXTENSION_BUILD)
121#define Z_EXPORT_SYMBOL(x) Z_LL_EXTENSION_SYMBOL(x)
122#elif defined(CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID)
124#define Z_EXPORT_SYMBOL(x) \
125 static const char Z_GENERIC_SECTION("llext_exports_strtab") __used \
126 x ## _sym_name[] = STRINGIFY(x); \
127 static const STRUCT_SECTION_ITERABLE(llext_const_symbol, \
128 __llext_sym_ ## x) = { \
129 .name = x ## _sym_name, .addr = (const void *)&x, \
131#elif defined(CONFIG_LLEXT)
133#define Z_EXPORT_SYMBOL(x) \
134 static const STRUCT_SECTION_ITERABLE(llext_const_symbol, \
135 __llext_sym_ ## x) = { \
136 .name = STRINGIFY(x), .addr = (const void *)&x, \
140#define Z_EXPORT_SYMBOL(x)
155#define EXPORT_SYMBOL(x) Z_EXPORT_SYMBOL(x)
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
Constant symbols are unchangeable named memory addresses.
Definition symbol.h:42
const char *const name
Name of symbol.
Definition symbol.h:49
const void *const addr
Address of symbol.
Definition symbol.h:56
const uintptr_t slid
Symbol Link Identifier.
Definition symbol.h:52
Symbols are named memory addresses.
Definition symbol.h:67
const char * name
Name of symbol.
Definition symbol.h:69
void * addr
Address of symbol.
Definition symbol.h:72
A symbol table.
Definition symbol.h:81
size_t sym_cnt
Number of symbols in the table.
Definition symbol.h:83
struct llext_symbol * syms
Array of symbols.
Definition symbol.h:86