1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/core/lib/include
bors[bot] 755442fe27
Merge #19712
19712: cpu/riscv: Add PMP driver r=MrKevinWeiss a=Teufelchen1

### Contribution description

Hi! 🐘 

this adds a basic RISC-V physical memory protection (PMP) driver to RIOT. Well, 'driver' might be a stretched, feels more like a little utility :)

EDIT: Also added  a no-execute RAM option for the hifive & a corresponding test

Since I only have an Hifive rev b, it's only enabled on this board / cpu. I also tested the code on an ESP32-C but the feature can't be enabled there, as `cpu/riscv_common/` is not used by the ESP32...

### Testing procedure

* Grab a hifive rev b
* go to `examples/hello-world`
* Add `USEMODULES += periph_pmp` to the `Makefile`
* Include `pmp.h` in `main.c`
* Add code e.g. `print_pmpcfg(0);`
* compile & flash & term 

You should see something like this:
```
# Hello World!
# You are running RIOT on a(n) hifive1b board.
# This board features a(n) fe310 MCU.
# pmp00cfg: - R-X OFF   0x00000000 - 0x00000000
```



Co-authored-by: Teufelchen1 <bennet.blischke@outlook.com>
2023-06-29 09:57:31 +00:00
..
macros core: move macros/math.h to core/lib/include/macros 2023-05-02 14:02:15 +02:00
assert.h core/lib: do not use DEBUG_BREAKPOINT by default 2023-06-27 17:04:27 +02:00
bitarithm.h core/bitarithm: add bitarithm_clzb() 2023-05-23 16:15:25 +02:00
cib.h core: split out library code 2022-03-09 21:43:05 +01:00
clist.h core: split out library code 2022-03-09 21:43:05 +01:00
compiler_hints.h core/compiler_hints: add may_be_zero() 2023-05-23 17:46:39 +02:00
container.h core/lib: split kernel defines by its concerns 2022-11-11 13:41:33 +01:00
debug.h debug: add DEBUG_BREAKPOINT() macro 2023-04-27 13:19:17 +02:00
irq.h cpu/cortexm_common: measure time spent with IRQ disabled 2022-11-24 21:27:20 +01:00
kernel_defines.h core/lib: split kernel defines by its concerns 2022-11-11 13:41:33 +01:00
kernel_init.h core/init: add early_init() 2023-01-08 22:25:10 +01:00
list.h core: split out library code 2022-03-09 21:43:05 +01:00
log.h core/lib: add doxygen for LOG_* macros 2022-03-10 10:15:14 +01:00
modules.h core/lib: split kernel defines by its concerns 2022-11-11 13:41:33 +01:00
panic.h cpu/riscv: Add PMP driver 2023-06-28 11:55:34 +02:00
priority_queue.h core: split out library code 2022-03-09 21:43:05 +01:00
ringbuffer.h core: split out library code 2022-03-09 21:43:05 +01:00
riot_version.h core/lib: split kernel defines by its concerns 2022-11-11 13:41:33 +01:00
rmutex.h core: split out library code 2022-03-09 21:43:05 +01:00
thread_config.h core: split out library code 2022-03-09 21:43:05 +01:00
xfa.h core/lib: drop read only XFA's const volatile modifiers 2023-05-04 10:53:08 +02:00