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

Method enable

devices/src/aia.rs:80–108  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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

Callers 1

newMethod · 0.45

Calls 2

updateMethod · 0.45
set_gsiMethod · 0.45

Tested by

no test coverage detected