axplat/
power.rs

1//! Power management.
2
3/// Power management interface.
4#[def_plat_interface]
5pub trait PowerIf {
6    /// Bootstraps the given CPU core with the given initial stack (in physical
7    /// address).
8    ///
9    /// Where `cpu_id` is the logical CPU ID (0, 1, ..., N-1, N is the number of
10    /// CPU cores on the platform).
11    #[cfg(feature = "smp")]
12    fn cpu_boot(cpu_id: usize, stack_top_paddr: usize);
13
14    /// Shutdown the whole system.
15    fn system_off() -> !;
16
17    /// Get the number of CPU cores available on this platform.
18    ///
19    /// The platform should either get this value statically from its
20    /// configuration or dynamically by platform-specific methods.
21    ///
22    /// For statically configured platforms, by convention, this value should be
23    /// the same as `MAX_CPU_NUM` defined in the platform configuration.
24    fn cpu_num() -> usize;
25}