Zephyr Project API 3.7.0
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 .read = llext_buf_read, \
54 .seek = llext_buf_seek, \
55 .peek = llext_buf_peek, \
56 }, \
57 .buf = (_buf), \
58 .len = (_buf_len), \
59 .pos = 0 \
60 }
61
66#ifdef __cplusplus
67}
68#endif
69
70#endif /* ZEPHYR_LLEXT_BUF_LOADER_H */
LLEXT ELF loader context types.
static int pos
Definition printk.c:11
__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