1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-28 23:49:47 +01:00
RIOT/core/lib
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
..
include Merge #19712 2023-06-29 09:57:31 +00:00
assert.c core/lib: do not use DEBUG_BREAKPOINT by default 2023-06-27 17:04:27 +02:00
atomic_c11.c core: split out library code 2022-03-09 21:43:05 +01:00
atomic_sync.c core: split out library code 2022-03-09 21:43:05 +01:00
bitarithm.c bitarithm: Move extern const out of static inline functions 2022-05-29 13:59:39 +02:00
clist.c core: split out library code 2022-03-09 21:43:05 +01:00
init.c core/init: allow to run callback on main exit 2023-01-20 17:41:30 +01:00
Makefile core: split out library code 2022-03-09 21:43:05 +01:00
panic.c core/assert: print last instruction in assert() 2022-06-12 14:18:53 +02:00
priority_queue.c core: split out library code 2022-03-09 21:43:05 +01:00
ringbuffer.c core: split out library code 2022-03-09 21:43:05 +01:00
rmutex.c core: split out library code 2022-03-09 21:43:05 +01:00