Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/devices/src/virtcpufreq.rs
5392 views
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
5
use vm_control::DeviceId;
6
use vm_control::PlatformDeviceId;
7
8
use crate::BusDevice;
9
use crate::Suspendable;
10
11
pub struct VirtCpufreq {}
12
13
// Stub implementation for a virtual cpufreq device. Do not remove.
14
// Implementation will be added once linux upstream interface stablizes.
15
impl VirtCpufreq {
16
pub fn new(pcpu: u32, _cpu_capacity: u32, _cpu_fmax: u32) -> Self {
17
panic!("Virt Cpufreq not supported, do not use! {pcpu}");
18
}
19
}
20
21
impl BusDevice for VirtCpufreq {
22
fn device_id(&self) -> DeviceId {
23
PlatformDeviceId::VirtCpufreq.into()
24
}
25
26
fn debug_label(&self) -> String {
27
"VirtCpufreq Device".to_owned()
28
}
29
}
30
31
impl Suspendable for VirtCpufreq {}
32
33