浏览代码

fix: correct typos in comments and documentation across multiple files

Signed-off-by: Zongyao Chen <[email protected]>
chenzongyao200127 1 周之前
父节点
当前提交
1aa32fccf5

+ 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
@@ -25,6 +25,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

@@ -28,6 +28,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`.
+- 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

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

@@ -36,6 +36,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
 
@@ -112,7 +113,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
 
@@ -122,7 +123,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;

+ 6 - 6
library/sbi-spec/src/binary.rs

@@ -514,7 +514,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()
@@ -537,7 +537,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()
@@ -809,7 +809,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.
@@ -842,7 +842,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> {
@@ -901,7 +901,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> {
@@ -950,7 +950,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)

+ 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/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!(