Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/devices/src/irqchip/riscv64.rs
5394 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 base::Result;
6
use snapshot::AnySnapshot;
7
8
use crate::IrqChip;
9
10
pub trait IrqChipRiscv64: IrqChip {
11
/// Clones this trait as a `Box` version of itself.
12
fn try_box_clone(&self) -> Result<Box<dyn IrqChipRiscv64>>;
13
14
/// Returns self as the super-trait IrqChip.
15
fn as_irq_chip(&self) -> &dyn IrqChip;
16
17
/// Returns self as the mutable super-trait IrqChip.
18
fn as_irq_chip_mut(&mut self) -> &mut dyn IrqChip;
19
20
/// Completes IrqChip setup. Must be called after Vcpus are created.
21
fn finalize(&self) -> Result<()>;
22
23
/// Returns the number of ids and sources supported by this IrqChip(assuming it's AIA).
24
fn get_num_ids_sources(&self) -> (usize, usize);
25
26
// Snapshot irqchip.
27
fn snapshot(&self, _cpus_num: usize) -> anyhow::Result<AnySnapshot> {
28
anyhow::bail!("snapshot not yet implemented for riscv64")
29
}
30
31
fn restore(&mut self, _data: AnySnapshot, _vcpus_num: usize) -> anyhow::Result<()> {
32
anyhow::bail!("restore not yet implemented for riscv64")
33
}
34
}
35
36