Zephyr API Documentation  3.6.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
29
31 const uint8_t *buf;
32 size_t len;
33 size_t pos;
35};
36
38int llext_buf_read(struct llext_loader *ldr, void *buf, size_t len);
39int llext_buf_seek(struct llext_loader *ldr, size_t pos);
40void *llext_buf_peek(struct llext_loader *ldr, size_t pos);
49#define LLEXT_BUF_LOADER(_buf, _buf_len) \
50 { \
51 .loader = { \
52 .read = llext_buf_read, \
53 .seek = llext_buf_seek, \
54 .peek = llext_buf_peek, \
55 }, \
56 .buf = (_buf), \
57 .len = (_buf_len), \
58 .pos = 0 \
59 }
60
65#ifdef __cplusplus
66}
67#endif
68
69#endif /* ZEPHYR_LLEXT_BUF_LOADER_H */
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
An extension loader from a provided buffer containing an ELF.
Definition: buf_loader.h:26
struct llext_loader loader
Extension loader.
Definition: buf_loader.h:28
Linkable loadable extension loader context.
Definition: loader.h:29