Zephyr API Documentation
3.5.0
A Scalable Open Source RTOS
|
|
3.5.0 |
Linkable loadable extensions. More...
Modules | |
ELF data types and defines | |
ELF types and parsing. | |
LLEXT symbols | |
Linkable loadable extension symbol. | |
Linkable loadable extensions buffer loader | |
LLEXT buffer loader. | |
Loader context for llext | |
Loader context for llext. | |
Data Structures | |
struct | llext |
Linkable loadable extension. More... | |
Enumerations | |
enum | llext_mem { LLEXT_MEM_TEXT , LLEXT_MEM_DATA , LLEXT_MEM_RODATA , LLEXT_MEM_BSS , LLEXT_MEM_COUNT } |
Enum of memory regions for lookup tables. More... | |
Functions | |
sys_slist_t * | llext_list (void) |
List head of loaded extensions. | |
struct llext * | llext_by_name (const char *name) |
Find an llext by name. | |
int | llext_load (struct llext_loader *loader, const char *name, struct llext **ext) |
Load and link an extension. | |
void | llext_unload (struct llext *ext) |
Unload an extension. | |
const void *const | llext_find_sym (const struct llext_symtable *sym_table, const char *sym_name) |
Find the address for an arbitrary symbol name. | |
int | llext_call_fn (struct llext *ext, const char *sym_name) |
Call a function by name. | |
void | arch_elf_relocate (elf_rel_t *rel, uintptr_t opaddr, uintptr_t opval) |
Architecture specific function for updating op codes given a relocation. | |
Linkable loadable extensions.
enum llext_mem |
#include <zephyr/llext/llext.h>
Enum of memory regions for lookup tables.
Enumerator | |
---|---|
LLEXT_MEM_TEXT | |
LLEXT_MEM_DATA | |
LLEXT_MEM_RODATA | |
LLEXT_MEM_BSS | |
LLEXT_MEM_COUNT |
#include <zephyr/llext/llext.h>
Architecture specific function for updating op codes given a relocation.
Elf files contain a series of relocations described in a section. These relocation instructions are architecture specific and each architecture supporting extensions must implement this. They are instructions on how to rewrite opcodes given the actual placement of some symbolic data such as a section, function, or object.
[in] | rel | Relocation data provided by elf |
[in] | opaddr | Address of operation to rewrite with relocation |
[in] | opval | Value of looked up symbol to relocate |
struct llext * llext_by_name | ( | const char * | name | ) |
#include <zephyr/llext/llext.h>
Find an llext by name.
[in] | name | String name of the llext |
NULL | if no llext not found |
llext | if llext found |
int llext_call_fn | ( | struct llext * | ext, |
const char * | sym_name | ||
) |
#include <zephyr/llext/llext.h>
Call a function by name.
Expects a symbol representing a void fn(void) style function exists and may be called.
[in] | ext | Extension to call function in |
[in] | sym_name | Function name (exported symbol) in the extension |
0 | success |
-EINVAL | invalid symbol name |
const void *const llext_find_sym | ( | const struct llext_symtable * | sym_table, |
const char * | sym_name | ||
) |
#include <zephyr/llext/llext.h>
Find the address for an arbitrary symbol name.
[in] | sym_table | Symbol table to lookup symbol in, if NULL uses base table |
[in] | sym_name | Symbol name to find |
NULL | if no symbol found |
addr | Address of symbol in memory if found |
sys_slist_t * llext_list | ( | void | ) |
#include <zephyr/llext/llext.h>
List head of loaded extensions.
int llext_load | ( | struct llext_loader * | loader, |
const char * | name, | ||
struct llext ** | ext | ||
) |
#include <zephyr/llext/llext.h>
Load and link an extension.
Loads relevant ELF data into memory and provides a structure to work with it.
Only relocatable ELF files are currently supported (partially linked).
[in] | loader | An extension loader that provides input data and context |
[in] | name | A string identifier for the extension |
[out] | ext | A pointer to a statically allocated llext struct |
0 | Success |
-ENOMEM | Not enough memory |
-EINVAL | Invalid ELF stream |
void llext_unload | ( | struct llext * | ext | ) |