Memory protection and picolibc global state
I'm continuing to develop picolibc (https://github.com/picolibc) support
for Zephyr under this PR:
I'm running the sanity checks under qemu on mps2_an521 which uses the
ARM MPU. On this board, the default memory protection configuration
seems to place all libc globals in a region which is protected against
application access. That includes globals used in managing the malloc
heap, and so application calls to malloc end up generating a MPU fault.
I can fix this in at least a couple of possible ways:
1) Create per-thread malloc heaps and track malloc per-thread.
2) Figure out how to change protection for libc globals
3) Replace the picolibc malloc implementation with a Zephyr custom