xref: /aosp_15_r20/external/crosvm/devices/src/virtio/iommu/sys/windows.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 // Copyright 2022 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 use std::cell::RefCell;
6 use std::collections::BTreeMap;
7 use std::rc::Rc;
8 
9 use cros_async::AsyncTube;
10 use cros_async::Executor;
11 
12 use crate::virtio::iommu::Result;
13 use crate::virtio::iommu::State;
14 
handle_command_tube( _state: &Rc<RefCell<State>>, _command_tube: AsyncTube, ) -> Result<()>15 pub(in crate::virtio::iommu) async fn handle_command_tube(
16     _state: &Rc<RefCell<State>>,
17     _command_tube: AsyncTube,
18 ) -> Result<()> {
19     panic!("IOMMU is not supported on Windows");
20 }
21 
handle_translate_request( _ex: &Executor, _state: &Rc<RefCell<State>>, _request_tube: Option<AsyncTube>, _response_tubes: Option<BTreeMap<u32, AsyncTube>>, ) -> Result<()>22 pub(in crate::virtio::iommu) async fn handle_translate_request(
23     _ex: &Executor,
24     _state: &Rc<RefCell<State>>,
25     _request_tube: Option<AsyncTube>,
26     _response_tubes: Option<BTreeMap<u32, AsyncTube>>,
27 ) -> Result<()> {
28     // TODO nkgold (b/222588331): the below implementation assures AsyncTube::send is sync, where it
29     //   should be async (as it is on Windows). Once that's fixed there's no reason this function
30     //   needs an os-specific implementation.
31     panic!("IOMMU is not supported on Windows");
32 }
33