Skip to content

Commit d3dcf36

Browse files
dcpleungkartben
authored andcommitted
libc: newlib: heap arean to support Xtensa MPU
This adds the bits to define HEAP_BASE when using Xtensa MPU. Signed-off-by: Daniel Leung <[email protected]>
1 parent 5682a7f commit d3dcf36

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/libc/newlib/libc-hooks.c

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#include <zephyr/kernel/mm.h>
2424
#include <sys/time.h>
2525

26+
#ifdef CONFIG_XTENSA
27+
#include <xtensa/config/core-isa.h>
28+
#endif
29+
2630
int _fstat(int fd, struct stat *st);
2731
int _read(int fd, void *buf, int nbytes);
2832
int _write(int fd, const void *buf, int nbytes);
@@ -88,6 +92,9 @@ int _getpid(void);
8892
#elif defined(CONFIG_ARC)
8993
#define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, \
9094
Z_ARC_MPU_ALIGN)
95+
#elif defined(CONFIG_XTENSA)
96+
#define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, \
97+
XCHAL_MPU_ALIGN)
9198
#else
9299
#error "Unsupported platform"
93100
#endif /* CONFIG_<arch> */

0 commit comments

Comments
 (0)