rutabaga_gfx/rutabaga_os/sys/stub/
memory_mapping.rs

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.
4
5use libc::c_void;
6
7use crate::rutabaga_os::SafeDescriptor;
8use crate::rutabaga_utils::RutabagaError;
9use crate::rutabaga_utils::RutabagaResult;
10
11/// Wraps an anonymous shared memory mapping in the current process. Provides
12/// RAII semantics including munmap when no longer needed.
13#[derive(Debug)]
14pub struct MemoryMapping {
15    pub addr: *mut c_void,
16    pub size: usize,
17}
18
19impl MemoryMapping {
20    pub fn from_safe_descriptor(
21        _descriptor: SafeDescriptor,
22        _size: usize,
23        _map_info: u32,
24    ) -> RutabagaResult<MemoryMapping> {
25        Err(RutabagaError::Unsupported)
26    }
27}