MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / enable

Method enable

devices/src/gic.rs:81–109  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

79 }
80
81 fn enable(&self) -> Result<()> {
82 // Set irqfd for legacy interrupts
83 self.interrupt_source_group
84 .enable()
85 .map_err(Error::EnableInterrupt)?;
86
87 // Set irq_routing for legacy interrupts.
88 // irqchip: Hardcode to 0 as we support only 1 GIC
89 // pin: Use irq number as pin
90 for i in IRQ_LEGACY_BASE..(IRQ_LEGACY_BASE + IRQ_LEGACY_COUNT) {
91 let config = LegacyIrqSourceConfig {
92 irqchip: 0,
93 pin: (i - IRQ_LEGACY_BASE) as u32,
94 };
95 self.interrupt_source_group
96 .update(
97 i as InterruptIndex,
98 InterruptSourceConfig::LegacyIrq(config),
99 false,
100 false,
101 )
102 .map_err(Error::EnableInterrupt)?;
103 }
104
105 self.interrupt_source_group
106 .set_gsi()
107 .map_err(Error::EnableInterrupt)?;
108 Ok(())
109 }
110
111 /// Default config implied by arch::layout
112 pub fn create_default_config(vcpu_count: u64) -> VgicConfig {

Callers 1

newMethod · 0.45

Calls 2

updateMethod · 0.45
set_gsiMethod · 0.45

Tested by

no test coverage detected