-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New MECALL backend #10
base: main
Are you sure you want to change the base?
Conversation
riscv-slic/src/api.rs
Outdated
@@ -79,6 +81,20 @@ pub unsafe fn set_priority<I: crate::InterruptNumber>(interrupt: I, priority: u8 | |||
} | |||
|
|||
/// Stabilized API for pending a software interrupt on the SLIC. | |||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like this should be an unsafe
function, because of all the human-checked prerequisites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the mecall-backend
export code so it now makes sure that the mepc
register is not neglected. In this way, users can now call pend
safely outside and inside interrupt handlers.
3875ed5
to
3bb7af7
Compare
I think the mecall version should be built in CI. I'd like to see an RP235x example too and I'll try and look at that when I have time. |
Will do! I have bought a couple of RP Pico 2 boards, so I will also do some on-board tests |
I need to fine-tune the CI. Nonetheless, both CLINT and MECALL backends work as expected |
This backend triggers
MachineEnvCall
exceptions to obtain the desired behavior.The
examples/ecall.rs
works following this approach. I still want to make sure that there are no soundness issues before merging this PR. I also use the new approach I'm developing for the RISC-V ecosystem, so it is better to wait until all these changes are published to crates.io.If this approach works, then any RISC-V target will be compatible with
riscv-slic
, regardless of having CLINT or another software interrupt peripheral 😁