Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

New MECALL backend #10

wants to merge 2 commits into from

Conversation

romancardenas
Copy link
Owner

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 😁

@romancardenas romancardenas mentioned this pull request Sep 8, 2024
@@ -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.
///

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.

Copy link
Owner Author

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.

@thejpster
Copy link

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.

@romancardenas
Copy link
Owner Author

Will do! I have bought a couple of RP Pico 2 boards, so I will also do some on-board tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants