Procházet zdrojové kódy

Merge pull request #123 from chenzongyao200127/fix-typos

fix: correct typos in comments and documentation across multiple files
Luo Jia / Zhouqi Jiang před 4 týdny
rodič
revize
16aa205111

+ 6 - 1
library/rustsbi/CHANGELOG.md

@@ -9,7 +9,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ### Added
 
-- ci: add `check-changlog` and `check-commit-signatures` in `workflows`.
+- ci: add `check-changelog` and `check-commit-signatures` in `workflows`.
 - pmu: add missing `snapshot_set_shmem` function and testcases in `Pmu` trait.
 - pmu: add missing `snapshot_set_shmem` function in `Pmu` trait, impl for `&T` and `Option<T>` and `Forward` structure
 - forward: derive `Copy`, `Default`, `PartialEq`, `Eq` and `Hash` for struct Forward
@@ -26,6 +26,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ### Removed
 
+
+### Fixed
+
+- Fix typos.
+
 ## [0.4.0]
 
 ### Added

+ 1 - 1
library/rustsbi/examples/derive/commons.rs

@@ -1,4 +1,4 @@
-// Mock implementaion module. Actual SBI implementaion should implement
+// Mock implementation module. Actual SBI implementation should implement
 // those SBI extensions with machine environment specific hardware features.
 
 use rustsbi::EnvInfo;

+ 1 - 1
library/rustsbi/examples/derive/main.rs

