mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
VfioUserDmaMapping is already in the pci crate, this moves VfioDmaMapping to match the behavior. This is a necessary change to allow the VfioDmaMapping trait to have access to MmioRegion memory without creating a circular dependency. The VfioDmaMapping trait needs to have access to mmio regions to map external devices over mmio (a follow-up commit). Signed-off-by: Andrew Carp <acarp@crusoeenergy.com>
16 lines
625 B
Rust
16 lines
625 B
Rust
// Copyright © 2021 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
|
|
|
|
/// Trait meant for triggering the DMA mapping update related to an external
|
|
/// device not managed fully through virtio. It is dedicated to virtio-iommu
|
|
/// in order to trigger the map update anytime the mapping is updated from the
|
|
/// guest.
|
|
pub trait ExternalDmaMapping: Send + Sync {
|
|
/// Map a memory range
|
|
fn map(&self, iova: u64, gpa: u64, size: u64) -> std::result::Result<(), std::io::Error>;
|
|
|
|
/// Unmap a memory range
|
|
fn unmap(&self, iova: u64, size: u64) -> std::result::Result<(), std::io::Error>;
|
|
}
|