Skip to main content

uefi_specs/hyperv/
firmware_version.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! MSVM firmware build and interface version record.
5
6use guid::Guid;
7use zerocopy::FromBytes;
8use zerocopy::Immutable;
9use zerocopy::KnownLayout;
10
11/// GUID of the FFS file containing the MSVM firmware version record.
12pub const FILE_GUID: Guid = guid::guid!("b8f2d3a4-6c7e-4e1b-9a2f-1d3c5e7a9b0d");
13
14pub const SIGNATURE: &[u8; 4] = b"MVFW";
15pub const STRUCT_VERSION: u16 = 1;
16pub const HEADER_SIZE: usize = 80;
17
18/// The firmware was built from a dirty source tree.
19pub const FLAG_DIRTY: u32 = 1;
20/// The firmware was produced by the official build pipeline.
21pub const FLAG_OFFICIAL: u32 = 2;
22
23/// Packed `MSVM_FIRMWARE_VERSION_INFO` record.
24#[repr(C)]
25#[derive(Debug, FromBytes, Immutable, KnownLayout)]
26pub struct MsvmFirmwareVersionInfo {
27    pub signature: [u8; 4],
28    pub struct_version: [u8; 2],
29    pub header_size: [u8; 2],
30    pub flags: [u8; 4],
31    pub interface_version_major: [u8; 2],
32    pub interface_version_minor: [u8; 2],
33    pub base_version: [u8; 16],
34    pub git_commit: [u8; 48],
35}
36
37static_assertions::const_assert_eq!(size_of::<MsvmFirmwareVersionInfo>(), HEADER_SIZE);
38static_assertions::const_assert_eq!(align_of::<MsvmFirmwareVersionInfo>(), 1);