Rust support for RISC-V Platform Level Interrupt Controller
Based on HUST-OS/plic
REF: RISC-V Platform-Level Interrupt Controller Specification
Add to Cargo.toml
:
rv-plic = { git = "https://github.com/duskmoon314/rv-plic" }
Set qemu virt machine uart:
// context 1: hart 0, S mode
type PLIC = rv_plic::PLIC<PLIC_BASE, 3>;
PLIC::set_threshold(1, Priority::any());
PLIC::enable(1, 10);
PLIC::set_priority(10, Priority::lowest());