@@ -16,7 +16,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Modified
- Probe function now returns if legacy extensions are available
-- Update to `riscv` crate 0.9.0, sbi-spec crate version 0.0.3
+- Update to `riscv` crate 0.9.0, sbi-spec crate version 0.0.4
- Rename `send_ipi_many` to `send_ipi`
### Removed
@@ -17,12 +17,12 @@ edition = "2021"
[dependencies]
riscv = "0.9.0"
-sbi-spec = "0.0.3"
+sbi-spec = "0.0.4"
[features]
default = []
# Support legacy extension; this feature is not included by default.
-legacy = []
+legacy = ["sbi-spec/legacy"]
[package.metadata.docs.rs]
default-target = "riscv64imac-unknown-none-elf"
@@ -23,5 +23,5 @@ pub(super) fn handle_ecall(function: usize, param0: usize) -> SbiRet {
GET_MIMPID => mimpid::read().map(|r| r.bits()).unwrap_or(0),
_ => return SbiRet::not_supported(),
};
- SbiRet::ok(value)
+ SbiRet::success(value)
}
@@ -8,7 +8,7 @@ pub(super) fn handle_ecall(function: usize, param0: usize) -> SbiRet {
match function {
SET_TIMER => {
if set_timer(param0 as _) {
- SbiRet::ok(0)
+ SbiRet::success(0)
} else {
SbiRet::not_supported()
@@ -26,7 +26,7 @@ pub(super) fn handle_ecall_timer(function: usize, param0: usize, param1: usize)
if set_timer(concat_u32(a1, a0)) {
@@ -233,7 +233,6 @@ pub(crate) fn hart_get_status(hartid: usize) -> SbiRet {
#[inline]
pub(crate) fn hart_suspend(suspend_type: u32, resume_addr: usize, opaque: usize) -> SbiRet {
if let Some(obj) = HSM.get() {
- let suspend_type = suspend_type as u32;
return obj.hart_suspend(suspend_type, resume_addr, opaque);
@@ -217,7 +217,7 @@ pub(crate) fn num_counters() -> SbiRet {
if let Some(obj) = PMU.get() {
// Returns the number of counters (both hardware and firmware) in sbiret.value
// and always returns SBI_SUCCESS in sbiret.error.
- return SbiRet::ok(obj.num_counters());
+ return SbiRet::success(obj.num_counters());