vmm_core/emuplat/ioapic.rs
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use std::sync::Arc;
5
6pub struct IoApicRouting<T: ?Sized>(pub Arc<T>);
7
8impl<T: ?Sized + virt::irqcon::IoApicRouting> chipset_resources::ioapic::IoApicRouting
9 for IoApicRouting<T>
10{
11 fn assert(&self, index: u8) {
12 self.0.assert_irq(index);
13 }
14
15 fn set_route(&self, index: u8, request: Option<(u64, u32)>) {
16 self.0.set_irq_route(
17 index,
18 request.map(|(address, data)| virt::irqcon::MsiRequest { address, data }),
19 )
20 }
21}