devices/
virtcpufreq.rs

1// Copyright 2023 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::pci::CrosvmDeviceId;
6use crate::BusDevice;
7use crate::DeviceId;
8use crate::Suspendable;
9
10pub struct VirtCpufreq {}
11
12// Stub implementation for a virtual cpufreq device. Do not remove.
13// Implementation will be added once linux upstream interface stablizes.
14impl VirtCpufreq {
15    pub fn new(pcpu: u32, _cpu_capacity: u32, _cpu_fmax: u32) -> Self {
16        panic!("Virt Cpufreq not supported, do not use! {pcpu}");
17    }
18}
19
20impl BusDevice for VirtCpufreq {
21    fn device_id(&self) -> DeviceId {
22        CrosvmDeviceId::VirtCpufreq.into()
23    }
24
25    fn debug_label(&self) -> String {
26        "VirtCpufreq Device".to_owned()
27    }
28}
29
30impl Suspendable for VirtCpufreq {}