hyperlight_host/mem/mod.rs
1/*
2Copyright 2024 The Hyperlight Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17/// Reusable structure to hold data and provide a `Drop` implementation
18#[cfg(inprocess)]
19pub(crate) mod custom_drop;
20/// A simple ELF loader
21pub(crate) mod elf;
22/// A generic wrapper for executable files (PE, ELF, etc)
23pub(crate) mod exe;
24/// Functionality to establish a sandbox's memory layout.
25pub mod layout;
26/// Safe wrapper around an HINSTANCE created by the windows
27/// `LoadLibrary` call
28#[cfg(target_os = "windows")]
29pub(super) mod loaded_lib;
30/// memory regions to be mapped inside a vm
31pub mod memory_region;
32/// Functionality that wraps a `SandboxMemoryLayout` and a
33/// `SandboxMemoryConfig` to mutate a sandbox's memory as necessary.
34pub mod mgr;
35/// Functionality to read and mutate a PE file in a structured manner.
36pub(crate) mod pe;
37/// Structures to represent pointers into guest and host memory
38pub mod ptr;
39/// Structures to represent memory address spaces into which pointers
40/// point.
41pub(super) mod ptr_addr_space;
42/// Structures to represent an offset into a memory space
43pub mod ptr_offset;
44/// A wrapper around unsafe functionality to create and initialize
45/// a memory region for a guest running in a sandbox.
46pub mod shared_mem;
47/// A wrapper around a `SharedMemory` and a snapshot in time
48/// of the memory therein
49pub mod shared_mem_snapshot;
50/// Utilities for writing shared memory tests
51#[cfg(test)]
52pub(crate) mod shared_mem_tests;