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::ioapic::IoApicRouting for IoApicRouting<T> {
9    fn assert(&self, index: u8) {
10        self.0.assert_irq(index);
11    }
12
13    fn set_route(&self, index: u8, request: Option<(u64, u32)>) {
14        self.0.set_irq_route(
15            index,
16            request.map(|(address, data)| virt::irqcon::MsiRequest { address, data }),
17        )
18    }
19}