1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/core
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 core/thread: drop unused thread_arch_t 2023-05-21 22:17:52 +02:00
lib Merge #19712 2023-06-29 09:57:31 +00:00
cond.c core/*: realign ENABLE_DEBUG 2020-10-23 00:45:56 +02:00
doc.txt core/doc: fix alignment 2020-04-21 15:10:56 +02:00
Kconfig core: add core_mutex_debug to aid debugging deadlocks 2023-04-25 15:10:34 +02:00
Makefile core/thread, mutex: provide dummy implementation for riotboot 2022-05-02 13:18:39 +02:00
mbox.c core/mbox: fix race condition 2022-11-22 22:35:13 +01:00
msg_bus.c core: Access internal vars via helper funcs 2020-08-06 16:47:33 +02:00
msg.c core: replace RIOT_FILE_RELATIVE with __FILE__ 2022-11-19 01:48:42 +01:00
mutex.c core: add core_mutex_debug to aid debugging deadlocks 2023-04-25 15:10:34 +02:00
sched.c core/sched.c: fix undefined behavior on 8-bit/16-bit 2022-09-09 21:55:17 +02:00
thread_flags.c core: apply uncrustify patches 2021-02-02 22:21:14 +01:00
thread.c core/thread: Fix up stack and TLS alignments 2023-03-04 01:18:36 -08:00