From 27ec3c76ab2dfdc384c589b9f4c8a610a33ba8d1 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 11 Nov 2025 16:18:45 +0000 Subject: [efi] Update to current EDK2 headers Signed-off-by: Michael Brown --- src/include/ipxe/efi/Pi/PiMultiPhase.h | 51 ++++++++++++++++++++++++++++++++ src/include/ipxe/efi/Pi/PiS3BootScript.h | 2 +- src/include/ipxe/efi/Pi/PiStatusCode.h | 2 +- 3 files changed, 53 insertions(+), 2 deletions(-) (limited to 'src/include/ipxe/efi/Pi') diff --git a/src/include/ipxe/efi/Pi/PiMultiPhase.h b/src/include/ipxe/efi/Pi/PiMultiPhase.h index 187b131bc..828ea52f6 100644 --- a/src/include/ipxe/efi/Pi/PiMultiPhase.h +++ b/src/include/ipxe/efi/Pi/PiMultiPhase.h @@ -112,6 +112,14 @@ FILE_LICENCE ( BSD2_PATENT ); #define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED #define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED +/// +/// MM Communicate header constants +/// +#define COMMUNICATE_HEADER_V3_GUID \ + { \ + 0x68e8c853, 0x2ba9, 0x4dd7, { 0x9a, 0xc0, 0x91, 0xe1, 0x61, 0x55, 0xc9, 0x35 } \ + } + /// /// Structure describing a MMRAM region and its accessibility attributes. /// @@ -158,6 +166,47 @@ typedef struct _EFI_MM_RESERVED_MMRAM_REGION { UINT64 MmramReservedSize; } EFI_MM_RESERVED_MMRAM_REGION; +#pragma pack(1) + +/// +/// To avoid confusion in interpreting frames, the buffer communicating to MM core through +/// EFI_MM_COMMUNICATE3 or later should always start with EFI_MM_COMMUNICATE_HEADER_V3. +/// +typedef struct { + /// + /// Indicator GUID for MM core that the communication buffer is compliant with this v3 header. + /// Must be gEfiMmCommunicateHeaderV3Guid. + /// + EFI_GUID HeaderGuid; + /// + /// Describes the size of the entire buffer (in bytes) available for communication, including this communication header. + /// + UINT64 BufferSize; + /// + /// Reserved for future use. + /// + UINT64 Reserved; + /// + /// Allows for disambiguation of the message format. + /// + EFI_GUID MessageGuid; + /// + /// Describes the size of MessageData (in bytes) and does not include the size of the header. + /// + UINT64 MessageSize; + /// + /// Designates an array of bytes that is MessageSize in size. + /// + UINT8 MessageData[]; +} EFI_MM_COMMUNICATE_HEADER_V3; + +#pragma pack() + +STATIC_ASSERT ( + (sizeof (EFI_MM_COMMUNICATE_HEADER_V3) == OFFSET_OF (EFI_MM_COMMUNICATE_HEADER_V3, MessageData)), \ + "sizeof (EFI_MM_COMMUNICATE_HEADER_V3) does not align with the beginning of flexible array MessageData" + ); + typedef enum { EFI_PCD_TYPE_8, EFI_PCD_TYPE_16, @@ -217,4 +266,6 @@ EFI_STATUS IN VOID *ProcedureArgument ); +extern EFI_GUID gEfiMmCommunicateHeaderV3Guid; + #endif diff --git a/src/include/ipxe/efi/Pi/PiS3BootScript.h b/src/include/ipxe/efi/Pi/PiS3BootScript.h index f016e1245..97092ddf9 100644 --- a/src/include/ipxe/efi/Pi/PiS3BootScript.h +++ b/src/include/ipxe/efi/Pi/PiS3BootScript.h @@ -1,5 +1,5 @@ /** @file - This file contains the boot script defintions that are shared between the + This file contains the boot script definitions that are shared between the Boot Script Executor PPI and the Boot Script Save Protocol. Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
diff --git a/src/include/ipxe/efi/Pi/PiStatusCode.h b/src/include/ipxe/efi/Pi/PiStatusCode.h index 3bdc96edf..81611ba7d 100644 --- a/src/include/ipxe/efi/Pi/PiStatusCode.h +++ b/src/include/ipxe/efi/Pi/PiStatusCode.h @@ -17,7 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent FILE_LICENCE ( BSD2_PATENT ); // -// Required for IA32, X64, IPF, ARM and EBC defines for CPU exception types +// Required for IA32, X64, IPF, and EBC defines for CPU exception types // #include -- cgit v1.2.3-55-g7522