Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
fs_loader.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 BayLibre SAS
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_LLEXT_FS_LOADER_H
8#define ZEPHYR_LLEXT_FS_LOADER_H
9
10#include <zephyr/llext/loader.h>
11#include <zephyr/fs/fs.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
31
33 bool is_open;
34 const char *name;
35 struct fs_file_t file;
37};
38
40int llext_fs_prepare(struct llext_loader *ldr);
41int llext_fs_read(struct llext_loader *ldr, void *buf, size_t len);
42int llext_fs_seek(struct llext_loader *ldr, size_t pos);
43void llext_fs_finalize(struct llext_loader *ldr);
51#define LLEXT_FS_LOADER(_filename) \
52 { \
53 .loader = \
54 { \
55 .prepare = llext_fs_prepare, \
56 .read = llext_fs_read, \
57 .seek = llext_fs_seek, \
58 .peek = NULL, \
59 .finalize = llext_fs_finalize, \
60 }, \
61 .is_open = false, \
62 .name = (_filename), \
63 }
64
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* ZEPHYR_LLEXT_FS_LOADER_H */
LLEXT ELF loader context types.
File object representing an open file.
Definition fs_interface.h:76
Implementation of llext_loader that reads from a filesystem.
Definition fs_loader.h:28
struct llext_loader loader
Extension loader.
Definition fs_loader.h:30
Linkable loadable extension loader context.
Definition loader.h:42