Zephyr API Documentation  3.6.0
A Scalable Open Source RTOS
3.6.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
77#define EXPORT_SYMBOL(x) \
78 static const STRUCT_SECTION_ITERABLE(llext_const_symbol, x ## _sym) = { \
79 .name = STRINGIFY(x), .addr = &x, \
80 }
81
82#define LL_EXTENSION_SYMBOL(x) \
83 struct llext_symbol Z_GENERIC_SECTION(".exported_sym") __used \
84 symbol_##x = {STRINGIFY(x), &x}
85
94#define EXPORT_SYSCALL(x) EXPORT_SYMBOL(z_impl_ ## x)
95
100#ifdef __cplusplus
101}
102#endif
103
104
105#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.