Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
symbol.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_LLEXT_SYMBOL_H
8#define ZEPHYR_LLEXT_SYMBOL_H
9
11#include <zephyr/toolchain.h>
12#include <stddef.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
33 const char *const name;
34
36 const void *const addr;
37};
38
48 const char *name;
49
51 void *addr;
52};
53
54
62 size_t sym_cnt;
63
66};
67
68
78#define EXPORT_SYMBOL(x) \
79 static const STRUCT_SECTION_ITERABLE(llext_const_symbol, x ## _sym) = { \
80 .name = STRINGIFY(x), .addr = (const void *)&x, \
81 }
82
92#define LL_EXTENSION_SYMBOL(x) \
93 static const struct llext_const_symbol \
94 Z_GENERIC_SECTION(".exported_sym") __used \
95 x ## _sym = { \
96 .name = STRINGIFY(x), .addr = (const void *)&x, \
97 }
98
103#ifdef __cplusplus
104}
105#endif
106
107
108#endif /* ZEPHYR_LLEXT_SYMBOL_H */
Constant symbols are unchangeable named memory addresses.
Definition: symbol.h:31
const char *const name
Name of symbol.
Definition: symbol.h:33
const void *const addr
Address of symbol.
Definition: symbol.h:36
Symbols are named memory addresses.
Definition: symbol.h:46
const char * name
Name of symbol.
Definition: symbol.h:48
void * addr
Address of symbol.
Definition: symbol.h:51
A symbol table.
Definition: symbol.h:60
size_t sym_cnt
Number of symbols in the table.
Definition: symbol.h:62
struct llext_symbol * syms
Array of symbols.
Definition: symbol.h:65
Macros to abstract toolchain specific capabilities.