Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
semihost_loader.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Analog Devices, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_LLEXT_SEMIHOST_LOADER_H
8#define ZEPHYR_LLEXT_SEMIHOST_LOADER_H
9
10#include <zephyr/llext/loader.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
23
30
32 const char *filename;
33 int fd;
34 size_t total_bytes;
36};
37
39int llext_semihost_prepare(struct llext_loader *ldr);
40int llext_semihost_read(struct llext_loader *ldr, void *buf, size_t len);
41int llext_semihost_seek(struct llext_loader *ldr, size_t pos);
42void llext_semihost_finalize(struct llext_loader *ldr);
44
50#define LLEXT_SEMIHOST_LOADER(_filename) \
51 { \
52 .loader = \
53 { \
54 .prepare = llext_semihost_prepare, \
55 .read = llext_semihost_read, \
56 .seek = llext_semihost_seek, \
57 .peek = NULL, \
58 .finalize = llext_semihost_finalize, \
59 .storage = LLEXT_STORAGE_TEMPORARY, \
60 }, \
61 .filename = (_filename), \
62 .fd = -1, \
63 }
64
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* ZEPHYR_LLEXT_SEMIHOST_LOADER_H */
LLEXT ELF loader context types.
Linkable loadable extension loader context.
Definition loader.h:80
Implementation of llext_loader that reads through semihosting.
Definition semihost_loader.h:27
struct llext_loader loader
Extension loader.
Definition semihost_loader.h:29