Browse Source

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 <daniel.leung@intel.com>
pull/89380/head
Daniel Leung 3 months ago committed by Benjamin Cabé
parent
commit
d3dcf36897
  1. 7
      lib/libc/newlib/libc-hooks.c

7
lib/libc/newlib/libc-hooks.c

@ -23,6 +23,10 @@
#include <zephyr/kernel/mm.h> #include <zephyr/kernel/mm.h>
#include <sys/time.h> #include <sys/time.h>
#ifdef CONFIG_XTENSA
#include <xtensa/config/core-isa.h>
#endif
int _fstat(int fd, struct stat *st); int _fstat(int fd, struct stat *st);
int _read(int fd, void *buf, int nbytes); int _read(int fd, void *buf, int nbytes);
int _write(int fd, const void *buf, int nbytes); int _write(int fd, const void *buf, int nbytes);
@ -88,6 +92,9 @@ int _getpid(void);
#elif defined(CONFIG_ARC) #elif defined(CONFIG_ARC)
#define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, \ #define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, \
Z_ARC_MPU_ALIGN) Z_ARC_MPU_ALIGN)
#elif defined(CONFIG_XTENSA)
#define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, \
XCHAL_MPU_ALIGN)
#else #else
#error "Unsupported platform" #error "Unsupported platform"
#endif /* CONFIG_<arch> */ #endif /* CONFIG_<arch> */

Loading…
Cancel
Save