Skip to content

Commit 0a0fbc2

Browse files
committed
docs(platform): Zephyr
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
1 parent a61f22e commit 0a0fbc2

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

docs/PlatformZephyr.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Zephyr Platform
2+
3+
In Zephyr, the POSIX API is selected by the `CONFIG_POSIX_API` configuration option.
4+
5+
## WAMR
6+
7+
WAMR has built-in support for Zephyr. The WAMR integration is out of scope of the Ocre Zephyr platform.
8+
9+
Check [WAMR porting guide](https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/port_wamr.md) for more information about WAMR platform requirements.
10+
11+
## container loading
12+
13+
For loading the container into the memory, we use `open(2)`, `malloc(3)` and `read(2)`. Zephyr does not support `mmap(2)` and file streams are currently broken in Zephyr 4.3.0.
14+
15+
Check the files in `src/platform/posix/file_alloc_read.c` for implementation.
16+
17+
## user memory
18+
19+
If `CONFIG_SHARED_MULTI_HEAP` is disabled, there is no tiered memory API, these are implemented as `malloc(3)`, `realloc(3)` and `free(3)`.
20+
21+
If `CONFIG_SHARED_MULTI_HEAP` is enabled, then these are implemented as `shared_multi_heap_aligned_alloc()` with `SMH_REG_ATTR_EXTERNAL` and `shared_multi_heap_free()`.
22+
23+
Check Zephyr's [Shared Multi Heap](https://docs.zephyrproject.org/latest/kernel/memory_management/shared_multi_heap.html) documentation or [Adding a Zephyr board](AddZephyrBoard.md) documentation for more details about shared multi heap.
24+
25+
## logging
26+
27+
`log.h` just includes Zephyr's logging system, as it is transparent.
28+
29+
## config.h
30+
31+
`config.h` does not include anything, as Zephyr's `autoconf.h` is automatically included (by command line) to every `.c` file in Zephyr build.

0 commit comments

Comments
 (0)