Bläddra i källkod

lib: rename internal `machine_info` into `env_info`

fixes on changelog to remove RustSBI instance

Signed-off-by: Zhouqi Jiang <[email protected]>
Zhouqi Jiang 1 år sedan
förälder
incheckning
3042206f5f
3 ändrade filer med 8 tillägg och 9 borttagningar
  1. 3 4
      CHANGELOG.md
  2. 1 1
      macros/src/lib.rs
  3. 4 4
      src/traits.rs

+ 3 - 4
CHANGELOG.md

@@ -9,12 +9,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ### Added
 
+- macro based `#[derive(RustSBI)]` interface
 - support System Suspend extension
-- support CPPC extension 
-- `new_uninit` and `uninit_with_machine_info` constructors for RustSBI instance
-- `handle_ecall` now only requires `&self` since RustSBI trait implementations are internally mutable
+- support CPPC extension
 - support NACL and STA extensions
-- macro based `#[derive(RustSBI)]` interface
+- `handle_ecall` now only requires `&self` since RustSBI trait implementations are internally mutable
 - `into_inner` function for `HartMask`
 - forward extensions to current environment by `Forward` struct
 

+ 1 - 1
macros/src/lib.rs

@@ -164,7 +164,7 @@ fn impl_derive_rustsbi(name: &Ident, imp: RustSBIImp, generics: &Generics) -> To
             () => quote! {
                 ::rustsbi::spec::base::EID_BASE => compile_error!(
                     "can't derive RustSBI: #[cfg(feature = \"machine\")] is needed to derive RustSBI with no extra `EnvInfo` provided; \
-            consider adding an `info` parameter to provide machine information implementing `rustsbi::EnvInfo`\
+            consider adding an `info` parameter to provide machine environment information implementing `rustsbi::EnvInfo`\
             if RustSBI is not run on machine mode."
                 ),
             },

+ 4 - 4
src/traits.rs

@@ -78,7 +78,7 @@ pub fn _rustsbi_base_bare<U: _ExtensionProbe>(
 pub fn _rustsbi_base_env_info<T: EnvInfo, U: _ExtensionProbe>(
     param: [usize; 6],
     function: usize,
-    machine_info: &T,
+    env_info: &T,
     probe: U,
 ) -> SbiRet {
     let [param0] = [param[0]];
@@ -87,9 +87,9 @@ pub fn _rustsbi_base_env_info<T: EnvInfo, U: _ExtensionProbe>(
         spec::base::GET_SBI_IMPL_ID => crate::IMPL_ID_RUSTSBI,
         spec::base::GET_SBI_IMPL_VERSION => crate::RUSTSBI_VERSION,
         spec::base::PROBE_EXTENSION => probe.probe_extension(param0),
-        spec::base::GET_MVENDORID => machine_info.mvendorid(),
-        spec::base::GET_MARCHID => machine_info.marchid(),
-        spec::base::GET_MIMPID => machine_info.mimpid(),
+        spec::base::GET_MVENDORID => env_info.mvendorid(),
+        spec::base::GET_MARCHID => env_info.marchid(),
+        spec::base::GET_MIMPID => env_info.mimpid(),
         _ => return SbiRet::not_supported(),
     };
     SbiRet::success(value)