|
2 | 2 |
|
3 | 3 | use alloc::sync::Arc;
|
4 | 4 | use core::sync::atomic::{AtomicU8, Ordering};
|
| 5 | + |
5 | 6 | use hashbrown::HashMap;
|
6 | 7 | use riscv::register::mstatus::{self, MPP};
|
7 | 8 | use rustsbi::SbiRet;
|
@@ -34,18 +35,18 @@ enum HsmState {
|
34 | 35 | }
|
35 | 36 |
|
36 | 37 | // 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. |
38 | 39 | //
|
39 | 40 | // RustSBI-QEMU makes use of machine software interrupt. Functions should modify `state` to
|
40 | 41 | // XxxPending before the actual procedure began. Then, caller should store next command structure
|
41 | 42 | // to `last_command`, and use IPI to invoke software interrupt on machine level.
|
42 | 43 | //
|
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 |
44 | 45 | // 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. |
46 | 47 | //
|
47 | 48 | // 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 |
49 | 50 | // is still in transition or after the transition is done. These functions may read from `last_command`
|
50 | 51 | // variable at any time.
|
51 | 52 | #[derive(Clone)]
|
@@ -130,7 +131,7 @@ impl rustsbi::Hsm for QemuHsm {
|
130 | 131 | Ordering::AcqRel,
|
131 | 132 | Ordering::Acquire,
|
132 | 133 | );
|
133 |
| - // procceed with invalid hart states. |
| 134 | + // proceed with invalid hart states. |
134 | 135 | // - the given hartid is already started, the compare exchange should fail and suggests current state as `Started`,
|
135 | 136 | // function should return error as already available.
|
136 | 137 | if current_state == Err(HsmState::Started as u8) {
|
|
0 commit comments