hyperlight_guest/
layout.rs1#[cfg_attr(target_arch = "x86_64", path = "arch/amd64/layout.rs")]
18#[cfg_attr(target_arch = "aarch64", path = "arch/aarch64/layout.rs")]
19mod arch;
20
21pub use arch::{MAIN_STACK_LIMIT_GVA, MAIN_STACK_TOP_GVA};
22pub fn scratch_size_gva() -> *mut u64 {
23 use hyperlight_common::layout::{SCRATCH_TOP_GVA, SCRATCH_TOP_SIZE_OFFSET};
24 (SCRATCH_TOP_GVA as u64 - SCRATCH_TOP_SIZE_OFFSET + 1) as *mut u64
25}
26pub fn allocator_gva() -> *mut u64 {
27 use hyperlight_common::layout::{SCRATCH_TOP_ALLOCATOR_OFFSET, SCRATCH_TOP_GVA};
28 (SCRATCH_TOP_GVA as u64 - SCRATCH_TOP_ALLOCATOR_OFFSET + 1) as *mut u64
29}
30pub fn snapshot_pt_gpa_base_gva() -> *mut u64 {
31 use hyperlight_common::layout::{SCRATCH_TOP_GVA, SCRATCH_TOP_SNAPSHOT_PT_GPA_BASE_OFFSET};
32 (SCRATCH_TOP_GVA as u64 - SCRATCH_TOP_SNAPSHOT_PT_GPA_BASE_OFFSET + 1) as *mut u64
33}
34pub fn snapshot_generation_gva() -> *mut u64 {
35 use hyperlight_common::layout::{SCRATCH_TOP_GVA, SCRATCH_TOP_SNAPSHOT_GENERATION_OFFSET};
36 (SCRATCH_TOP_GVA as u64 - SCRATCH_TOP_SNAPSHOT_GENERATION_OFFSET + 1) as *mut u64
37}
38pub use arch::{scratch_base_gpa, scratch_base_gva};