Преглед на файлове

rt: re-export CounterMask for `sbi-rt` and `rustsbi`

Documentation fixes

Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
Zhouqi Jiang преди 5 месеца
родител
ревизия
aae21f2f79
променени са 5 файла, в които са добавени 13 реда и са изтрити 12 реда
  1. 2 1
      CHANGELOG.md
  2. 2 1
      sbi-rt/CHANGELOG.md
  3. 1 1
      sbi-rt/src/lib.rs
  4. 7 8
      sbi-rt/src/pmu.rs
  5. 1 1
      src/lib.rs

+ 2 - 1
CHANGELOG.md

@@ -12,8 +12,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 - ci: add `check-changlog` 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
+- forward: derive `Copy`, `Default`, `PartialEq`, `Eq` and `Hash` for struct Forward
 - pmu: mark that signatures of `pmu_counter_{config_matching, start, stop}` would be changed in RustSBI 0.5.0, as they are breaking changes.
+- lib: re-export `CounterMask` structure from `sbi-spec` crate.
 
 ### Modified
 

+ 2 - 1
sbi-rt/CHANGELOG.md

@@ -10,7 +10,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 ### Added
 
 - pmu: add missing `pmu_snapshot_set_shmem` function.
-- pmu: `pmu_snapshot_set_shmem` function signature, TODO: documents and implementation
+- pmu: `pmu_snapshot_set_shmem` function signature, documents and implementation
+- lib: re-export `sbi_spec::base::CounterMask` on crate root.
 
 ### Modified
 

+ 1 - 1
sbi-rt/src/lib.rs

@@ -33,7 +33,7 @@ mod sta;
 
 pub use sbi_spec::{
     base::Version,
-    binary::{HartMask, Physical, SbiRet, SharedPtr},
+    binary::{CounterMask, HartMask, Physical, SbiRet, SharedPtr},
 };
 
 // module `binary` includes crate-local `sbi_call_*` functions and is thus not re-exported

+ 7 - 8
sbi-rt/src/pmu.rs

@@ -281,14 +281,14 @@ pub fn pmu_counter_fw_read_hi(counter_idx: usize) -> SbiRet {
 ///
 /// This function should be invoked only once per hart at boot time. Once configured, the SBI
 /// implementation has read/write access to the shared memory when `sbi_pmu_counter_stop` is
-/// invoked with the `SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT` flag set.
+/// invoked with the `TAKE_SNAPSHOT` flag set.
 ///
 /// # Parameters
 ///
-/// If both `shmem_phys_lo` and `shmem_phys_hi` parameters are not all-ones bitwise then
-/// `shmem_phys_lo` specifies the lower XLEN bits and `shmem_phys_hi` specifies the upper XLEN bits
-/// of the snapshot shared memory physical base address. The `shmem_phys_lo` MUST be 4096 bytes
-/// (i.e. page) aligned and the size of the snapshot shared memory must be 4096 bytes.
+/// If `shmem` address parameter are not all-ones bitwise then
+/// `shmem` specifies the shared memory physical base address.
+/// The `shmem` physical address MUST be 4096 bytes (i.e. page) aligned
+/// and the size of the snapshot shared memory must be 4096 bytes.
 ///
 /// The `flags` parameter is reserved for future use and must be zero.
 ///
@@ -300,9 +300,8 @@ pub fn pmu_counter_fw_read_hi(counter_idx: usize) -> SbiRet {
 /// |:----------------------------|:----------------------------------------------
 /// | `SbiRet::success()`         | Shared memory was set or cleared successfully.
 /// | `SbiRet::not_supported()`   | The SBI PMU snapshot functionality is not available in the SBI implementation.
-/// | `SbiRet::invalid_param()`   | The flags parameter is not zero or the `shmem_phys_lo` parameter is not 4096 bytes aligned.
-/// | `SbiRet::invalid_address()` | The shared memory pointed to by the `shmem_phys_lo` and `shmem_phys_hi` parameters is not writable
-/// |                             | or does not satisfy other requirements of RISC-V SBI Specification chapter 3.2.
+/// | `SbiRet::invalid_param()`   | The flags parameter is not zero or the `shmem` parameter is not 4096 bytes aligned.
+/// | `SbiRet::invalid_address()` | The shared memory pointed to by the `shmem` parameter is not writable or does not satisfy other requirements of RISC-V SBI Specification chapter 3.2.
 /// | `SbiRet::failed()`          | The request failed for unspecified or unknown other reasons.
 /// This function is defined in RISC-V SBI Specification chapter 11.13.
 #[inline]

+ 1 - 1
src/lib.rs

@@ -583,7 +583,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
 
 pub extern crate sbi_spec as spec;
 
-pub use sbi_spec::binary::{HartMask, Physical, SbiRet, SharedPtr};
+pub use sbi_spec::binary::{CounterMask, HartMask, Physical, SbiRet, SharedPtr};
 
 /// Generate `RustSBI` implementation for structure of each extension.
 ///