Skip to content

Commit c04b443

Browse files
committed
rustsbi-qemu: fix document on QEMU HSM module
Signed-off-by: luojia65 <me@luojia.cc>
1 parent 9d3299c commit c04b443

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

Cargo.lock

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

rustsbi-qemu/src/qemu_hsm.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use alloc::sync::Arc;
44
use core::sync::atomic::{AtomicU8, Ordering};
5+
56
use hashbrown::HashMap;
67
use riscv::register::mstatus::{self, MPP};
78
use rustsbi::SbiRet;
@@ -34,18 +35,18 @@ enum HsmState {
3435
}
3536

3637
// RustSBI-QEMU hart state monitor structure. It stores hart states for all harts,
37-
// and last command (see HsmCommand) when hart is requested to procceed HSM functions.
38+
// and last command (see HsmCommand) when hart is requested to proceed HSM functions.
3839
//
3940
// RustSBI-QEMU makes use of machine software interrupt. Functions should modify `state` to
4041
// XxxPending before the actual procedure began. Then, caller should store next command structure
4142
// to `last_command`, and use IPI to invoke software interrupt on machine level.
4243
//
43-
// When target hart received machine software interrupt, it should read and procceed command
44+
// When target hart received machine software interrupt, it should read and proceed command
4445
// from `last_command`. Then, after command execution makes progress, it should modify
45-
// `state` to Xxxed to mark that the HSM function has taken effect.
46+
// `state` variable to mark that the HSM function has taken effect.
4647
//
4748
// These functions above are defined as asynchronous procedures. That means it returns before
48-
// acutal procedure has finished. There are functions to read its current state when the target hart
49+
// actual procedure has finished. There are functions to read its current state when the target hart
4950
// is still in transition or after the transition is done. These functions may read from `last_command`
5051
// variable at any time.
5152
#[derive(Clone)]
@@ -130,7 +131,7 @@ impl rustsbi::Hsm for QemuHsm {
130131
Ordering::AcqRel,
131132
Ordering::Acquire,
132133
);
133-
// procceed with invalid hart states.
134+
// proceed with invalid hart states.
134135
// - the given hartid is already started, the compare exchange should fail and suggests current state as `Started`,
135136
// function should return error as already available.
136137
if current_state == Err(HsmState::Started as u8) {

0 commit comments

Comments
 (0)