[efi] Update to current EDK2 headers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-11-11 16:18:45 +00:00
parent 3a2f75b789
commit 27ec3c76ab
20 changed files with 250 additions and 66 deletions

View File

@@ -19,7 +19,11 @@ FILE_LICENCE ( BSD2_PATENT );
///
/// Define the processor type so other code can make processor based choices
///
#define MDE_CPU_ARM
/// Upstream EDK2 headers no longer accept MDE_CPU_ARM: define
/// MDE_CPU_EBC to prevent build errors. (The definition doesn't
/// actually affect anything used by iPXE.)
///
#define MDE_CPU_EBC
//
// Make sure we are using the correct packing rules per EFI specification

View File

@@ -580,7 +580,7 @@ struct _LIST_ENTRY {
**/
#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
#if defined (_M_ARM) || defined (_M_ARM64)
#if defined (_M_ARM64)
//
// MSFT ARM variable argument list support.
//

View File

@@ -16,9 +16,4 @@ FILE_LICENCE ( BSD2_PATENT );
extern EFI_GUID gFdtTableGuid;
#define FDT_VARIABLE_GUID \
{ 0x25a4fd4a, 0x9703, 0x4ba9, { 0xa1, 0x90, 0xb7, 0xc8, 0x4e, 0xfb, 0x3e, 0x57 } }
extern EFI_GUID gFdtVariableGuid;
#endif /* __FDT_H__ */

View File

@@ -134,6 +134,40 @@ typedef PACKED struct {
UINT16 DeviceSelection;
} EFI_ACPI_SERIAL_BUS_RESOURCE_SPI_DESCRIPTOR;
/// Revision ID of serial bus uart descriptor
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_REVISION_ID 0x1
/// Type specific flags
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_LITTLE_ENDIAN 0x0
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_BIG_ENDIAN 0x1
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_5_BITS_PER_BYTE 0x0
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_6_BITS_PER_BYTE 0x1
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_7_BITS_PER_BYTE 0x2
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_8_BITS_PER_BYTE 0x3
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_9_BITS_PER_BYTE 0x4
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_STOP_BIT_NONE 0x0
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_STOP_BIT_1 0x1
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_STOP_BIT_1_5 0x2
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_STOP_BIT_2 0x3
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_FC_NONE 0x0
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_FC_HW 0x1
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_TSF_FC_XON_XOFF 0x2
/// Parity definitions
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_PARITY_NONE 0x0
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_PARITY_EVEN 0x1
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_PARITY_ODD 0x2
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_PARITY_MARK 0x3
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_PARITY_SPACE 0x4
/// Serial lines in use bits
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_LIN_RTS BIT7
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_LIN_CTS BIT6
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_LIN_DTR BIT5
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_LIN_DSR BIT4
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_LIN_RI BIT3
#define EFI_ACPI_5_0_SERIAL_BUS_RESOURCE_UART_DESCRIPTOR_LIN_DTD BIT2
///
/// Serial Bus Resource Descriptor (UART)
///

View File

@@ -1836,6 +1836,25 @@ typedef struct {
UINT32 EntryCount;
} EFI_ACPI_5_1_EINJ_TRIGGER_ACTION_TABLE;
///
/// Windows ACPI Emulated devices Table
///
typedef struct {
EFI_ACPI_DESCRIPTION_HEADER Header;
///
/// Container of a bitmask of Windows behavior that this system requires
/// Bit 0 - RTC good
/// Bit 1 - ACPI PM timer good
///
UINT32 EmulatedDeviceFlags;
} EFI_ACPI_5_1_WAET_TABLE;
///
/// WAET Flags. All other bits are reserved and must be 0.
///
#define EFI_ACPI_5_1_WAET_FLAGS_RTC_GOOD BIT0
#define EFI_ACPI_5_1_WAET_FLAGS_ACPI_PM_TIMER_GOOD BIT1
///
/// Platform Communications Channel Table (PCCT)
///

View File

@@ -27,7 +27,6 @@ FILE_LICENCE ( BSD2_PATENT );
#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10
#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13///< defined PI Specification, 1.0
//
// PE32+ Machine type for EFI images

View File

@@ -79,26 +79,6 @@ typedef struct {
#endif // defined (MDE_CPU_EBC)
#if defined (MDE_CPU_ARM)
typedef struct {
UINT32 R3; ///< A copy of R13.
UINT32 R4;
UINT32 R5;
UINT32 R6;
UINT32 R7;
UINT32 R8;
UINT32 R9;
UINT32 R10;
UINT32 R11;
UINT32 R12;
UINT32 R14;
} BASE_LIBRARY_JUMP_BUFFER;
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
#endif // defined (MDE_CPU_ARM)
#if defined (MDE_CPU_AARCH64)
typedef struct {
// GP regs
@@ -4717,6 +4697,101 @@ BitFieldCountOnes64 (
IN UINTN EndBit
);
/*******************************************************************************
UUID (Universally Unique IDentifier), as defined in RFC4122
(https://datatracker.ietf.org/doc/html/rfc4122#section-4.1), is a 128-bit number
used to uniquely identify information in computer systems.
UUIDs contains 5 fields:
- time_low: 32 bits
- time_mid: 16 bits
- time_hi_and_version: 16 bits
- clock_seq_hi_and_reserved: 8 bits
- clock_seq_low: 8 bits
- node: 8 bits * 6
Each field encoded with the Most Significant Byte first (known as network byte
order, or big-endian).
GUID (Globally Unique Identifier), on the other hand, is a 128-bit number used
in UEFI environments, which is similar to UUID but has a different byte order
in memory. See https://uefi.org/specs/UEFI/2.11/Apx_A_GUID_and_Time_Formats.html
GUID also contains 5 fields:
- TimeLow: 32 bits
- TimeMid: 16 bits
- TimeHiAndVersion: 16 bits
- ClockSeqHighAndReserved: 16 bits
- ClockSeqLow: 8 bits
- Node: 8 bits * 6
TimeLow, TimeMid, TimeHighAndVersion fields in the EFI are encoded with the Least
Significant Byte first (also known as little-endian).
Example:
Consider the same string representation/registry format for MM communication v2:
"378daedc-f06b-4446-8314-40ab933c87a3"
In UUID format, it is represented as:
- Data fields:
- time_low: 0x37 0x8d 0xae 0xdc (0x378daedc in big-endian)
- time_mid: 0xf0 0x6b (0xf06b in big-endian)
- time_hi_and_version: 0x44 0x46 (0x4446 in big-endian)
- clock_seq_hi_and_reserved: 0x83
- clock_seq_low: 0x14
- node: 0x00, 0xab, 0x93, 0x3c, 0x87, 0xa3
- Byte representation in memory:
- 37 8d ae dc f0 6b 44 46 83 14 40 ab 93 3c 87 a3
However, in GUID format, it is represented as:
- Data fields:
- TimeLow: 0xdc 0xae 0x8d 0x37 (0x378daedc in little-endian)
- TimeMid: 0x6b 0xf0 (0xf06b in little-endian)
- TimeHiAndVersion: 0x46 0x44 (0x4446 in little-endian)
- ClockSeqHighAndReserved: 0x83
- ClockSeqLow: 0x14
- Node: 0x00, 0xab, 0x93, 0x3c, 0x87, 0xa3
- Byte representation in memory:
- dc ae 8d 37 6b f0 46 44 83 14 40 ab 93 3c 87 a3
*******************************************************************************/
/**
This function converts a GUID in UEFI format to a UUID in RFC4122 format.
The conversion is done by swapping the byte order of the TimeLow, TimeMid, and
TimeHiAndVersion fields, while keeping the ClockSeq and Node fields unchanged.
@param [in] FromGuid GUID in format to be converted to UUID RFC4122 format.
@param [out] ToUuid Pointer to a GUID structure that will hold the converted
UUID in RFC4122 format.
**/
VOID
EFIAPI
ConvertGuidToUuid (
IN GUID *FromGuid,
OUT GUID *ToUuid
);
/**
This function converts a UUID in RFC4122 format to a GUID in UEFI format.
The conversion is done by swapping the byte order of the time_low, time_mid, and
time_hi_and_version fields, while keeping the ClockSeq and Node fields unchanged.
This function is symmetric to ConvertGuidToUuid.
@param [in] FromUuid UUID in RFC4122 format to be converted to GUID in UEFI format.
@param [out] ToGuid Pointer to a GUID structure that will hold the converted
GUID in UEFI format.
**/
VOID
EFIAPI
ConvertUuidToGuid (
IN GUID *FromUuid,
OUT GUID *ToGuid
);
//
// Base Library Checksum Functions
//
@@ -5323,6 +5398,18 @@ TdIsEnabled (
VOID
);
/**
Probe if running as some kind of SEV guest.
@return FALSE Not running as a guest under any kind of SEV
@return TRUE Running as a guest under any kind of SEV
**/
BOOLEAN
EFIAPI
SevGuestIsEnabled (
VOID
);
#if defined (MDE_CPU_X64)
//
// The page size for the PVALIDATE instruction

View File

@@ -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

View File

@@ -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.<BR>

View File

@@ -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 <ipxe/efi/Protocol/DebugSupport.h>

View File

@@ -851,7 +851,6 @@ typedef enum {
IsaX64 = IMAGE_FILE_MACHINE_X64, ///< 0x8664
IsaIpf = IMAGE_FILE_MACHINE_IA64, ///< 0x0200
IsaEbc = IMAGE_FILE_MACHINE_EBC, ///< 0x0EBC
IsaArm = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2
IsaAArch64 = IMAGE_FILE_MACHINE_ARM64 ///< 0xAA64
} EFI_INSTRUCTION_SET_ARCHITECTURE;

View File

@@ -191,11 +191,26 @@ typedef struct {
/// The URI of a remote host. From the information in this field, the HTTP instance
/// will be able to determine whether to use HTTP or HTTPS and will also be able to
/// determine the port number to use. If no port number is specified, port 80 (HTTP)
/// is assumed. See RFC 3986 for more details on URI syntax.
/// or 443 (HTTPS) is assumed. See RFC 3986 for more details on URI syntax.
///
CHAR16 *Url;
} EFI_HTTP_REQUEST_DATA;
///
/// EFI_HTTP_CONNECT_REQUEST_DATA
///
typedef struct {
EFI_HTTP_REQUEST_DATA Base;
///
/// The URI of an Proxy Host. This field will be NULL if there is no Proxy Host
/// in the device path. From the information in this field, the HTTP instance will
/// be able to determine whether to use HTTP or HTTPS and will also be able to
/// determine the port number to use. If no port number is specified, port 80 (HTTP)
/// or 443 (HTTPS) is assumed. See RFC 3986 for more details on URI syntax.
///
CHAR16 *ProxyUrl;
} EFI_HTTP_CONNECT_REQUEST_DATA;
///
/// EFI_HTTP_RESPONSE_DATA
///

View File

@@ -155,8 +155,6 @@ typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0006
#elif defined (MDE_CPU_X64)
#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0007
#elif defined (MDE_CPU_ARM)
#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000A
#elif defined (MDE_CPU_AARCH64)
#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000B
#elif defined (MDE_CPU_RISCV64)

View File

@@ -56,12 +56,12 @@ typedef struct {
UINT64 ResolutionX;
///
/// The resolution of the pointer device on the y-axis in counts/mm.
/// If 0, then the pointer device does not support an x-axis.
/// If 0, then the pointer device does not support a y-axis.
///
UINT64 ResolutionY;
///
/// The resolution of the pointer device on the z-axis in counts/mm.
/// If 0, then the pointer device does not support an x-axis.
/// If 0, then the pointer device does not support a z-axis.
///
UINT64 ResolutionZ;
///

View File

@@ -13,11 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
FILE_LICENCE ( BSD2_PATENT );
#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
{ \
0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
{ \
0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
@@ -25,16 +20,6 @@ FILE_LICENCE ( BSD2_PATENT );
typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;
///
/// Protocol GUID name defined in EFI1.1.
///
#define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
///
/// Protocol defined in EFI1.1.
///
typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;
///
/// Protocol data structures and defines
///
@@ -182,7 +167,6 @@ struct _EFI_UNICODE_COLLATION_PROTOCOL {
CHAR8 *SupportedLanguages;
};
extern EFI_GUID gEfiUnicodeCollationProtocolGuid;
extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;
#endif

View File

@@ -234,11 +234,6 @@ typedef union {
///
#define EFI_IMAGE_MACHINE_X64 0x8664
///
/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images.
///
#define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2
///
/// PE32+ Machine type for AARCH64 A64 images.
///
@@ -272,12 +267,6 @@ typedef union {
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32)
#elif defined (MDE_CPU_ARM)
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
#elif defined (MDE_CPU_AARCH64)
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \

View File

@@ -2269,7 +2269,7 @@ typedef struct {
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_EBC L"\\EFI\\BOOT\\BOOTARM.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64 L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_LOONGARCH64 L"\\EFI\\BOOT\\BOOTLOONGARCH64.EFI"
@@ -2280,8 +2280,7 @@ typedef struct {
#elif defined (MDE_CPU_X64)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
#elif defined (MDE_CPU_EBC)
#elif defined (MDE_CPU_ARM)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_EBC
#elif defined (MDE_CPU_AARCH64)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
#elif defined (MDE_CPU_RISCV64)