Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
buf_loader.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_BUF_LOADER_H
8#define ZEPHYR_LLEXT_BUF_LOADER_H
9
10#include <zephyr/llext/loader.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
30
32 const uint8_t *buf;
33 size_t len;
34 size_t pos;
36};
37
39int llext_buf_read(struct llext_loader *ldr, void *buf, size_t len);
40int llext_buf_seek(struct llext_loader *ldr, size_t pos);
41void *llext_buf_peek(struct llext_loader *ldr, size_t pos);
50#define LLEXT_BUF_LOADER(_buf, _buf_len) \
51 { \
52 .loader = \
53 { \
54 .prepare = NULL, \
55 .read = llext_buf_read, \
56 .seek = llext_buf_seek, \
57 .peek = llext_buf_peek, \
58 .finalize = NULL, \
59 }, \
60 .buf = (_buf), \
61 .len = (_buf_len), \
62 .pos = 0, \
63 }
64
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* ZEPHYR_LLEXT_BUF_LOADER_H */
LLEXT ELF loader context types.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Implementation of llext_loader that reads from a memory buffer.
Definition buf_loader.h:27
struct llext_loader loader
Extension loader.
Definition buf_loader.h:29
Linkable loadable extension loader context.
Definition loader.h:42