mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 02:43:24 +00:00
Fix the detection of RISC-V SSTC extension
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
bd24ed9ba7
commit
492898d1d5
@ -8,8 +8,8 @@ use core::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
arch::boot::DEVICE_TREE,
|
arch::{self, boot::DEVICE_TREE},
|
||||||
cpu::{CpuId, PinCurrentCpu},
|
cpu::{CpuId, IsaExtensions, PinCurrentCpu},
|
||||||
timer::INTERRUPT_CALLBACKS,
|
timer::INTERRUPT_CALLBACKS,
|
||||||
trap,
|
trap,
|
||||||
};
|
};
|
||||||
@ -107,10 +107,7 @@ fn set_next_timer_sstc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn is_sstc_enabled() -> bool {
|
fn is_sstc_enabled() -> bool {
|
||||||
let Some(misa) = riscv::register::misa::read() else {
|
arch::cpu::has_extensions(IsaExtensions::SSTC)
|
||||||
return false;
|
|
||||||
};
|
|
||||||
misa.has_extension('S')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_next_when() -> u64 {
|
fn get_next_when() -> u64 {
|
||||||
|
Reference in New Issue
Block a user