### Get Node Hardware State (Rust) Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.node_hw_state_32.html Use this function to query the actual hardware state of a node in the power domain. It requires the target CPU identifier and the desired power level. ```rust pub fn node_hw_state_32( target_cpu: u32, power_level: u32, ) -> Result ``` -------------------------------- ### Get Power State Residency Time Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.stat_residency.html Call this function to get the time in microseconds the platform has spent in a given power state since cold boot. Requires the target CPU and the power state as input. ```rust pub fn stat_residency(target_cpu: u64, power_state: u32) -> u64 ``` -------------------------------- ### PSCI Functions Source: https://docs.rs/smccc/0.2.2/smccc/psci/index.html This section details the available functions for interacting with PSCI. These functions allow for operations such as getting affinity information, managing CPU power states, memory protection, and system control. ```APIDOC ## Functions ### affinity_info Gets the status of an affinity instance. ### affinity_info_32 Gets the status of an affinity instance. ### cpu_default_suspend Puts the current core into an implementation-defined low power state. ### cpu_default_suspend_32 Puts the current core into an implementation-defined low power state. ### cpu_freeze Puts the current core into an implementation-defined low power state. ### cpu_off Powers down the current core. ### cpu_on Powers up a core. ### cpu_on_32 Powers up a core. ### cpu_suspend Suspends execution of a core or topology node. ### cpu_suspend_32 Suspends execution of a core or topology node. ### mem_protect Enables or disables memory protection. ### mem_protect_check_range Checks whether a memory range is protected by `MEM_PROTECT`. ### mem_protect_check_range_32 Checks whether a memory range is protected by `MEM_PROTECT`. ### migrate Asks the Trusted OS to migrate its context to a specific core. ### migrate_32 Asks the Trusted OS to migrate its context to a specific core. ### migrate_info_type Identifies the level of multicore support in the Trusted OS. ### migrate_info_up_cpu Returns the MPIDR value of the current resident core of the Trusted OS. ### migrate_info_up_cpu_32 Returns the MPIDR value of the current resident core of the Trusted OS. ### node_hw_state Returns the true hardware state of a node in the power domain topology. ### node_hw_state_32 Returns the true hardware state of a node in the power domain topology. ### psci_features Queries whether `SMCCC_VERSION` or a specific PSCI function is implemented, and what features are supported. ### set_suspend_mode Sets the mode used by `CPU_SUSPEND`. ### stat_count Returns the number of times the platform has used the given power state since cold boot. ### stat_count_32 Returns the number of times the platform has used the given power state since cold boot. ### stat_residency Returns the amount of time in microseconds that the platform has spent in the given power state since cold boot. ### stat_residency_32 Returns the amount of time in microseconds that the platform has spent in the given power state since cold boot. ### system_off Shuts down the system. ### system_reset Resets the system. ### system_reset2 Resets the system in an architectural or vendor-specific way. ### system_reset2_32 Resets the system in an architectural or vendor-specific way. ### system_suspend Suspends the system to RAM. ### system_suspend_32 Suspends the system to RAM. ### version Returns the version of PSCI implemented. ``` -------------------------------- ### affinity_info Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.affinity_info.html Gets the status of an affinity instance. It takes a target affinity and the lowest affinity level as input and returns the AffinityState or an Error. ```APIDOC ## Function affinity_info ### Description Gets the status of an affinity instance. ### Signature ```rust pub fn affinity_info( target_affinity: u64, lowest_affinity_level: LowestAffinityLevel, ) -> Result ``` ### Parameters * `target_affinity`: `u64` - The target affinity instance to query. * `lowest_affinity_level`: `LowestAffinityLevel` - The lowest affinity level to consider. ### Returns * `Result` - Returns `Ok(AffinityState)` on success, or `Err(Error)` if an error occurred. ``` -------------------------------- ### Get Node Hardware Power State Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.node_hw_state.html Call this function to retrieve the true hardware state of a node within the power domain topology. It requires the target CPU identifier and the desired power level. ```rust pub fn node_hw_state( target_cpu: u64, power_level: u32, ) -> Result ``` -------------------------------- ### Get Power State Usage Count - Rust Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.stat_count_32.html Use this function to retrieve the number of times a specific power state has been utilized by the platform since the last cold boot. Requires a target CPU and the power state to query. ```rust pub fn stat_count_32(target_cpu: u32, power_state: u32) -> u32 ``` -------------------------------- ### Get Affinity Instance Status - Rust Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.affinity_info_32.html Use this function to get the status of an affinity instance. It requires the target affinity as a u32 and the lowest affinity level. ```rust pub fn affinity_info_32( target_affinity: u32, lowest_affinity_level: LowestAffinityLevel, ) -> Result ``` -------------------------------- ### TryFrom for Version Implementation Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Provides fallible conversion from i32 to Version. ```APIDOC ### impl TryFrom for Version #### type Error = Error The type returned in the event of a conversion error. #### fn try_from(value: i32) -> Result Performs the conversion. ``` -------------------------------- ### psci::cpu_on Source: https://docs.rs/smccc/0.2.2/smccc/all.html Turns on a specified CPU. ```APIDOC ## psci::cpu_on ### Description Turns on a specified CPU. ### Parameters #### Path Parameters - **cpu_id** (u32) - Required - The ID of the CPU to turn on. - **entry_point** (u64) - Required - The entry point address for the CPU. ### Function Signature `pub fn cpu_on(cpu_id: u32, entry_point: u64) -> Result<(), psci::error::Error>` ``` -------------------------------- ### cpu_on_32 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.cpu_on_32.html Powers up a core. It takes the target CPU ID, the entry point address for the core, and a context ID as parameters. It returns a Result indicating success or an error. ```APIDOC ## Function cpu_on_32 ### Description Powers up a core. ### Signature ```rust pub fn cpu_on_32( target_cpu: u32, entry_point_address: u32, context_id: u32, ) -> Result<(), Error> ``` ### Parameters - **target_cpu** (u32): The ID of the CPU core to power up. - **entry_point_address** (u32): The memory address where the core should start execution. - **context_id** (u32): An identifier for the context in which the core will operate. ### Returns - `Result<(), Error>`: Ok(()) on success, or an Error if the operation fails. ``` -------------------------------- ### affinity_info_32 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.affinity_info_32.html Gets the status of an affinity instance. ```APIDOC ## Function affinity_info_32 ### Description Gets the status of an affinity instance. ### Signature ```rust pub fn affinity_info_32(target_affinity: u32, lowest_affinity_level: LowestAffinityLevel) -> Result ``` ### Parameters * `target_affinity`: `u32` - The target affinity identifier. * `lowest_affinity_level`: `LowestAffinityLevel` - The lowest affinity level to consider. ### Returns * `Result` - Returns `Ok(AffinityState)` on success or `Err(Error)` on failure. ``` -------------------------------- ### Get TypeId of SocIdType Source: https://docs.rs/smccc/0.2.2/smccc/arch/enum.SocIdType.html Retrieves the unique TypeId for the SocIdType, useful for runtime type identification. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### cpu_on Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.cpu_on.html Powers up a core. This function takes the target CPU ID, the entry point address, and the context ID as arguments. ```APIDOC ## cpu_on ### Description Powers up a core. ### Signature ```rust pub fn cpu_on( target_cpu: u64, entry_point_address: u64, context_id: u64, ) -> Result<(), Error> ``` ### Parameters * `target_cpu` (u64) - The ID of the CPU core to power up. * `entry_point_address` (u64) - The memory address where the CPU should start execution. * `context_id` (u64) - An identifier for the context in which the CPU will operate. ### Returns * `Result<(), Error>` - Returns Ok(()) on success, or an Error if the operation fails. ``` -------------------------------- ### Display Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Enables display formatting for Version instances. ```APIDOC ### impl Display for Version #### fn fmt(&self, f: &mut Formatter<'_>) -> Result Formats the value using the given formatter. ``` -------------------------------- ### Deprecated cause method for Error Source: https://docs.rs/smccc/0.2.2/smccc/psci/error/enum.Error.html A deprecated method for getting the cause of the error. Replaced by `Error::source` which supports downcasting. ```rust fn cause(&self) -> Option<&dyn Error> ``` -------------------------------- ### Deprecated description method for Error Source: https://docs.rs/smccc/0.2.2/smccc/psci/error/enum.Error.html A deprecated method for getting a string description of the error. Prefer using the Display implementation or `to_string()`. ```rust fn description(&self) -> &str ``` -------------------------------- ### From for u32 Implementation Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Provides conversion from Version to u32. ```APIDOC ### impl From for u32 #### fn from(version: Version) -> Self Converts to this type from the input type. ``` -------------------------------- ### psci::cpu_on_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Turns on a specified CPU using 32-bit arguments. ```APIDOC ## psci::cpu_on_32 ### Description Turns on a specified CPU using 32-bit arguments. ### Parameters #### Path Parameters - **cpu_id** (u32) - Required - The ID of the CPU to turn on. - **entry_point** (u32) - Required - The entry point address for the CPU. ### Function Signature `pub fn cpu_on_32(cpu_id: u32, entry_point: u32) -> Result<(), psci::error::Error>` ``` -------------------------------- ### psci::migrate_info_up_cpu_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Provides migration information for an up CPU using 32-bit arguments. ```APIDOC ## psci::migrate_info_up_cpu_32 ### Description Provides migration information for an up CPU using 32-bit arguments. ### Parameters #### Path Parameters - **cpu_id** (u32) - Required - The ID of the CPU. ### Function Signature `pub fn migrate_info_up_cpu_32(cpu_id: u32) -> Result<(), psci::error::Error>` ``` -------------------------------- ### psci::migrate_info_up_cpu Source: https://docs.rs/smccc/0.2.2/smccc/all.html Provides migration information for an up CPU. ```APIDOC ## psci::migrate_info_up_cpu ### Description Provides migration information for an up CPU. ### Parameters #### Path Parameters - **cpu_id** (u32) - Required - The ID of the CPU. ### Function Signature `pub fn migrate_info_up_cpu(cpu_id: u32) -> Result<(), psci::error::Error>` ``` -------------------------------- ### Get SMC Calling Convention Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/fn.version.html Call this function to retrieve the version of the SMC Calling Convention implemented by the system. It requires a generic type C that implements the Call trait. ```rust pub fn version() -> Result ``` -------------------------------- ### Generic CloneToUninit Implementation Source: https://docs.rs/smccc/0.2.2/smccc/psci/enum.LowestAffinityLevel.html Demonstrates a blanket implementation of the nightly-only experimental API `clone_to_uninit` for any type `T` that implements `Clone`. This allows cloning into uninitialized memory. ```rust impl CloneToUninit for T where T: Clone, { unsafe fn clone_to_uninit(&self, dest: *mut u8) { // ... implementation details ... } } ``` -------------------------------- ### Try Convert Between Types Source: https://docs.rs/smccc/0.2.2/smccc/arch/enum.SocIdType.html Shows how to attempt conversions between types that may fail, using TryFrom and TryInto. ```rust type Error = Infallible ``` ```rust fn try_from(value: U) -> Result>::Error> ``` ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Copy Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Indicates that Version instances can be copied. ```APIDOC ### impl Copy for Version ``` -------------------------------- ### Convert Between Types with From and Into Source: https://docs.rs/smccc/0.2.2/smccc/arch/enum.SocIdType.html Demonstrates conversions between types using the From and Into traits. ```rust fn from(t: T) -> T ``` ```rust fn into(self) -> U ``` -------------------------------- ### PartialEq Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Provides equality comparison for Version instances. ```APIDOC ### impl PartialEq for Version #### fn eq(&self, other: &Version) -> bool Tests for `self` and `other` values to be equal, and is used by `==`. #### fn ne(&self, other: &Rhs) -> bool Tests for `!=`. ``` -------------------------------- ### Eq Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Indicates that Version instances support total equality. ```APIDOC ### impl Eq for Version ``` -------------------------------- ### hvc64 Source: https://docs.rs/smccc Makes an HVC64 call to the hypervisor, following the SMC Calling Convention version 1.4. ```APIDOC ## hvc64 ### Description Makes an HVC64 call to the hypervisor, following the SMC Calling Convention version 1.4. ### Method HVC64 ### Endpoint N/A (Function call) ### Parameters None explicitly defined in source. ### Request Example N/A ### Response N/A ``` -------------------------------- ### hvc64 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Invokes a Hypervisor Call (HVC) with 64-bit arguments. ```APIDOC ## hvc64 ### Description Invokes a Hypervisor Call (HVC) with 64-bit arguments. ### Function Signature `pub fn hvc64(arg1: u64, arg2: u64, arg3: u64, arg4: u64) -> u64` ``` -------------------------------- ### migrate Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.migrate.html Asks the Trusted OS to migrate its context to a specific core. ```APIDOC ## migrate ### Description Asks the Trusted OS to migrate its context to a specific core. ### Signature ```rust pub fn migrate(target_cpu: u64) -> Result<(), Error> ``` ### Parameters #### Path Parameters - **target_cpu** (u64) - Required - The target CPU core to migrate to. ### Returns - `Result<(), Error>` - Ok(()) on success, or an Error on failure. ``` -------------------------------- ### version Source: https://docs.rs/smccc/0.2.2/smccc/arch/fn.version.html Returns the implemented version of the SMC Calling Convention. ```APIDOC ## version smccc::arch # Function version Copy item path Source Search Settings Help ## Summary ```rust pub fn version() -> Result ``` ## Description Returns the implemented version of the SMC Calling Convention. ``` -------------------------------- ### Shut Down the System Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_off.html Call this function to initiate a system shutdown. It returns a Result indicating success or failure. ```rust pub fn system_off() -> Result<(), Error> ``` -------------------------------- ### Compare Version instances Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Compares two Version instances to determine their ordering. Supports standard comparison operations like less than, greater than, and equality. ```rust fn cmp(&self, other: &Version) -> Ordering ``` ```rust fn eq(&self, other: &Version) -> bool ``` ```rust fn partial_cmp(&self, other: &Version) -> Option ``` -------------------------------- ### migrate_info_up_cpu Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.migrate_info_up_cpu.html Returns the MPIDR value of the current resident core of the Trusted OS. ```APIDOC ## Function migrate_info_up_cpu ### Description Returns the MPIDR value of the current resident core of the Trusted OS. ### Signature ```rust pub fn migrate_info_up_cpu() -> u64 ``` ``` -------------------------------- ### Migrate Trusted OS Context Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.migrate.html Asks the Trusted OS to migrate its context to a specific core. Requires a target CPU identifier. ```rust pub fn migrate(target_cpu: u64) -> Result<(), Error> ``` -------------------------------- ### Clone Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Provides methods for cloning Version instances. ```APIDOC ### impl Clone for Version #### fn clone(&self) -> Version Returns a duplicate of the value. #### fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ``` -------------------------------- ### psci::system_reset Source: https://docs.rs/smccc/0.2.2/smccc/all.html Resets the system. ```APIDOC ## psci::system_reset ### Description Resets the system. ### Function Signature `pub fn system_reset() -> !` ``` -------------------------------- ### hvc32 Source: https://docs.rs/smccc/0.2.2/smccc/index.html Makes an HVC32 call to the hypervisor, following the SMC Calling Convention version 1.4. ```APIDOC ## hvc32 ### Description Makes an HVC32 call to the hypervisor, following the SMC Calling Convention version 1.4. ### Function Signature ```rust fn hvc32(...) -> Result ``` ### Parameters This function accepts a generic type `T` that implements the `Call` trait. ### Returns Returns a `Result` which is either the successful return type `T::Ret` or an `Error`. ``` -------------------------------- ### psci::migrate Source: https://docs.rs/smccc/0.2.2/smccc/all.html Migrates a task to another CPU. ```APIDOC ## psci::migrate ### Description Migrates a task to another CPU. ### Parameters #### Path Parameters - **target_cpu_id** (u32) - Required - The ID of the target CPU. - **target_thread_id** (u64) - Required - The ID of the target thread. ### Function Signature `pub fn migrate(target_cpu_id: u32, target_thread_id: u64) -> Result<(), psci::error::Error>` ``` -------------------------------- ### Ord Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Provides ordering capabilities for Version instances. ```APIDOC ### impl Ord for Version #### fn cmp(&self, other: &Version) -> Ordering This method returns an `Ordering` between `self` and `other`. #### fn max(self, other: Self) -> Self Compares and returns the maximum of two values. #### fn min(self, other: Self) -> Self Compares and returns the minimum of two values. #### fn clamp(self, min: Self, max: Self) -> Self Restrict a value to a certain interval. ``` -------------------------------- ### migrate_32 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.migrate_32.html Asks the Trusted OS to migrate its context to a specific core. ```APIDOC ## migrate_32 ### Description Asks the Trusted OS to migrate its context to a specific core. ### Signature ```rust pub fn migrate_32(target_cpu: u32) -> Result<(), Error> ``` ### Parameters #### Path Parameters - **target_cpu** (u32) - Required - The target CPU core to migrate to. ### Returns - `Result<(), Error>` - Ok(()) on success, or an Error on failure. ``` -------------------------------- ### psci::migrate_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Migrates a task to another CPU using 32-bit arguments. ```APIDOC ## psci::migrate_32 ### Description Migrates a task to another CPU using 32-bit arguments. ### Parameters #### Path Parameters - **target_cpu_id** (u32) - Required - The ID of the target CPU. - **target_thread_id** (u32) - Required - The ID of the target thread. ### Function Signature `pub fn migrate_32(target_cpu_id: u32, target_thread_id: u32) -> Result<(), psci::error::Error>` ``` -------------------------------- ### hvc32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Invokes a Hypervisor Call (HVC) with 32-bit arguments. ```APIDOC ## hvc32 ### Description Invokes a Hypervisor Call (HVC) with 32-bit arguments. ### Function Signature `pub fn hvc32(arg1: u32, arg2: u32, arg3: u32, arg4: u32) -> u32` ``` -------------------------------- ### PartialEq Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/psci/struct.Version.html Provides methods for checking equality between Version instances. ```rust fn eq(&self, other: &Version) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### Implement TryFrom for PowerState Source: https://docs.rs/smccc/0.2.2/smccc/psci/enum.PowerState.html Allows conversion from an i32 to a PowerState. This is useful for deserializing power state values received as integers. ```rust type Error = Error; fn try_from(value: i32) -> Result ``` -------------------------------- ### Debug Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Enables debugging output for Version instances. ```APIDOC ### impl Debug for Version #### fn fmt(&self, f: &mut Formatter<'_>) -> Result Formats the value using the given formatter. ``` -------------------------------- ### smc64 Source: https://docs.rs/smccc/0.2.2/smccc/fn.smc64.html Makes an SMC64 call to the firmware, following the SMC Calling Convention version 1.4. ```APIDOC ## smc64 ### Description Makes an SMC64 call to the firmware, following the SMC Calling Convention version 1.4. ### Signature ```rust pub fn smc64(function: u32, args: [u64; 17]) -> [u64; 18] ``` ### Parameters * **function** (u32) - The function identifier for the SMC call. * **args** ([u64; 17]) - An array of 17 u64 values representing the arguments for the SMC call. ### Returns * **[u64; 18]** - An array of 18 u64 values representing the result of the SMC call. ``` -------------------------------- ### migrate_info_up_cpu_32 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.migrate_info_up_cpu_32.html Returns the MPIDR value of the current resident core of the Trusted OS. ```APIDOC ## Function migrate_info_up_cpu_32 ### Description Returns the MPIDR value of the current resident core of the Trusted OS. ### Signature ```rust pub fn migrate_info_up_cpu_32() -> u32 ``` ### Type Parameters * `C`: A type that implements the `Call` trait. ``` -------------------------------- ### cpu_freeze Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.cpu_freeze.html Puts the current core into an implementation-defined low power state. ```APIDOC ## Function cpu_freeze ### Description Puts the current core into an implementation-defined low power state. ### Signature ```rust pub fn cpu_freeze() -> Result<(), Error> ``` ``` -------------------------------- ### arch_workaround_3 Source: https://docs.rs/smccc/0.2.2/smccc/arch/fn.arch_workaround_3.html Executes a firmware workaround to mitigate CVE-2017-5715 and CVE-2022-23960. ```APIDOC ## arch_workaround_3 ### Description Executes a firmware workaround to mitigate CVE-2017-5715 and CVE-2022-23960. ### Signature ```rust pub fn arch_workaround_3() -> Result<(), Error> ``` ``` -------------------------------- ### PartialOrd Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Provides partial ordering capabilities for Version instances. ```APIDOC ### impl PartialOrd for Version #### fn partial_cmp(&self, other: &Version) -> Option This method returns an ordering between `self` and `other` values if one exists. #### fn lt(&self, other: &Rhs) -> bool Tests less than (for `self` and `other`) and is used by the `<` operator. #### fn le(&self, other: &Rhs) -> bool Tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. #### fn gt(&self, other: &Rhs) -> bool Tests greater than (for `self` and `other`) and is used by the `>` operator. #### fn ge(&self, other: &Rhs) -> bool Tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. ``` -------------------------------- ### cpu_on Function Signature Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.cpu_on.html This is the function signature for cpu_on. It takes the target CPU ID, the entry point address, and the context ID as arguments. It returns a Result indicating success or an error. ```rust pub fn cpu_on( target_cpu: u64, entry_point_address: u64, context_id: u64, ) -> Result<(), Error> ``` -------------------------------- ### arch::version Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves the architecture version. ```APIDOC ## arch::version ### Description Retrieves the architecture version. ### Function Signature `pub fn version()` ``` -------------------------------- ### StructuralPartialEq Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Indicates structural partial equality for Version instances. ```APIDOC ### impl StructuralPartialEq for Version ``` -------------------------------- ### Ord Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/psci/struct.Version.html Provides methods for ordering and comparing Version instances. ```rust fn cmp(&self, other: &Version) -> Ordering ``` ```rust fn max(self, other: Self) -> Self ``` ```rust fn min(self, other: Self) -> Self ``` ```rust fn clamp(self, min: Self, max: Self) -> Self ``` -------------------------------- ### arch_workaround_1 Source: https://docs.rs/smccc/0.2.2/smccc/arch/fn.arch_workaround_1.html Executes a firmware workaround to mitigate CVE-2017-5715. ```APIDOC ## Function arch_workaround_1 ### Description Executes a firmware workaround to mitigate CVE-2017-5715. ### Signature ```rust pub fn arch_workaround_1() -> Result<(), Error> ``` ``` -------------------------------- ### system_suspend Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_suspend.html Suspends the system to RAM. It takes the entry point address and context ID as arguments and returns a Result. ```APIDOC ## Function system_suspend ### Description Suspends the system to RAM. ### Signature ```rust pub fn system_suspend( entry_point_address: u64, context_id: u64, ) -> Result<(), Error> ``` ### Parameters * `entry_point_address` (u64) - The address of the entry point. * `context_id` (u64) - The ID of the context. ### Returns * `Result<(), Error>` - Ok(()) if successful, or an Error if the operation fails. ``` -------------------------------- ### call64 Method Source: https://docs.rs/smccc/0.2.2/smccc/trait.Call.html Makes a call using the 64-bit calling convention. Ensure the function and argument types match the expected 64-bit format. ```rust fn call64(function: u32, args: [u64; 17]) -> [u64; 18]; ``` -------------------------------- ### PartialOrd Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/psci/struct.Version.html Provides methods for partial ordering and comparison of Version instances. ```rust fn partial_cmp(&self, other: &Version) -> Option ``` ```rust fn lt(&self, other: &Rhs) -> bool ``` ```rust fn le(&self, other: &Rhs) -> bool ``` ```rust fn gt(&self, other: &Rhs) -> bool ``` ```rust fn ge(&self, other: &Rhs) -> bool ``` -------------------------------- ### psci::system_reset2 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Resets the system with an optional message. ```APIDOC ## psci::system_reset2 ### Description Resets the system with an optional message. ### Parameters #### Path Parameters - **reset_type** (u32) - Required - The type of reset. - **message** (u64) - Required - An optional message. ### Function Signature `pub fn system_reset2(reset_type: u32, message: u64) -> !` ``` -------------------------------- ### psci::system_reset2_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Resets the system with an optional message using 32-bit arguments. ```APIDOC ## psci::system_reset2_32 ### Description Resets the system with an optional message using 32-bit arguments. ### Parameters #### Path Parameters - **reset_type** (u32) - Required - The type of reset. - **message** (u32) - Required - An optional message. ### Function Signature `pub fn system_reset2_32(reset_type: u32, message: u32) -> !` ``` -------------------------------- ### smc64 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Invokes a System Management Call (SMC) with 64-bit arguments. ```APIDOC ## smc64 ### Description Invokes a System Management Call (SMC) with 64-bit arguments. ### Function Signature `pub fn smc64(arg1: u64, arg2: u64, arg3: u64, arg4: u64) -> u64` ``` -------------------------------- ### PSCI_MIGRATE_INFO_UP_CPU_32 Constant Definition Source: https://docs.rs/smccc/0.2.2/smccc/psci/constant.PSCI_MIGRATE_INFO_UP_CPU_32.html Defines the PSCI_MIGRATE_INFO_UP_CPU_32 constant with its associated u32 value. ```rust pub const PSCI_MIGRATE_INFO_UP_CPU_32: u32 = 0x84000007; ``` -------------------------------- ### Clone Implementation for Version Source: https://docs.rs/smccc/0.2.2/smccc/psci/struct.Version.html Provides methods to duplicate and copy-assign Version values. ```rust fn clone(&self) -> Version ``` ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### system_reset2 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_reset2.html Resets the system in an architectural or vendor-specific way. ```APIDOC ## Function system_reset2 ### Description Resets the system in an architectural or vendor-specific way. ### Signature ```rust pub fn system_reset2(reset_type: u32, cookie: u64) -> Result<(), Error> ``` ### Parameters * `reset_type` (u32) - Specifies the type of reset. * `cookie` (u64) - A cookie value for the reset operation. ``` -------------------------------- ### system_reset Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_reset.html Resets the system. This function is generic over the Call trait and returns a Result. ```APIDOC ## Function system_reset ### Description Resets the system. ### Signature ```rust pub fn system_reset() -> Result<(), Error> ``` ### Parameters This function does not take any direct parameters, but it is generic over the `Call` trait. ### Returns Returns `Ok(())` on successful reset, or an `Error` if the reset fails. ``` -------------------------------- ### PSCI_MIGRATE_INFO_UP_CPU_64 Source: https://docs.rs/smccc/0.2.2/smccc/psci/constant.PSCI_MIGRATE_INFO_UP_CPU_64.html The PSCI_MIGRATE_INFO_UP_CPU_64 constant is a u32 value used in the smccc crate, likely for PSCI (Power State Coordination Interface) related operations. ```APIDOC ## Constant PSCI_MIGRATE_INFO_UP_CPU_64 ### Summary ```rust pub const PSCI_MIGRATE_INFO_UP_CPU_64: u32 = 0xC4000007; ``` ### Description This constant represents a specific PSCI migration information flag for UP (Uniprocessor) CPU in a 64-bit context. It is defined within the `smccc::psci` module. ``` -------------------------------- ### smc32 Source: https://docs.rs/smccc/0.2.2/smccc/index.html Makes an SMC32 call to the firmware, following the SMC Calling Convention version 1.4. ```APIDOC ## smc32 ### Description Makes an SMC32 call to the firmware, following the SMC Calling Convention version 1.4. ### Function Signature ```rust fn smc32(...) -> Result ``` ### Parameters This function accepts a generic type `T` that implements the `Call` trait. ### Returns Returns a `Result` which is either the successful return type `T::Ret` or an `Error`. ``` -------------------------------- ### arch::arch_workaround_2 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Applies architecture-specific workaround 2. ```APIDOC ## arch::arch_workaround_2 ### Description Applies architecture-specific workaround 2. ### Function Signature `pub fn arch_workaround_2()` ``` -------------------------------- ### TryFrom for MigrateType Source: https://docs.rs/smccc/0.2.2/smccc/psci/enum.MigrateType.html Enables conversion from an i32 to a MigrateType. This is useful when receiving migration type information as an integer. ```rust impl TryFrom for MigrateType { type Error = Error; fn try_from(value: i32) -> Result { // ... implementation details ... } } ``` -------------------------------- ### psci::version Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves the PSCI version. ```APIDOC ## psci::version ### Description Retrieves the PSCI version. ### Function Signature `pub fn version() -> u32` ``` -------------------------------- ### PowerState TryFrom Implementation Source: https://docs.rs/smccc/0.2.2/smccc/psci/enum.PowerState.html Allows conversion from an i32 value to a PowerState enum variant. ```APIDOC ### impl TryFrom for PowerState #### fn try_from(value: i32) -> Result Performs the conversion from an i32 to a PowerState. Returns an Error if the i32 value does not correspond to a valid PowerState variant. ``` -------------------------------- ### call64 Source: https://docs.rs/smccc/0.2.2/smccc/trait.Call.html Makes a call using the 64-bit calling convention. It takes a function identifier and an array of 17 u64 arguments, returning an array of 18 u64 results. ```APIDOC ## fn call64(function: u32, args: [u64; 17]) -> [u64; 18] ### Description Makes a call using the 64-bit calling convention. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters - **function** (u32) - Description for function parameter - **args** ([u64; 17]) - Description for args parameter ### Returns - **[u64; 18]** - An array of 18 u64 values representing the call result. ``` -------------------------------- ### call32 Method Source: https://docs.rs/smccc/0.2.2/smccc/trait.Call.html Makes a call using the 32-bit calling convention. Ensure the function and argument types match the expected 32-bit format. ```rust fn call32(function: u32, args: [u32; 7]) -> [u32; 8]; ``` -------------------------------- ### psci::affinity_info_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves affinity information for a CPU using 32-bit arguments. ```APIDOC ## psci::affinity_info_32 ### Description Retrieves affinity information for a CPU using 32-bit arguments. ### Function Signature `pub fn affinity_info_32(cpu_id: u32) -> Result<(u32, u32), psci::error::Error>` ``` -------------------------------- ### arch::arch_workaround_3 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Applies architecture-specific workaround 3. ```APIDOC ## arch::arch_workaround_3 ### Description Applies architecture-specific workaround 3. ### Function Signature `pub fn arch_workaround_3()` ``` -------------------------------- ### Version Struct Definition Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Defines the structure of the Version, which includes major and minor version components. ```APIDOC ## Struct Version ### Summary ``` pub struct Version { pub major: u16, pub minor: u16, } ``` ### Description A version of the SMC Calling Convention. ### Fields - `major: u16` - `minor: u16` ``` -------------------------------- ### arch_workaround_2 Source: https://docs.rs/smccc/0.2.2/smccc/arch/fn.arch_workaround_2.html Enables or disables the mitigation for CVE-2018-3639. ```APIDOC ## Function arch_workaround_2 ### Description Enables or disables the mitigation for CVE-2018-3639. ### Signature ```rust pub fn arch_workaround_2(enable: bool) -> Result<(), Error> ``` ### Parameters * `enable` (bool) - Required - A boolean value to enable or disable the mitigation. ``` -------------------------------- ### psci::node_hw_state Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves the hardware state of a node. ```APIDOC ## psci::node_hw_state ### Description Retrieves the hardware state of a node. ### Parameters #### Path Parameters - **node_id** (u32) - Required - The ID of the node. ### Function Signature `pub fn node_hw_state(node_id: u32) -> Result` ``` -------------------------------- ### Provide method for Error Source: https://docs.rs/smccc/0.2.2/smccc/psci/error/enum.Error.html An experimental nightly-only API for providing type-based access to error context, intended for error reporting. ```rust fn provide<'a>(&'a self, request: &mut Request<'a>) ``` -------------------------------- ### Execute Firmware Workaround - arch_workaround_3 Source: https://docs.rs/smccc/0.2.2/smccc/arch/fn.arch_workaround_3.html Executes a firmware workaround to mitigate CVE-2017-5715 and CVE-2022-23960. This function requires a generic type C that implements the Call trait. ```rust pub fn arch_workaround_3() -> Result<(), Error> ``` -------------------------------- ### psci::node_hw_state_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves the hardware state of a node using 32-bit arguments. ```APIDOC ## psci::node_hw_state_32 ### Description Retrieves the hardware state of a node using 32-bit arguments. ### Parameters #### Path Parameters - **node_id** (u32) - Required - The ID of the node. ### Function Signature `pub fn node_hw_state_32(node_id: u32) -> Result` ``` -------------------------------- ### cpu_off Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.cpu_off.html Powers down the current core. ```APIDOC ## Function cpu_off ### Description Powers down the current core. ### Signature ```rust pub fn cpu_off() -> Result<(), Error> ``` ``` -------------------------------- ### psci::affinity_info Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves affinity information for a CPU. ```APIDOC ## psci::affinity_info ### Description Retrieves affinity information for a CPU. ### Function Signature `pub fn affinity_info(cpu_id: u32) -> Result<(u32, u32), psci::error::Error>` ``` -------------------------------- ### hvc64 Function Source: https://docs.rs/smccc/0.2.2/smccc/fn.hvc64.html This function makes an HVC64 call to the hypervisor, following the SMC Calling Convention version 1.4. ```APIDOC ## Function hvc64 ### Description Makes an HVC64 call to the hypervisor, following the SMC Calling Convention version 1.4. ### Signature ```rust pub fn hvc64(function: u32, args: [u64; 17]) -> [u64; 18] ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **function** (u32) - The function identifier for the HVC call. * **args** ([u64; 17]) - An array of 17 u64 values representing the arguments for the HVC call. ### Response #### Success Response (200) * **[u64; 18]** - An array of 18 u64 values representing the return values from the HVC call. ### Request Example ```rust let function_id = 0x1; let arguments = [0u64; 17]; let result = hvc64(function_id, arguments); ``` ### Response Example ```rust // Assuming a successful call, result would be an array of 18 u64 values. // Example: [0x1234567890ABCDEF, 0xFEDCBA0987654321, ...] let result: [u64; 18] = [0u64; 18]; ``` ``` -------------------------------- ### system_reset2_32 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_reset2_32.html Resets the system in an architectural or vendor-specific way. ```APIDOC ## Function system_reset2_32 ### Description Resets the system in an architectural or vendor-specific way. ### Signature ```rust pub fn system_reset2_32( reset_type: u32, cookie: u32, ) -> Result<(), Error> ``` ### Parameters * `reset_type` (u32) - Specifies the type of reset. * `cookie` (u32) - A cookie value for the reset operation. ``` -------------------------------- ### Convert i32 to Version Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Attempts to convert an i32 integer into a Version struct. This conversion may fail if the i32 value is not representable as a valid Version. ```rust type Error = Error ``` ```rust fn try_from(value: i32) -> Result ``` -------------------------------- ### smc32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Invokes a System Management Call (SMC) with 32-bit arguments. ```APIDOC ## smc32 ### Description Invokes a System Management Call (SMC) with 32-bit arguments. ### Function Signature `pub fn smc32(arg1: u32, arg2: u32, arg3: u32, arg4: u32) -> u32` ``` -------------------------------- ### arch::arch_workaround_1 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Applies architecture-specific workaround 1. ```APIDOC ## arch::arch_workaround_1 ### Description Applies architecture-specific workaround 1. ### Function Signature `pub fn arch_workaround_1()` ``` -------------------------------- ### psci::system_suspend_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Suspends the system using 32-bit arguments. ```APIDOC ## psci::system_suspend_32 ### Description Suspends the system using 32-bit arguments. ### Parameters #### Path Parameters - **state** (u32) - Required - The suspend mode to use. ### Function Signature `pub fn system_suspend_32(state: u32) -> Result<(), psci::error::Error>` ``` -------------------------------- ### Define PSCI_MIGRATE_INFO_UP_CPU_64 Constant Source: https://docs.rs/smccc/0.2.2/smccc/psci/constant.PSCI_MIGRATE_INFO_UP_CPU_64.html This constant represents a specific PSCI (Power State Coordination Interface) migrate info value for UP CPU. It is defined as a u32 hexadecimal value. ```rust pub const PSCI_MIGRATE_INFO_UP_CPU_64: u32 = 0xC4000007; ``` -------------------------------- ### psci::cpu_freeze Source: https://docs.rs/smccc/0.2.2/smccc/all.html Freezes the current CPU. ```APIDOC ## psci::cpu_freeze ### Description Freezes the current CPU. ### Function Signature `pub fn cpu_freeze() -> Result<(), psci::error::Error>` ``` -------------------------------- ### system_suspend_32 Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_suspend_32.html Suspends the system to RAM. This function takes an entry point address and a context ID as parameters. ```APIDOC ## Function system_suspend_32 ### Description Suspends the system to RAM. ### Signature ```rust pub fn system_suspend_32(entry_point_address: u32, context_id: u32) -> Result<(), Error> ``` ### Parameters * `entry_point_address` (u32) - The address of the entry point. * `context_id` (u32) - The ID of the context. ### Returns * `Result<(), Error>` - Ok(()) if the operation is successful, otherwise an Error. ``` -------------------------------- ### psci::stat_residency_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves residency statistics for a CPU using 32-bit arguments. ```APIDOC ## psci::stat_residency_32 ### Description Retrieves residency statistics for a CPU using 32-bit arguments. ### Parameters #### Path Parameters - **cpu_id** (u32) - Required - The ID of the CPU. ### Function Signature `pub fn stat_residency_32(cpu_id: u32) -> Result` ``` -------------------------------- ### psci::cpu_default_suspend_32 Source: https://docs.rs/smccc/0.2.2/smccc/all.html Suspends the current CPU with default settings using 32-bit arguments. ```APIDOC ## psci::cpu_default_suspend_32 ### Description Suspends the current CPU with default settings using 32-bit arguments. ### Function Signature `pub fn cpu_default_suspend_32(state: u32) -> Result<(), psci::error::Error>` ``` -------------------------------- ### arch::features Source: https://docs.rs/smccc/0.2.2/smccc/all.html Retrieves architecture-specific features. ```APIDOC ## arch::features ### Description Retrieves architecture-specific features. ### Function Signature `pub fn features()` ``` -------------------------------- ### Implement TryInto for T Source: https://docs.rs/smccc/0.2.2/smccc/arch/error/enum.Error.html Attempts to convert a value of type T into a value of type U, returning a Result. This is the reciprocal of TryFrom. ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Struct Version Definition Source: https://docs.rs/smccc/0.2.2/smccc/arch/struct.Version.html Defines the structure for a version, containing major and minor version numbers. ```rust pub struct Version { pub major: u16, pub minor: u16, } ``` -------------------------------- ### system_reset Function Signature Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_reset.html This is the function signature for system_reset. It returns a Result indicating success or an Error. ```rust pub fn system_reset() -> Result<(), Error> ``` -------------------------------- ### psci::system_off Source: https://docs.rs/smccc/0.2.2/smccc/all.html Shuts down the system. ```APIDOC ## psci::system_off ### Description Shuts down the system. ### Function Signature `pub fn system_off() -> !` ``` -------------------------------- ### TryInto for T implementation Source: https://docs.rs/smccc/0.2.2/smccc/psci/error/enum.Error.html Provides a generic fallible conversion from type T into type U, provided that U implements `TryFrom`. This is a blanket implementation for convenience. ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### system_suspend Function Signature Source: https://docs.rs/smccc/0.2.2/smccc/psci/fn.system_suspend.html This is the function signature for system_suspend. It takes an entry point address and a context ID, and returns a Result. ```rust pub fn system_suspend( entry_point_address: u64, context_id: u64, ) -> Result<(), Error> ``` -------------------------------- ### PSCI Constants Source: https://docs.rs/smccc/0.2.2/smccc/psci/index.html This section lists the constants defined for version 1.1 of the Arm Power State Coordination Interface (PSCI). These constants represent various PSCI function identifiers. ```APIDOC ## Constants PSCI_AFFINITY_INFO_32 PSCI_AFFINITY_INFO_64 PSCI_CPU_DEFAULT_SUSPEND_32 PSCI_CPU_DEFAULT_SUSPEND_64 PSCI_CPU_FREEZE PSCI_CPU_OFF PSCI_CPU_ON_32 PSCI_CPU_ON_64 PSCI_CPU_SUSPEND_32 PSCI_CPU_SUSPEND_64 PSCI_FEATURES PSCI_MEM_PROTECT PSCI_MEM_PROTECT_CHECK_RANGE_32 PSCI_MEM_PROTECT_CHECK_RANGE_64 PSCI_MIGRATE_32 PSCI_MIGRATE_64 PSCI_MIGRATE_INFO_TYPE PSCI_MIGRATE_INFO_UP_CPU_32 PSCI_MIGRATE_INFO_UP_CPU_64 PSCI_NODE_HW_STATE_32 PSCI_NODE_HW_STATE_64 PSCI_SET_SUSPEND_MODE PSCI_STAT_COUNT_32 PSCI_STAT_COUNT_64 PSCI_STAT_RESIDENCY_32 PSCI_STAT_RESIDENCY_64 PSCI_SYSTEM_OFF PSCI_SYSTEM_RESET PSCI_SYSTEM_RESET2_32 PSCI_SYSTEM_RESET2_64 PSCI_SYSTEM_SUSPEND_32 PSCI_SYSTEM_SUSPEND_64 PSCI_VERSION ```