(
vcpu_count: u32,
interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
vm: Arc<dyn hypervisor::Vm>,
)
| 40 | impl Gic { |
| 41 | #[allow(clippy::needless_pass_by_value)] |
| 42 | pub fn new( |
| 43 | vcpu_count: u32, |
| 44 | interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>, |
| 45 | vm: Arc<dyn hypervisor::Vm>, |
| 46 | ) -> Result<Gic> { |
| 47 | let interrupt_source_group = interrupt_manager |
| 48 | .create_group(MsiIrqGroupConfig { |
| 49 | base: IRQ_LEGACY_BASE as InterruptIndex, |
| 50 | count: IRQ_LEGACY_COUNT as InterruptIndex, |
| 51 | }) |
| 52 | .map_err(Error::CreateInterruptSourceGroup)?; |
| 53 | |
| 54 | let config = Gic::create_default_config(vcpu_count as u64); |
| 55 | let vgic = vm.create_vgic(&config).map_err(Error::CreateGic)?; |
| 56 | |
| 57 | let gic = Gic { |
| 58 | interrupt_source_group, |
| 59 | vgic: Some(vgic), |
| 60 | }; |
| 61 | gic.enable()?; |
| 62 | |
| 63 | Ok(gic) |
| 64 | } |
| 65 | |
| 66 | pub fn restore_vgic( |
| 67 | &mut self, |
nothing calls this directly
no test coverage detected