Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Linkable loadable extension loader context. More...

#include <loader.h>

Data Fields

int(* prepare )(struct llext_loader *ldr)
 Optional function to prepare the loader for loading extension.
 
int(* read )(struct llext_loader *ldr, void *out, size_t len)
 Function to read (copy) from the loader.
 
int(* seek )(struct llext_loader *ldr, size_t pos)
 Function to seek to a new absolute location in the stream.
 
void *(* peek )(struct llext_loader *ldr, size_t pos)
 Optional function to peek at an absolute location in the ELF.
 
void(* finalize )(struct llext_loader *ldr)
 Optional function to clean after the extension has been loaded or error occurred.
 

Detailed Description

Linkable loadable extension loader context.

This object is used to access the ELF file data and cache its contents while an extension is being loaded by the LLEXT subsystem. Once the extension is loaded, this object is no longer needed.

Field Documentation

◆ finalize

void(* llext_loader::finalize) (struct llext_loader *ldr)

Optional function to clean after the extension has been loaded or error occurred.

Parameters
[in]ldrLoader

◆ peek

void *(* llext_loader::peek) (struct llext_loader *ldr, size_t pos)

Optional function to peek at an absolute location in the ELF.

Return a pointer to the buffer at specified offset.

Parameters
[in]ldrLoader
[in]posPosition to obtain a pointer to
Returns
a pointer into the buffer or NULL if not supported

◆ prepare

int(* llext_loader::prepare) (struct llext_loader *ldr)

Optional function to prepare the loader for loading extension.

Parameters
[in]ldrLoader
Returns
0 on success, or a negative error.

◆ read

int(* llext_loader::read) (struct llext_loader *ldr, void *out, size_t len)

Function to read (copy) from the loader.

Copies len bytes into buf from the current position of the loader.

Parameters
[in]ldrLoader
[in]outOutput location
[in]lenLength to copy into the output location
Returns
0 on success, or a negative error code.

◆ seek

int(* llext_loader::seek) (struct llext_loader *ldr, size_t pos)

Function to seek to a new absolute location in the stream.

Changes the location of the loader position to a new absolute given position.

Parameters
[in]ldrLoader
[in]posPosition in stream to move loader
Returns
0 on success, or a negative error code.

The documentation for this struct was generated from the following file: