1// Copyright 2023 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.
45mod descriptor;
6mod memory_mapping;
7mod shm;
8pub mod sys;
910pub use descriptor::AsRawDescriptor;
11pub use descriptor::AsRawDescriptors;
12pub use descriptor::FromRawDescriptor;
13pub use descriptor::IntoRawDescriptor;
14pub use descriptor::SafeDescriptor;
15pub use memory_mapping::MemoryMapping;
16pub use shm::SharedMemory;
17pub use sys::platform::descriptor::RawDescriptor;
18pub use sys::platform::shm::round_up_to_page_size;
1920/// # Safety
21///
22/// Caller must ensure that MappedRegion's lifetime contains the lifetime of
23/// pointer returned.
24pub unsafe trait MappedRegion: Send + Sync {
25/// Returns a pointer to the beginning of the memory region. Should only be
26 /// used for passing this region to ioctls for setting guest memory.
27fn as_ptr(&self) -> *mut u8;
2829/// Returns the size of the memory region in bytes.
30fn size(&self) -> usize;
31}