1 // Copyright 2020 The Chromium OS Authors. All rights reserved. 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 hypervisor::DeviceKind; 7 8 use crate::IrqChip; 9 10 pub trait IrqChipAArch64: IrqChip { 11 // Clones this trait as a `Box` version of itself. try_box_clone(&self) -> Result<Box<dyn IrqChipAArch64>>12 fn try_box_clone(&self) -> Result<Box<dyn IrqChipAArch64>>; 13 14 // Get this as the super-trait IrqChip. as_irq_chip(&self) -> &dyn IrqChip15 fn as_irq_chip(&self) -> &dyn IrqChip; 16 17 // Get this as the mutable super-trait IrqChip. as_irq_chip_mut(&mut self) -> &mut dyn IrqChip18 fn as_irq_chip_mut(&mut self) -> &mut dyn IrqChip; 19 20 /// Get the version of VGIC that this chip is emulating. Currently KVM may either implement 21 /// VGIC version 2 or 3. get_vgic_version(&self) -> DeviceKind22 fn get_vgic_version(&self) -> DeviceKind; 23 24 /// Once all the VCPUs have been enabled, finalize the irq chip. finalize(&self) -> Result<()>25 fn finalize(&self) -> Result<()>; 26 } 27