Skip to content

Commit 93c713f

Browse files
committed
crate: update to rustsbi 0.3.0-rc.1
1 parent a7a786a commit 93c713f

File tree

6 files changed

+21
-30
lines changed

6 files changed

+21
-30
lines changed

Cargo.lock

Lines changed: 11 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rustsbi-qemu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ edition = "2021"
1717
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1818

1919
[dependencies]
20-
rustsbi = { version = "0.3.0-alpha.4", features = ["legacy"] }
20+
rustsbi = { version = "0.3.0-rc.1", features = ["legacy"] }
2121
riscv = "0.9.0"
2222
spin = "0.9"
2323
r0 = "1"

rustsbi-qemu/src/clint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ pub(crate) struct Clint;
55

66
impl Ipi for Clint {
77
#[inline]
8-
fn send_ipi_many(&self, hart_mask: HartMask) -> SbiRet {
8+
fn send_ipi(&self, hart_mask: HartMask) -> SbiRet {
99
let hsm = crate::HSM.wait();
1010
for i in 0..crate::NUM_HART_MAX {
1111
if hart_mask.has_bit(i) && hsm.is_ipi_allowed(i) {
1212
msip::send(i);
1313
}
1414
}
15-
SbiRet::ok(0)
15+
SbiRet::success(0)
1616
}
1717
}
1818

rustsbi-qemu/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ extern "C" fn rust_main(_hartid: usize, opaque: usize) -> Operation {
136136
[rustsbi] Supervisor Address : {SUPERVISOR_ENTRY:#x}
137137
",
138138
ver_sbi = rustsbi::VERSION,
139-
logo = rustsbi::logo(),
139+
logo = rustsbi::LOGO,
140140
ver_impl = env!("CARGO_PKG_VERSION"),
141141
model = board_info.model,
142142
smp = board_info.smp,

rustsbi-qemu/src/qemu_hsm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@ impl rustsbi::Hsm for QemuHsm {
222222
// this does not block the current function
223223
// The following process is going to be handled in software interrupt handler,
224224
// and the function returns immediately as starting a hart is defined as an asynchronous procedure.
225-
SbiRet::ok(0)
225+
SbiRet::success(0)
226226
}
227227

228228
fn hart_stop(&self) -> SbiRet {
229229
use core::sync::atomic::Ordering::{AcqRel, Acquire};
230230
match self.state[hart_id()].compare_exchange(STARTED, STOP_PENDING, AcqRel, Acquire) {
231231
Ok(_) => {
232232
*self.supervisor[hart_id()].lock() = None;
233-
SbiRet::ok(0)
233+
SbiRet::success(0)
234234
}
235235
Err(_) => SbiRet::failed(),
236236
}
@@ -240,7 +240,7 @@ impl rustsbi::Hsm for QemuHsm {
240240
use core::sync::atomic::Ordering::Acquire;
241241
self.state.get(hart_id).map_or(
242242
SbiRet::invalid_param(), // not in `state` map structure, the given hart id is invalid
243-
|s| SbiRet::ok(s.load(Acquire) as _),
243+
|s| SbiRet::success(s.load(Acquire) as _),
244244
)
245245
}
246246

@@ -250,14 +250,14 @@ impl rustsbi::Hsm for QemuHsm {
250250
Ok(_) => match suspend_type {
251251
spec::HART_SUSPEND_TYPE_RETENTIVE => {
252252
self.retentive_suspend();
253-
SbiRet::ok(0)
253+
SbiRet::success(0)
254254
}
255255
spec::HART_SUSPEND_TYPE_NON_RETENTIVE => {
256256
*self.supervisor[hart_id()].lock() = Some(Supervisor {
257257
start_addr: resume_addr,
258258
opaque,
259259
});
260-
SbiRet::ok(0)
260+
SbiRet::success(0)
261261
}
262262
_ => SbiRet::not_supported(),
263263
},

rustsbi-qemu/src/qemu_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Reset for QemuTest {
3131
RESET_REASON_SYSTEM_FAILURE => self.0.exit_failure(),
3232
value => self.0.exit(value),
3333
},
34-
RESET_TYPE_COLD_REBOOT | RESET_TYPE_WARM_REBOOT => SbiRet::ok(0),
34+
RESET_TYPE_COLD_REBOOT | RESET_TYPE_WARM_REBOOT => SbiRet::success(0),
3535
_ => SbiRet::invalid_param(),
3636
}
3737
}

0 commit comments

Comments
 (0)