-
Notifications
You must be signed in to change notification settings - Fork 738
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
Decouple embassy-hal-common InterruptExt from cortex-m #1689
Decouple embassy-hal-common InterruptExt from cortex-m #1689
Conversation
a11b5c9
to
cc885d4
Compare
cc885d4
to
8d286e7
Compare
Hi! Thanks for the PR. Unfortunately I don't think we should port
If you want to write a HAL for a RISCV chip, you can make it bring its own independent |
Thanks for the reply! My use case, building the same Embassy application to run on multiple targets, made this abstraction highly useful (aside from the feature gaps we've highlighted between interrupt controller hardware implementations). Use cases exist where "board" implementations share common peripherals and are divergent only in processor and interrupt controller hardware implementations. RISC-V supports several different interrupt controllers, including the PLIC and CLIC. I was under the impression from #745 (comment) that the abstraction might be generally useful, but if that's not the case I'll happily close the PR! |
fwiw, GIC is needed for stm32mp series chips. If I ever get around to it, it would be nice to have portability between mcu and mpu. That's still inside the arm universe, though. |
There exists a community that is interested in developing device drivers and applications that are portable among processors and physical devices that would make these abstractions useful, but perhaps that use case is not generally useful. Thank you for the feedback! |
Decouples
embassy_hal_common::interrupt
from Cortex-M and Cortex-M dependencies, allowing implementations ofembassy_hal_common::interrupt::InterruptExt
for non-NVIC interrupt controllers (PLIC, CLIC, GIC, ...). Adds a sample implementation for the RISC-V PLIC from the riscv crate.There are a couple of things to highlight:
InterruptExt
is unopinionated about how to handle such feature gaps in interrupt controller implementations. The RISC-V PLIC also supports a priority threshold.embassy-hal-common/prio-bits-2
.Nonetheless this begins to decouple the
InterruptExt
abstraction from the NVIC, allow of non-NVIC implementations, and maintains backwards compatibility.