@@ -51,7 +51,7 @@ fn main() {
     // In hypervisor: fill guest supervisor `a0` and `a1` with `SbiRet` value.
     let _ = ret; // It should be filled into context on real programs.
 
-    // Congratulations! You have learned how to use RustSBI to create your SBI implementaion.
+    // Congratulations! You have learned how to use RustSBI to create your SBI implementation.
     // You may consider using the RustSBI Prototyping System, build a standalone
     // binary package with runtime environment from scratch, or begin with your hypervisor
     // development.

+ 1 - 1
library/rustsbi/src/pmu.rs

@@ -254,7 +254,7 @@ pub trait Pmu {
     ///
     /// Any future revisions to this structure should be made in a backward compatible manner and will be associated with an SBI version.
     ///
-    /// The logical counter indicies in the `counter_overflow_bitmap` and `counter_values` array are
+    /// The logical counter indices in the `counter_overflow_bitmap` and `counter_values` array are
     /// relative w.r.t to `counter_idx_base` argument present in the `pmu_counter_stop` and
     /// `pmu_counter_start` functions.
     /// This allows the users to use snapshot feature for more than `XLEN` counters if required.

+ 1 - 0
library/sbi-rt/CHANGELOG.md

@@ -30,6 +30,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 - base: fix wrong `extension_id` of `Suspend` structure
 - binary: allow 8 arguments on internal function `sbi_call_6`.
 - lib: clarify error codes in documents of SBI IPI and RFENCE extensions.
+- Fix typos.
 
 ## [0.0.3] - 2024-02-08
 

+ 1 - 1
library/sbi-rt/src/hsm.rs

@@ -122,7 +122,7 @@ pub fn hart_get_status(hartid: usize) -> SbiRet {
 
 /// Put the calling hart into suspend or platform specific lower power states.
 ///
-/// This function requests the SBI implementation to put the calling hart in a platform specfic suspend
+/// This function requests the SBI implementation to put the calling hart in a platform specific suspend
 /// (or low power) state specified by the `suspend_type` parameter.
 ///
 /// The hart will automatically come out of suspended state and resume normal execution

+ 1 - 1
library/sbi-rt/src/sse.rs

@@ -214,7 +214,7 @@ pub fn sse_complete() -> SbiRet {
 
 /// The supervisor software can inject a software event with this function.
 ///
-/// The `event_id` paramater refers to the ID of the event to be injected.
+/// The `event_id` parameter refers to the ID of the event to be injected.
 ///
 /// For local events, the `hart_id` parameter refers to the hart on which the event is to be injected.
 /// For global events, the `hart_id` parameter is ignored.

+ 3 - 2
library/sbi-spec/CHANGELOG.md

@@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
 ### Fixed
 
 - Remove redundant license file on module path; the `sbi-spec` module inherits workspace level license files.
+- Fix typos.
 
 ## [0.0.8] - 2024-10-25
 
@@ -114,7 +115,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
 ### Modified
 
 - Rename `SbiRet::ok` to `SbiRet::success`
-- Rename `SbiSpecVersion` to struct `Version` 
+- Rename `SbiSpecVersion` to struct `Version`
 
 ## [0.0.3] - 2022-10-06
 
@@ -124,7 +125,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
   check implementations during compilation, and provide an item list for developers
 - denied: warnings and unsafe code
 - a github workflow to check building
-- `SbiSpecVersion` type defination for sbi base
+- `SbiSpecVersion` type definition for sbi base
 
 ### Modified
 

+ 1 - 1
library/sbi-spec/src/base.rs

@@ -113,7 +113,7 @@ mod fid {
 ///
 /// Declared in §4.9.
 pub mod impl_id {
-    /// Berkley Bootloader.
+    /// Berkeley Bootloader.
     pub const BBL: usize = 0;
     /// OpenSBI.
     pub const OPEN_SBI: usize = 1;

+ 2 - 2
library/sbi-spec/src/binary/hart_mask.rs

@@ -198,7 +198,7 @@ impl Iterator for HartIds {
         true
     }
 
-    // TODO: implement fn advance_by once it's stablized: https://github.com/rust-lang/rust/issues/77404
+    // TODO: implement fn advance_by once it's stabilized: https://github.com/rust-lang/rust/issues/77404
     // #[inline]
     // fn advance_by(&mut self, n: usize) -> Result<(), core::num::NonZero<usize>> { ... }
 }
@@ -227,7 +227,7 @@ impl DoubleEndedIterator for HartIds {
         }
     }
 
-    // TODO: implement advance_back_by once stablized.
+    // TODO: implement advance_back_by once stabilized.
     // #[inline]
     // fn advance_back_by(&mut self, n: usize) -> Result<(), core::num::NonZero<usize>> { ... }
 }

+ 7 - 7
library/sbi-spec/src/binary/sbi_ret.rs

@@ -540,7 +540,7 @@ impl SbiRet {
     /// let x = SbiRet::invalid_param();
     /// assert_eq!(x.ok(), None);
     /// ```
-    // fixme: should be pub const fn once this function in Result is stablized in constant
+    // fixme: should be pub const fn once this function in Result is stabilized in constant
     #[inline]
     pub fn ok(self) -> Option<usize> {
         self.into_result().ok()
@@ -563,7 +563,7 @@ impl SbiRet {
     /// let x = SbiRet::denied();
     /// assert_eq!(x.err(), Some(Error::Denied));
     /// ```
-    // fixme: should be pub const fn once this function in Result is stablized in constant
+    // fixme: should be pub const fn once this function in Result is stabilized in constant
     #[inline]
     pub fn err(self) -> Option<Error> {
         self.into_result().err()
@@ -835,7 +835,7 @@ impl SbiRet {
     }
 
     // TODO: pub fn into_ok(self) -> usize and pub fn into_err(self) -> Error
-    // once `unwrap_infallible` is stablized
+    // once `unwrap_infallible` is stabilized
 
     /// Returns `res` if self is success value, otherwise otherwise returns the contained error
     /// of `self` as [`Error`] struct.
@@ -868,7 +868,7 @@ impl SbiRet {
     /// let y = SbiRet::success(5).into_result();
     /// assert_eq!(x.and(y), Ok(5));
     /// ```
-    // fixme: should be pub const fn once this function in Result is stablized in constant
+    // fixme: should be pub const fn once this function in Result is stabilized in constant
     // fixme: should parameter be `res: SbiRet`?
     #[inline]
     pub fn and<U>(self, res: Result<U, Error>) -> Result<U, Error> {
@@ -927,7 +927,7 @@ impl SbiRet {
     /// let y = SbiRet::success(100).into_result();
     /// assert_eq!(x.or(y), Ok(4));
     /// ```
-    // fixme: should be pub const fn once this function in Result is stablized in constant
+    // fixme: should be pub const fn once this function in Result is stabilized in constant
     // fixme: should parameter be `res: SbiRet`?
     #[inline]
     pub fn or<F>(self, res: Result<usize, F>) -> Result<usize, F> {
@@ -976,7 +976,7 @@ impl SbiRet {
     /// let x = SbiRet::invalid_param();
     /// assert_eq!(x.unwrap_or(default), default);
     /// ```
-    // fixme: should be pub const fn once this function in Result is stablized in constant
+    // fixme: should be pub const fn once this function in Result is stabilized in constant
     #[inline]
     pub fn unwrap_or(self, default: usize) -> usize {
         self.into_result().unwrap_or(default)
@@ -1079,7 +1079,7 @@ impl IntoIterator for SbiRet {
     }
 }
 
-// TODO: implement Try and FromResidual for SbiRet once those traits are stablized
+// TODO: implement Try and FromResidual for SbiRet once those traits are stabilized
 /*
 impl core::ops::Try for SbiRet {
     type Output = usize;

+ 1 - 0
library/sbi-testing/CHANGELOG.md

@@ -19,6 +19,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 - Rename `MArchId` and `MVendorId` into `MarchId` and `MvendorId` in `BaseCase`
 
 ### Fixed
+- Fix typos.
 
 ## [0.0.2] - 2023-01-20
 

+ 1 - 1
library/sbi-testing/README_EN.md

@@ -8,7 +8,7 @@
 
 - [中文自述文件](README.md)
 
-This library provides a set of test cases for supervisors to verify functions of the supervisor executation environment.
+This library provides a set of test cases for supervisors to verify functions of the supervisor execution environment.
 
 Characters implementation of SBI 1.0.0 specification:
 

+ 1 - 1
library/sbi-testing/src/base.rs

@@ -6,7 +6,7 @@ use sbi_spec::base::impl_id;
 /// Base extension test cases.
 #[derive(Clone, Debug)]
 pub enum Case {
-    /// Can't procceed test for base extension does not exist.
+    /// Can't proceed test for base extension does not exist.
     NotExist,
     /// Test begin.
     Begin,

+ 1 - 1
library/sbi-testing/src/dbcn.rs

@@ -6,7 +6,7 @@ use sbi_spec::binary::Physical;
 /// Debug console extension test cases.
 #[derive(Clone, Debug)]
 pub enum Case {
-    /// Can't procceed test for debug console extension does not exist.
+    /// Can't proceed test for debug console extension does not exist.
     NotExist,
     /// Test begin.
     Begin,

+ 1 - 1
library/sbi-testing/src/hsm.rs

@@ -7,7 +7,7 @@ use sbi_spec::hsm::hart_state;
 /// Hart state monitor extension test cases.
 #[derive(Clone, Debug)]
 pub enum Case<'a> {
-    /// Can't procceed test for Hart state monitor extension does not exist.
+    /// Can't proceed test for Hart state monitor extension does not exist.
     NotExist,
     /// Test begin.
     Begin,

+ 1 - 1
library/sbi-testing/src/spi.rs

@@ -13,7 +13,7 @@ use sbi::HartMask;
 /// Inter-processor Interrupt extension test cases.
 #[derive(Clone, Debug)]
 pub enum Case {
-    /// Can't procceed test for inter-processor interrupt extension does not exist.
+    /// Can't proceed test for inter-processor interrupt extension does not exist.
     NotExist,
     /// Test begin.
     Begin,

+ 2 - 2
library/sbi-testing/src/thread.rs

@@ -75,9 +75,9 @@ impl Thread {
             // 设置线程仍在 S 态并打开中断
             let mut sstatus: usize;
             core::arch::asm!("csrr {}, sstatus", out(reg) sstatus);
-            const PREVILEGE_BIT: usize = 1 << 8;
+            const PRIVILEGE_BIT: usize = 1 << 8;
             const INTERRUPT_BIT: usize = 1 << 5;
-            sstatus |= PREVILEGE_BIT | INTERRUPT_BIT;
+            sstatus |= PRIVILEGE_BIT | INTERRUPT_BIT;
             // 执行线程
             // TODO support RV32 instruction set
             core::arch::asm!(

+ 1 - 1
library/sbi-testing/src/time.rs

@@ -12,7 +12,7 @@ use riscv::{
 /// Timer programmer extension test cases.
 #[derive(Clone, Debug)]
 pub enum Case {
-    /// Can't procceed test for Timer extension does not exist.
+    /// Can't proceed test for Timer extension does not exist.
     NotExist,
     /// Test begin.
     Begin,

+ 5 - 5
prototyper/prototyper/src/platform/mod.rs

@@ -202,12 +202,12 @@ impl Platform {
                 }
             }
 
-            if let Some(ref raw_evnet_to_mhpmcounters) = pmu.raw_event_to_mhpmcounters {
-                let len = raw_evnet_to_mhpmcounters.len();
+            if let Some(ref raw_event_to_mhpmcounters) = pmu.raw_event_to_mhpmcounters {
+                let len = raw_event_to_mhpmcounters.len();
                 for idx in 0..len {
-                    let raw_event_select = raw_evnet_to_mhpmcounters.get_event_idx_base(idx);
-                    let select_mask = raw_evnet_to_mhpmcounters.get_event_idx_mask(idx);
-                    let counters_mask = raw_evnet_to_mhpmcounters.get_counter_bitmap(idx);
+                    let raw_event_select = raw_event_to_mhpmcounters.get_event_idx_base(idx);
+                    let select_mask = raw_event_to_mhpmcounters.get_event_idx_mask(idx);
+                    let counters_mask = raw_event_to_mhpmcounters.get_counter_bitmap(idx);
                     let raw_event_to_counter =
                         RawEventToCounterMap::new(counters_mask, raw_event_select, select_mask);
                     debug!(