Skip to content

Commit

Permalink
Add definition for flags in IGVM_VHS_MEMORY_MAP_ENTRY (#8)
Browse files Browse the repository at this point in the history
Add meaning for the flags field in the IGVM_VHS_MEMORY_MAP_ENTRY
structure. #9
  • Loading branch information
msft-jlange authored Nov 27, 2023
1 parent 328de1d commit 7133b98
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion igvm_defs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,17 @@ impl Default for MemoryMapEntryType {
}
}

/// Flags associated with a memory map entry.
#[bitfield(u16)]
#[derive(AsBytes, FromBytes, FromZeroes, PartialEq, Eq)]
pub struct MemoryMapEntryFlags {
/// Memory is in the shared state, and an explicit call must be made to
/// change it to the private state before it can be accepted and used.
pub is_shared: bool,
#[bits(15)]
pub reserved: u16,
}

/// The structure deposited by the loader for memory map entries for
/// [`IgvmVariableHeaderType::IGVM_VHT_MEMORY_MAP`] that describe memory
/// available to the guest.
Expand All @@ -1033,7 +1044,7 @@ pub struct IGVM_VHS_MEMORY_MAP_ENTRY {
/// The type of memory this entry represents.
pub entry_type: MemoryMapEntryType,
/// Flags about this memory entry.
pub flags: u16,
pub flags: MemoryMapEntryFlags,
/// Reserved.
pub reserved: u32,
}
Expand Down

0 comments on commit 7133b98

Please sign in to comment.