// Updates the kernel's CPU performance info to match the provided P-state.
Updates the kernel's CPU performance info to match the provided P-state.
Updates the kernel ' s CPU performance info to match the provided P - state .
async fn update_kernel_performance_info(
        &self,
        syscall_handler: &Rc<dyn Node>,
        target_pstate: &PState,
    ) -> Result<(), PowerManagerError> {
        let performance_scale: sys::zx_cpu_performance_scale_t =
            self.performance_per_ghz.mul_scalar(target_pstate.frequency.0 / 1e9).try_into()?;
        let performance_info = self
            .logical_cpu_numbers
            .iter()
            .map(|n| sys::zx_cpu_performance_info_t { logical_cpu_number: *n, performance_scale })
            .collect::<Vec<_>>();
        let msg = Message::SetCpuPerformanceInfo(performance_info);
        match syscall_handler.handle_message(&msg).await {
            Ok(MessageReturn::SetCpuPerformanceInfo) => Ok(()),
            Ok(other) => panic!("Unexpected SetCpuPerformanceInfo result: {:?}", other),
            Err(e) => Err(e),
        }
    }
async fn update_kernel_performance_info ( & self , syscall_handler : & Rc < dyn Node > , target_pstate : & PState , ) -> Result < ( ) , PowerManagerError > { let performance_scale : sys :: zx_cpu_performance_scale_t = self . performance_per_ghz . mul_scalar ( target_pstate . frequency . 0 / 1e9 ) . try_into ( ) ? ; let performance_info = self . logical_cpu_numbers . iter ( ) . map ( | n | sys :: zx_cpu_performance_info_t { logical_cpu_number : * n , performance_scale } ) . collect :: < Vec < _ > > ( ) ; let msg = Message :: SetCpuPerformanceInfo ( performance_info ) ; match syscall_handler . handle_message ( & msg ) . await { Ok ( MessageReturn :: SetCpuPerformanceInfo ) => Ok ( ( ) ) , Ok ( other ) => panic ! ( " " other ) , Err ( e ) => Err ( e ) , } }
Updates the kernel's CPU performance info to match the provided P-state.
Updates the kernel ' s CPU performance info to match the provided P - state .
&self
syscall_handler
&Rc<dyn Node>
target_pstate
&PState