44#define LLEXT_MEM_PARTITIONS (LLEXT_MEM_BSS+1)
55#ifdef CONFIG_USERSPACE
126#define LLEXT_LOAD_PARAM_DEFAULT {.relocate_local = true,}
int llext_iterate(int(*fn)(struct llext *ext, void *arg), void *arg)
Iterate overall registered llext instances.
const void *const llext_find_sym(const struct llext_symtable *sym_table, const char *sym_name)
Find the address for an arbitrary symbol name.
ssize_t llext_find_section(struct llext_loader *loader, const char *search_name)
Find an ELF section.
void arch_elf_relocate_local(struct llext_loader *loader, struct llext *ext, elf_rela_t *rel, size_t got_offset)
Architecture specific function for updating addresses via relocation table.
int llext_add_domain(struct llext *ext, struct k_mem_domain *domain)
Add the known memory partitions of the extension to a memory domain.
#define LLEXT_MEM_PARTITIONS
Definition: llext.h:44
llext_mem
List of ELF regions that are stored or referenced in the llext.
Definition: llext.h:31
int llext_load(struct llext_loader *loader, const char *name, struct llext **ext, struct llext_load_param *ldr_parm)
Load and link an extension.
struct llext * llext_by_name(const char *name)
Find an llext by name.
void arch_elf_relocate(elf_rela_t *rel, uintptr_t opaddr, uintptr_t opval)
Architecture specific function for updating op codes given a relocation.
int llext_unload(struct llext **ext)
Unload an extension.
int llext_call_fn(struct llext *ext, const char *sym_name)
Call a function by name.
@ LLEXT_MEM_SYMTAB
Definition: llext.h:37
@ LLEXT_MEM_SHSTRTAB
Definition: llext.h:39
@ LLEXT_MEM_TEXT
Definition: llext.h:32
@ LLEXT_MEM_DATA
Definition: llext.h:33
@ LLEXT_MEM_BSS
Definition: llext.h:35
@ LLEXT_MEM_RODATA
Definition: llext.h:34
@ LLEXT_MEM_COUNT
Definition: llext.h:41
@ LLEXT_MEM_STRTAB
Definition: llext.h:38
@ LLEXT_MEM_EXPORT
Definition: llext.h:36
struct _snode sys_snode_t
Single-linked list node structure.
Definition: slist.h:39
__SIZE_TYPE__ ssize_t
Definition: types.h:28
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105
Memory Domain.
Definition: mem_domain.h:80
Memory Partition.
Definition: mem_domain.h:55
llext loader parameters
Definition: llext.h:121
bool relocate_local
Should local relocation be performed.
Definition: llext.h:123
Linkable loadable extension loader context.
Definition: loader.h:29
A symbol table.
Definition: symbol.h:60
Linkable loadable extension.
Definition: llext.h:51
size_t mem_size[LLEXT_MEM_COUNT]
Size of each stored section.
Definition: llext.h:72
struct llext_symtable sym_tab
Definition: llext.h:84
char name[16]
Name of the llext.
Definition: llext.h:63
size_t alloc_size
Total llext allocation size.
Definition: llext.h:75
unsigned int use_count
Extension use counter, prevents unloading while in use.
Definition: llext.h:90
bool mem_on_heap[LLEXT_MEM_COUNT]
Is the memory for this section allocated on heap?
Definition: llext.h:69
struct llext_symtable exp_tab
Exported symbols from the llext, may be linked against by other llext.
Definition: llext.h:87
void * mem[LLEXT_MEM_COUNT]
Lookup table of llext memory regions.
Definition: llext.h:66