Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ psci = { version = "0.1.0", default-features = false, features = ["smc"]}
[target.'cfg(target_arch = "riscv64")'.dependencies]
sbi-rt = { version = "0.0.3", features = ["legacy"] }
sbi-spec = "0.0.8"
riscv = { git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] }
riscv = "0.13.0"
riscv_h = { package = "riscv", git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] }
riscv-decode = "0.2.1"
riscv-peripheral = "0.2.1"
riscv-pac = "0.2.0"
Expand Down
3 changes: 3 additions & 0 deletions src/arch/riscv64/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ pub const CSR_HENVCFGH: u64 = 0x61A;
pub const CSR_STIMECMP: u64 = 0x14D;
pub const CSR_STIMECMPH: u64 = 0x15D;

pub const HSTATUS_SPV: u64 = 1 << 7;

macro_rules! read_csr {
($csr_number:expr) => {
{
Expand All @@ -73,6 +75,7 @@ macro_rules! read_csr {
}
}
pub(crate) use read_csr;

macro_rules! write_csr {
($csr_number:expr, $value: expr) => {
unsafe{
Expand Down
7 changes: 7 additions & 0 deletions src/arch/riscv64/ipi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ pub fn arch_send_event(cpu_id: u64, _sgi_num: u64) {
#[cfg(not(feature = "aclint"))]
sbi_rt::send_ipi(HartMask::from_mask_base(1 << cpu_id, 0));
}

/// Handle send_ipi event.
pub fn arch_ipi_handler() {
unsafe {
riscv_h::register::hvip::set_vssip();
}
}
Loading