rust-embedded / riscv

Low level access to RISC-V processors
818 stars 160 forks source link

`riscv-rt`: Machine + Supervisor mixed executable #192

Open ZhekaS opened 5 months ago

ZhekaS commented 5 months ago

As far as I understand the crates can be compiled with S-mode support, but in that case the assumption will be that it starts and always runs in S-mode. Is the following use-case supported or any plans for it to be supported: 1) The execution starts in M-mode, certain M-only setup is done (like PMP config etc) 2) The privilege level drops to S-mode for a regular execution flow 3) ECALLs from S-mode are served in M-mode

romancardenas commented 5 months ago

We have no plans for this, but it could be interesting to discuss it. If you like, you could use this issue as an RFC to start developing/shaping how the functionality you propose should look like.