diff --git a/BaseTools/.gitignore b/BaseTools/.gitignore
index 7bb6eea44b..275a3d468c 100644
--- a/BaseTools/.gitignore
+++ b/BaseTools/.gitignore
@@ -16,6 +16,7 @@ Source/C/VfrCompile/VfrSyntax.cpp
Source/C/VfrCompile/VfrTokens.h
Source/C/bin/
Source/C/libs/
+Source/C/obj/
Bin/Win32
Lib
BaseToolsBuild/
diff --git a/BaseTools/ImageTool/Makefile b/BaseTools/ImageTool/Makefile
index 76e9479d96..fe1e197b5a 100644
--- a/BaseTools/ImageTool/Makefile
+++ b/BaseTools/ImageTool/Makefile
@@ -4,12 +4,14 @@
# Copyright (c) 2022, Mikhail Krichanov. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
+EDK2_PATH = ..\..
+
!INCLUDE ..\Source\C\Makefiles\ms.common
APP = ImageTool
OC_USER = ..\..\OpenCorePkg
-UDK_PATH = ..\..
+UDK_PATH = $(EDK2_PATH)
UDK_ARCH = $(HOST_ARCH)
OUT_DIR = .\Windows
diff --git a/BaseTools/MicroTool/Makefile b/BaseTools/MicroTool/Makefile
index 8df029aff8..44d23ca0de 100644
--- a/BaseTools/MicroTool/Makefile
+++ b/BaseTools/MicroTool/Makefile
@@ -4,12 +4,14 @@
# Copyright (c) 2022, Mikhail Krichanov. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
+EDK2_PATH = ..\..
+
!INCLUDE ..\Source\C\Makefiles\ms.common
APP = MicroTool
OC_USER = ..\..\OpenCorePkg
-UDK_PATH = ..\..
+UDK_PATH = $(EDK2_PATH)
UDK_ARCH = $(HOST_ARCH)
OUT_DIR = .\Windows
diff --git a/BaseTools/Source/C/Common/AutoGen.c b/BaseTools/Source/C/Common/AutoGen.c
new file mode 100644
index 0000000000..8c88f6c177
--- /dev/null
+++ b/BaseTools/Source/C/Common/AutoGen.c
@@ -0,0 +1,19 @@
+/** @file
+ AutoGen definitions for edk2 package code consumption in BaseTools.
+
+ Copyright (c) 2023, Marvin Häuser. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include
+
+GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = EFI_CALLER_ID_GUID;
+
+GLOBAL_REMOVE_IF_UNREFERENCED GUID gEdkiiDscPlatformGuid = EDKII_DSC_PLATFORM_GUID;
+
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBaseName = "BaseTools";
+
+// Definition of SkuId Array
+GLOBAL_REMOVE_IF_UNREFERENCED UINT64 _gPcd_SkuId_Array[] = {0x0};
+
diff --git a/BaseTools/Source/C/Common/BasePeCoff.c b/BaseTools/Source/C/Common/BasePeCoff.c
index b8bfb7b58b..02bf1c76bf 100644
--- a/BaseTools/Source/C/Common/BasePeCoff.c
+++ b/BaseTools/Source/C/Common/BasePeCoff.c
@@ -12,7 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#include
-#include
+#include
#include "PeCoffLib.h"
typedef union {
diff --git a/BaseTools/Source/C/Common/BinderFuncs.c b/BaseTools/Source/C/Common/BinderFuncs.c
index de835287e9..6d81cb8d30 100644
--- a/BaseTools/Source/C/Common/BinderFuncs.c
+++ b/BaseTools/Source/C/Common/BinderFuncs.c
@@ -62,12 +62,12 @@ CommonLibBinderCompareMem (
}
BOOLEAN
-CommonLibBinderCompareGuid (
+CommonLibBinderBtCompareGuid (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
)
{
- return CompareGuid (Guid1, Guid2) ? FALSE : TRUE;
+ return BtCompareGuid (Guid1, Guid2) ? FALSE : TRUE;
}
diff --git a/BaseTools/Source/C/Common/BinderFuncs.h b/BaseTools/Source/C/Common/BinderFuncs.h
index ceaa9cd318..1774ff08b1 100644
--- a/BaseTools/Source/C/Common/BinderFuncs.h
+++ b/BaseTools/Source/C/Common/BinderFuncs.h
@@ -52,7 +52,7 @@ CommonLibBinderCompareMem (
);
BOOLEAN
-CommonLibBinderCompareGuid (
+CommonLibBinderBtCompareGuid (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
);
diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c
index b2cde6d481..ded1cbb5c3 100644
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ b/BaseTools/Source/C/Common/CommonLib.c
@@ -18,77 +18,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "CommonLib.h"
#include "EfiUtilityMsgs.h"
-#define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status) \
- do { \
- ASSERT (Expression); \
- if (!(Expression)) { \
- return Status; \
- } \
- } while (FALSE)
-
-/**
- Set Buffer to zero for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-**/
-VOID
-PeiZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-{
- INT8 *Ptr;
-
- Ptr = Buffer;
- while (Size--) {
- *(Ptr++) = 0;
- }
-}
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-**/
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-{
- CHAR8 *Destination8;
- CHAR8 *Source8;
-
- Destination8 = Destination;
- Source8 = Source;
- while (Length--) {
- *(Destination8++) = *(Source8++);
- }
-}
-
-VOID
-ZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-{
- PeiZeroMem (Buffer, Size);
-}
-
-VOID
-CopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-{
- PeiCopyMem (Destination, Source, Length);
-}
-
/**
Compares to GUIDs
@@ -99,27 +28,12 @@ CopyMem (
@retval != 0 if Guid1 != Guid2
**/
INTN
-CompareGuid (
+BtCompareGuid (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
)
{
- INT32 *g1;
- INT32 *g2;
- INT32 r;
-
- //
- // Compare 32 bits at a time
- //
- g1 = (INT32 *) Guid1;
- g2 = (INT32 *) Guid2;
-
- r = g1[0] - g2[0];
- r |= g1[1] - g2[1];
- r |= g1[2] - g2[2];
- r |= g1[3] - g2[3];
-
- return r;
+ return !CompareGuid (Guid1, Guid2);
}
/**
@@ -273,67 +187,13 @@ PutFileImage (
return EFI_SUCCESS;
}
-/**
- This function calculates the value needed for a valid UINT8 checksum
-
- @param Buffer Pointer to buffer containing byte data of component.
- @param Size Size of the buffer
-
- @return The 8 bit checksum value needed.
-**/
-UINT8
-CalculateChecksum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-{
- return (UINT8) (0x100 - CalculateSum8 (Buffer, Size));
-}
-
-/**
- This function calculates the UINT8 sum for the requested region.
-
- @param Buffer Pointer to buffer containing byte data of component.
- @param Size Size of the buffer
-
- @return The 8 bit checksum value needed.
-**/
-UINT8
-CalculateSum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-{
- UINTN Index;
- UINT8 Sum;
-
- Sum = 0;
-
- //
- // Perform the byte sum for buffer
- //
- for (Index = 0; Index < Size; Index++) {
- Sum = (UINT8) (Sum + Buffer[Index]);
- }
-
- return Sum;
-}
-
-/**
- This function calculates the value needed for a valid UINT16 checksum
-
- @param Buffer Pointer to buffer containing byte data of component.
- @param Size Size of the buffer
-
- @return The 16 bit checksum value needed.
-**/
UINT16
-CalculateChecksum16 (
+BtCalculateChecksum16 (
IN UINT16 *Buffer,
IN UINTN Size
)
{
- return (UINT16) (0x10000 - CalculateSum16 (Buffer, Size));
+ return CalculateCheckSum16 (Buffer, Size * sizeof (UINT16));
}
/**
@@ -345,24 +205,12 @@ CalculateChecksum16 (
@return The 16 bit checksum
**/
UINT16
-CalculateSum16 (
+BtCalculateSum16 (
IN UINT16 *Buffer,
IN UINTN Size
)
{
- UINTN Index;
- UINT16 Sum;
-
- Sum = 0;
-
- //
- // Perform the word sum for buffer
- //
- for (Index = 0; Index < Size; Index++) {
- Sum = (UINT16) (Sum + Buffer[Index]);
- }
-
- return (UINT16) Sum;
+ return CalculateSum16 (Buffer, Size * sizeof (UINT16));
}
/**
@@ -634,45 +482,6 @@ LongFilePath (
#endif
}
-CHAR16
-InternalCharToUpper (
- CHAR16 Char
- )
-{
- if (Char >= L'a' && Char <= L'z') {
- return (CHAR16) (Char - (L'a' - L'A'));
- }
-
- return Char;
-}
-
-UINTN
-StrnLenS (
- CONST CHAR16 *String,
- UINTN MaxSize
- )
-{
- UINTN Length;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // If String is a null pointer or MaxSize is 0, then the StrnLenS function returns zero.
- //
- if ((String == NULL) || (MaxSize == 0)) {
- return 0;
- }
-
- Length = 0;
- while (String[Length] != 0) {
- if (Length >= MaxSize - 1) {
- return MaxSize;
- }
- Length++;
- }
- return Length;
-}
-
VOID *
InternalAllocatePool (
@@ -705,6 +514,7 @@ InternalReallocatePool (
}
VOID *
+EFIAPI
ReallocatePool (
UINTN OldSize,
UINTN NewSize,
@@ -714,413 +524,6 @@ ReallocatePool (
return InternalReallocatePool (OldSize, NewSize, OldBuffer);
}
-/**
- Returns the length of a Null-terminated Unicode string.
-
- This function returns the number of Unicode characters in the Null-terminated
- Unicode string specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @return The length of String.
-
-**/
-UINTN
-StrLen (
- CONST CHAR16 *String
- )
-{
- UINTN Length;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & BIT0) == 0);
-
- for (Length = 0; *String != L'\0'; String++, Length++) {
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length should not more than PcdMaximumUnicodeStringLength
- //
- }
- return Length;
-}
-
-BOOLEAN
-InternalSafeStringIsOverlap (
- IN VOID *Base1,
- IN UINTN Size1,
- IN VOID *Base2,
- IN UINTN Size2
- )
-{
- if ((((UINTN)Base1 >= (UINTN)Base2) && ((UINTN)Base1 < (UINTN)Base2 + Size2)) ||
- (((UINTN)Base2 >= (UINTN)Base1) && ((UINTN)Base2 < (UINTN)Base1 + Size1))) {
- return TRUE;
- }
- return FALSE;
-}
-
-BOOLEAN
-InternalSafeStringNoStrOverlap (
- IN CHAR16 *Str1,
- IN UINTN Size1,
- IN CHAR16 *Str2,
- IN UINTN Size2
- )
-{
- return !InternalSafeStringIsOverlap (Str1, Size1 * sizeof(CHAR16), Str2, Size2 * sizeof(CHAR16));
-}
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of type UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Unicode string specified by String as a decimal number. The format of the
- input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before
- [decimal digits]. The running zero in the beginning of [decimal digits] will
- be ignored. Then, the function stops at the first character that is a not a
- valid decimal character or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid decimal digits in the above format, then 0 is stored
- at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINT64, then
- MAX_UINT64 is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- decimal digits right after the optional pad spaces, the value of String is
- stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-StrDecimalToUint64S (
- CONST CHAR16 *String,
- CHAR16 **EndPointer, OPTIONAL
- UINT64 *Data
- )
-{
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((StrnLenS (String, RSIZE_MAX + 1) <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- *Data = 0;
-
- while (InternalIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINT64, then MAX_UINT64 is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > ((MAX_UINT64 - (*String - L'0'))/10)) {
- *Data = MAX_UINT64;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = (*Data) * 10 + (*String - L'0');
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type
- UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Unicode string specified by String as a hexadecimal number. The format of
- the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab
- characters, before [zeros], [x] or [hexadecimal digit]. The running zero
- before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts
- after [x] or the first valid hexadecimal digit. Then, the function stops at
- the first character that is a not a valid hexadecimal character or NULL,
- whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid hexadecimal digits in the above format, then 0 is
- stored at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINT64, then
- MAX_UINT64 is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- hexadecimal digits right after the optional pad spaces, the value of String
- is stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-StrHexToUint64S (
- CONST CHAR16 *String,
- CHAR16 **EndPointer, OPTIONAL
- UINT64 *Data
- )
-{
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((StrnLenS (String, RSIZE_MAX + 1) <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- if (InternalCharToUpper (*String) == L'X') {
- if (*(String - 1) != L'0') {
- *Data = 0;
- return RETURN_SUCCESS;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- *Data = 0;
-
- while (InternalIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINT64, then MAX_UINT64 is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > ((MAX_UINT64 - InternalHexCharToUintn (*String))>>4)) {
- *Data = MAX_UINT64;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = ((*Data) << 4) + InternalHexCharToUintn (*String);
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-UINT64
-StrDecimalToUint64 (
- CONST CHAR16 *String
- )
-{
- UINT64 Result;
-
- StrDecimalToUint64S (String, (CHAR16 **) NULL, &Result);
- return Result;
-}
-
-
-UINT64
-StrHexToUint64 (
- CONST CHAR16 *String
- )
-{
- UINT64 Result;
-
- StrHexToUint64S (String, (CHAR16 **) NULL, &Result);
- return Result;
-}
-
-UINTN
-StrSize (
- CONST CHAR16 *String
- )
-{
- return (StrLen (String) + 1) * sizeof (*String);
-}
-
-
-UINT64
-ReadUnaligned64 (
- CONST UINT64 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-UINT64
-WriteUnaligned64 (
- UINT64 *Buffer,
- UINT64 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
-
-
-EFI_GUID *
-CopyGuid (
- EFI_GUID *DestinationGuid,
- CONST EFI_GUID *SourceGuid
- )
-{
- WriteUnaligned64 (
- (UINT64*)DestinationGuid,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid)
- );
- WriteUnaligned64 (
- (UINT64*)DestinationGuid + 1,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
- );
- return DestinationGuid;
-}
-
-UINT16
-SwapBytes16 (
- UINT16 Value
- )
-{
- return (UINT16) ((Value<< 8) | (Value>> 8));
-}
-
-
-UINT32
-SwapBytes32 (
- UINT32 Value
- )
-{
- UINT32 LowerBytes;
- UINT32 HigherBytes;
-
- LowerBytes = (UINT32) SwapBytes16 ((UINT16) Value);
- HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Value >> 16));
- return (LowerBytes << 16 | HigherBytes);
-}
-
-BOOLEAN
-InternalIsDecimalDigitCharacter (
- CHAR16 Char
- )
-{
- return (BOOLEAN) (Char >= L'0' && Char <= L'9');
-}
-
VOID *
InternalAllocateCopyPool (
UINTN AllocationSize,
@@ -1138,323 +541,8 @@ InternalAllocateCopyPool (
return Memory;
}
-BOOLEAN
-InternalIsHexaDecimalDigitCharacter (
- CHAR16 Char
- )
-{
-
- return (BOOLEAN) (InternalIsDecimalDigitCharacter (Char) ||
- (Char >= L'A' && Char <= L'F') ||
- (Char >= L'a' && Char <= L'f'));
-}
-
-UINTN
-InternalHexCharToUintn (
- CHAR16 Char
- )
-{
- if (InternalIsDecimalDigitCharacter (Char)) {
- return Char - L'0';
- }
-
- return (10 + InternalCharToUpper (Char) - L'A');
-}
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a byte array.
-
- This function outputs a byte array by interpreting the contents of
- the Unicode string specified by String in hexadecimal format. The format of
- the input Unicode string String is:
-
- [XX]*
-
- X is a hexadecimal digit character in the range [0-9], [a-f] and [A-F].
- The function decodes every two hexadecimal digit characters as one byte. The
- decoding stops after Length of characters and outputs Buffer containing
- (Length / 2) bytes.
-
- If String is not aligned in a 16-bit boundary, then ASSERT().
-
- If String is NULL, then ASSERT().
-
- If Buffer is NULL, then ASSERT().
-
- If Length is not multiple of 2, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
-
- If MaxBufferSize is less than (Length / 2), then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
- @param Length The number of Unicode characters to decode.
- @param Buffer Pointer to the converted bytes array.
- @param MaxBufferSize The maximum size of Buffer.
-
- @retval RETURN_SUCCESS Buffer is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If Length is not multiple of 2.
- If PcdMaximumUnicodeStringLength is not zero,
- and Length is greater than
- PcdMaximumUnicodeStringLength.
- @retval RETURN_UNSUPPORTED If Length of characters from String contain
- a character that is not valid hexadecimal
- digit characters, or a Null-terminator.
- @retval RETURN_BUFFER_TOO_SMALL If MaxBufferSize is less than (Length / 2).
-**/
-RETURN_STATUS
-StrHexToBytes (
- CONST CHAR16 *String,
- UINTN Length,
- UINT8 *Buffer,
- UINTN MaxBufferSize
- )
-{
- UINTN Index;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Buffer shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Buffer != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Length shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. Length shall not be odd.
- //
- SAFE_STRING_CONSTRAINT_CHECK (((Length & BIT0) == 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. MaxBufferSize shall equal to or greater than Length / 2.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((MaxBufferSize >= Length / 2), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. String shall not contains invalid hexadecimal digits.
- //
- for (Index = 0; Index < Length; Index++) {
- if (!InternalIsHexaDecimalDigitCharacter (String[Index])) {
- break;
- }
- }
- if (Index != Length) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Convert the hex string to bytes.
- //
- for(Index = 0; Index < Length; Index++) {
-
- //
- // For even characters, write the upper nibble for each buffer byte,
- // and for even characters, the lower nibble.
- //
- if ((Index & BIT0) == 0) {
- Buffer[Index / 2] = (UINT8) InternalHexCharToUintn (String[Index]) << 4;
- } else {
- Buffer[Index / 2] |= (UINT8) InternalHexCharToUintn (String[Index]);
- }
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode GUID string to a value of type
- EFI_GUID.
-
- This function outputs a GUID value by interpreting the contents of
- the Unicode string specified by String. The format of the input
- Unicode string String consists of 36 characters, as follows:
-
- aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
-
- The pairs aa - pp are two characters in the range [0-9], [a-f] and
- [A-F], with each pair representing a single byte hexadecimal value.
-
- The mapping between String and the EFI_GUID structure is as follows:
- aa Data1[24:31]
- bb Data1[16:23]
- cc Data1[8:15]
- dd Data1[0:7]
- ee Data2[8:15]
- ff Data2[0:7]
- gg Data3[8:15]
- hh Data3[0:7]
- ii Data4[0:7]
- jj Data4[8:15]
- kk Data4[16:23]
- ll Data4[24:31]
- mm Data4[32:39]
- nn Data4[40:47]
- oo Data4[48:55]
- pp Data4[56:63]
-
- If String is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
- @param Guid Pointer to the converted GUID.
-
- @retval RETURN_SUCCESS Guid is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not as the above format.
-
-**/
-RETURN_STATUS
-StrToGuid (
- CONST CHAR16 *String,
- EFI_GUID *Guid
- )
-{
- RETURN_STATUS Status;
- EFI_GUID LocalGuid;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Guid != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // Get aabbccdd in big-endian.
- //
- Status = StrHexToBytes (String, 2 * sizeof (LocalGuid.Data1), (UINT8 *) &LocalGuid.Data1, sizeof (LocalGuid.Data1));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data1)] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data1 = SwapBytes32 (LocalGuid.Data1);
- String += 2 * sizeof (LocalGuid.Data1) + 1;
-
- //
- // Get eeff in big-endian.
- //
- Status = StrHexToBytes (String, 2 * sizeof (LocalGuid.Data2), (UINT8 *) &LocalGuid.Data2, sizeof (LocalGuid.Data2));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data2)] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data2 = SwapBytes16 (LocalGuid.Data2);
- String += 2 * sizeof (LocalGuid.Data2) + 1;
-
- //
- // Get gghh in big-endian.
- //
- Status = StrHexToBytes (String, 2 * sizeof (LocalGuid.Data3), (UINT8 *) &LocalGuid.Data3, sizeof (LocalGuid.Data3));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data3)] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data3 = SwapBytes16 (LocalGuid.Data3);
- String += 2 * sizeof (LocalGuid.Data3) + 1;
-
- //
- // Get iijj.
- //
- Status = StrHexToBytes (String, 2 * 2, &LocalGuid.Data4[0], 2);
- if (RETURN_ERROR (Status) || String[2 * 2] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- String += 2 * 2 + 1;
-
- //
- // Get kkllmmnnoopp.
- //
- Status = StrHexToBytes (String, 2 * 6, &LocalGuid.Data4[2], 6);
- if (RETURN_ERROR (Status)) {
- return RETURN_UNSUPPORTED;
- }
-
- CopyGuid (Guid, &LocalGuid);
- return RETURN_SUCCESS;
-}
-
-/**
- Compares up to a specified length the contents of two Null-terminated Unicode strings,
- and returns the difference between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. At most, Length Unicode
- characters will be compared. If Length is 0, then 0 is returned. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched Unicode character in SecondString
- subtracted from the first mismatched Unicode character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and FirstString is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If Length > 0 and SecondString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString A pointer to a Null-terminated Unicode string.
- @param SecondString A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to compare.
-
- @retval 0 FirstString is identical to SecondString.
- @return others FirstString is not identical to SecondString.
-
-**/
-INTN
-StrnCmp (
- CONST CHAR16 *FirstString,
- CONST CHAR16 *SecondString,
- UINTN Length
- )
-{
- if (Length == 0) {
- return 0;
- }
-
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
- // Length tests are performed inside StrLen().
- //
- ASSERT (StrSize (FirstString) != 0);
- ASSERT (StrSize (SecondString) != 0);
-
- while ((*FirstString != L'\0') &&
- (*SecondString != L'\0') &&
- (*FirstString == *SecondString) &&
- (Length > 1)) {
- FirstString++;
- SecondString++;
- Length--;
- }
-
- return *FirstString - *SecondString;
-}
-
VOID *
+EFIAPI
AllocateCopyPool (
UINTN AllocationSize,
CONST VOID *Buffer
@@ -1463,437 +551,8 @@ AllocateCopyPool (
return InternalAllocateCopyPool (AllocationSize, Buffer);
}
-INTN
-StrCmp (
- CONST CHAR16 *FirstString,
- CONST CHAR16 *SecondString
- )
-{
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength
- //
- ASSERT (StrSize (FirstString) != 0);
- ASSERT (StrSize (SecondString) != 0);
-
- while ((*FirstString != L'\0') && (*FirstString == *SecondString)) {
- FirstString++;
- SecondString++;
- }
- return *FirstString - *SecondString;
-}
-
-UINT64
-SwapBytes64 (
- UINT64 Value
- )
-{
- return InternalMathSwapBytes64 (Value);
-}
-
-UINT64
-InternalMathSwapBytes64 (
- UINT64 Operand
- )
-{
- UINT64 LowerBytes;
- UINT64 HigherBytes;
-
- LowerBytes = (UINT64) SwapBytes32 ((UINT32) Operand);
- HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));
-
- return (LowerBytes << 32 | HigherBytes);
-}
-
-RETURN_STATUS
-StrToIpv4Address (
- CONST CHAR16 *String,
- CHAR16 **EndPointer,
- EFI_IPv4_ADDRESS *Address,
- UINT8 *PrefixLength
- )
-{
- RETURN_STATUS Status;
- UINTN AddressIndex;
- UINT64 Uint64;
- EFI_IPv4_ADDRESS LocalAddress;
- UINT8 LocalPrefixLength;
- CHAR16 *Pointer;
-
- LocalPrefixLength = MAX_UINT8;
- LocalAddress.Addr[0] = 0;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Address != NULL), RETURN_INVALID_PARAMETER);
-
- for (Pointer = (CHAR16 *) String, AddressIndex = 0; AddressIndex < ARRAY_SIZE (Address->Addr) + 1;) {
- if (!InternalIsDecimalDigitCharacter (*Pointer)) {
- //
- // D or P contains invalid characters.
- //
- break;
- }
-
- //
- // Get D or P.
- //
- Status = StrDecimalToUint64S ((CONST CHAR16 *) Pointer, &Pointer, &Uint64);
- if (RETURN_ERROR (Status)) {
- return RETURN_UNSUPPORTED;
- }
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // It's P.
- //
- if (Uint64 > 32) {
- return RETURN_UNSUPPORTED;
- }
- LocalPrefixLength = (UINT8) Uint64;
- } else {
- //
- // It's D.
- //
- if (Uint64 > MAX_UINT8) {
- return RETURN_UNSUPPORTED;
- }
- LocalAddress.Addr[AddressIndex] = (UINT8) Uint64;
- AddressIndex++;
- }
-
- //
- // Check the '.' or '/', depending on the AddressIndex.
- //
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- if (*Pointer == L'/') {
- //
- // '/P' is in the String.
- // Skip "/" and get P in next loop.
- //
- Pointer++;
- } else {
- //
- // '/P' is not in the String.
- //
- break;
- }
- } else if (AddressIndex < ARRAY_SIZE (Address->Addr)) {
- if (*Pointer == L'.') {
- //
- // D should be followed by '.'
- //
- Pointer++;
- } else {
- return RETURN_UNSUPPORTED;
- }
- }
- }
-
- if (AddressIndex < ARRAY_SIZE (Address->Addr)) {
- return RETURN_UNSUPPORTED;
- }
-
- memcpy (Address, &LocalAddress, sizeof (*Address));
- if (PrefixLength != NULL) {
- *PrefixLength = LocalPrefixLength;
- }
- if (EndPointer != NULL) {
- *EndPointer = Pointer;
- }
-
- return RETURN_SUCCESS;
-}
-
-RETURN_STATUS
-StrToIpv6Address (
- CONST CHAR16 *String,
- CHAR16 **EndPointer,
- EFI_IPv6_ADDRESS *Address,
- UINT8 *PrefixLength
- )
-{
- RETURN_STATUS Status;
- UINTN AddressIndex;
- UINT64 Uint64;
- EFI_IPv6_ADDRESS LocalAddress;
- UINT8 LocalPrefixLength;
- CONST CHAR16 *Pointer;
- CHAR16 *End;
- UINTN CompressStart;
- BOOLEAN ExpectPrefix;
-
- LocalPrefixLength = MAX_UINT8;
- CompressStart = ARRAY_SIZE (Address->Addr);
- ExpectPrefix = FALSE;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Address != NULL), RETURN_INVALID_PARAMETER);
-
- for (Pointer = String, AddressIndex = 0; AddressIndex < ARRAY_SIZE (Address->Addr) + 1;) {
- if (!InternalIsHexaDecimalDigitCharacter (*Pointer)) {
- if (*Pointer != L':') {
- //
- // ":" or "/" should be followed by digit characters.
- //
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Meet second ":" after previous ":" or "/"
- // or meet first ":" in the beginning of String.
- //
- if (ExpectPrefix) {
- //
- // ":" shall not be after "/"
- //
- return RETURN_UNSUPPORTED;
- }
-
- if (CompressStart != ARRAY_SIZE (Address->Addr) || AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // "::" can only appear once.
- // "::" can only appear when address is not full length.
- //
- return RETURN_UNSUPPORTED;
- } else {
- //
- // Remember the start of zero compressing.
- //
- CompressStart = AddressIndex;
- Pointer++;
-
- if (CompressStart == 0) {
- if (*Pointer != L':') {
- //
- // Single ":" shall not be in the beginning of String.
- //
- return RETURN_UNSUPPORTED;
- }
- Pointer++;
- }
- }
- }
-
- if (!InternalIsHexaDecimalDigitCharacter (*Pointer)) {
- if (*Pointer == L'/') {
- //
- // Might be optional "/P" after "::".
- //
- if (CompressStart != AddressIndex) {
- return RETURN_UNSUPPORTED;
- }
- } else {
- break;
- }
- } else {
- if (!ExpectPrefix) {
- //
- // Get X.
- //
- Status = StrHexToUint64S (Pointer, &End, &Uint64);
- if (RETURN_ERROR (Status) || End - Pointer > 4) {
- //
- // Number of hexadecimal digit characters is no more than 4.
- //
- return RETURN_UNSUPPORTED;
- }
- Pointer = End;
- //
- // Uint64 won't exceed MAX_UINT16 if number of hexadecimal digit characters is no more than 4.
- //
- ASSERT (AddressIndex + 1 < ARRAY_SIZE (Address->Addr));
- LocalAddress.Addr[AddressIndex] = (UINT8) ((UINT16) Uint64 >> 8);
- LocalAddress.Addr[AddressIndex + 1] = (UINT8) Uint64;
- AddressIndex += 2;
- } else {
- //
- // Get P, then exit the loop.
- //
- Status = StrDecimalToUint64S (Pointer, &End, &Uint64);
- if (RETURN_ERROR (Status) || End == Pointer || Uint64 > 128) {
- //
- // Prefix length should not exceed 128.
- //
- return RETURN_UNSUPPORTED;
- }
- LocalPrefixLength = (UINT8) Uint64;
- Pointer = End;
- break;
- }
- }
-
- //
- // Skip ':' or "/"
- //
- if (*Pointer == L'/') {
- ExpectPrefix = TRUE;
- } else if (*Pointer == L':') {
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // Meet additional ":" after all 8 16-bit address
- //
- break;
- }
- } else {
- //
- // Meet other character that is not "/" or ":" after all 8 16-bit address
- //
- break;
- }
- Pointer++;
- }
-
- if ((AddressIndex == ARRAY_SIZE (Address->Addr) && CompressStart != ARRAY_SIZE (Address->Addr)) ||
- (AddressIndex != ARRAY_SIZE (Address->Addr) && CompressStart == ARRAY_SIZE (Address->Addr))
- ) {
- //
- // Full length of address shall not have compressing zeros.
- // Non-full length of address shall have compressing zeros.
- //
- return RETURN_UNSUPPORTED;
- }
- memcpy (&Address->Addr[0], &LocalAddress.Addr[0], CompressStart);
- if (AddressIndex > CompressStart) {
- memset (&Address->Addr[CompressStart], 0, ARRAY_SIZE (Address->Addr) - AddressIndex);
- memcpy (
- &Address->Addr[CompressStart + ARRAY_SIZE (Address->Addr) - AddressIndex],
- &LocalAddress.Addr[CompressStart],
- AddressIndex - CompressStart
- );
- }
-
- if (PrefixLength != NULL) {
- *PrefixLength = LocalPrefixLength;
- }
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) Pointer;
- }
-
- return RETURN_SUCCESS;
-}
-
-
-RETURN_STATUS
-UnicodeStrToAsciiStrS (
- CONST CHAR16 *Source,
- CHAR8 *Destination,
- UINTN DestMax
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than ASCII_RSIZE_MAX or RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. DestMax shall be greater than StrnLenS (Source, DestMax).
- //
- SourceLen = StrnLenS (Source, DestMax);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (!InternalSafeStringIsOverlap (Destination, DestMax, (VOID *)Source, (SourceLen + 1) * sizeof(CHAR16)), RETURN_ACCESS_DENIED);
-
- //
- // convert string
- //
- while (*Source != '\0') {
- //
- // If any Unicode characters in Source contain
- // non-zero value in the upper 8 bits, then ASSERT().
- //
- ASSERT (*Source < 0x100);
- *(Destination++) = (CHAR8) *(Source++);
- }
- *Destination = '\0';
-
- return RETURN_SUCCESS;
-}
-
-RETURN_STATUS
-StrCpyS (
- CHAR16 *Destination,
- UINTN DestMax,
- CONST CHAR16 *Source
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. DestMax shall be greater than StrnLenS(Source, DestMax).
- //
- SourceLen = StrnLenS (Source, DestMax);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoStrOverlap (Destination, DestMax, (CHAR16 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The StrCpyS function copies the string pointed to by Source (including the terminating
- // null character) into the array pointed to by Destination.
- //
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
VOID *
+EFIAPI
AllocateZeroPool (
UINTN AllocationSize
)
@@ -1909,6 +568,7 @@ AllocateZeroPool (
}
VOID *
+EFIAPI
AllocatePool (
UINTN AllocationSize
)
@@ -1916,26 +576,6 @@ AllocatePool (
return InternalAllocatePool (AllocationSize);
}
-UINT16
-WriteUnaligned16 (
- UINT16 *Buffer,
- UINT16 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
-
-UINT16
-ReadUnaligned16 (
- CONST UINT16 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
/**
Return whether the integer string is a hex string.
@@ -2088,3 +728,21 @@ SplitStr (
*List = Str;
return ReturnStr;
}
+
+VOID
+EFIAPI
+CpuBreakpoint (
+ VOID
+ )
+{
+ abort ();
+}
+
+VOID
+EFIAPI
+CpuDeadLoop (
+ VOID
+ )
+{
+ abort ();
+}
diff --git a/BaseTools/Source/C/Common/CommonLib.h b/BaseTools/Source/C/Common/CommonLib.h
index a841029c2a..923f936e4f 100644
--- a/BaseTools/Source/C/Common/CommonLib.h
+++ b/BaseTools/Source/C/Common/CommonLib.h
@@ -16,6 +16,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#endif
+#include
+#include
+#include
+#include
+
#define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
#ifdef PATH_MAX
@@ -41,8 +46,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define IS_SLASH(a) ((a) == L'/')
#define IS_NULL(a) ((a) == L'\0')
-#define ASSERT(x) assert(x)
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -50,38 +53,8 @@ extern "C" {
//
// Function declarations
//
-VOID
-PeiZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-;
-
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-;
-
-VOID
-ZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-;
-
-VOID
-CopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-;
-
INTN
-CompareGuid (
+BtCompareGuid (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
)
@@ -95,26 +68,6 @@ GetFileImage (
)
;
-/*++
-
-Routine Description:
-
- This function opens a file and writes OutputFileImage into the file.
-
-Arguments:
-
- OutputFileName The name of the file to write.
- OutputFileImage A pointer to the memory buffer.
- BytesToWrite The size of the memory buffer.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED An error occurred.
- EFI_OUT_OF_RESOURCES No resource to complete operations.
-
-**/
EFI_STATUS
PutFileImage (
IN CHAR8 *OutputFileName,
@@ -123,29 +76,17 @@ PutFileImage (
)
;
-UINT8
-CalculateChecksum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-;
-
-UINT8
-CalculateSum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-;
+#define CalculateChecksum8 CalculateCheckSum8
UINT16
-CalculateChecksum16 (
+BtCalculateChecksum16 (
IN UINT16 *Buffer,
IN UINTN Size
)
;
UINT16
-CalculateSum16 (
+BtCalculateSum16 (
IN UINT16 *Buffer,
IN UINTN Size
)
@@ -172,231 +113,6 @@ LongFilePath (
IN CHAR8 *FileName
);
-UINTN
-StrLen (
- CONST CHAR16 *String
- );
-
-VOID *
-AllocateCopyPool (
- UINTN AllocationSize,
- CONST VOID *Buffer
- );
-
-INTN
-StrnCmp (
- CONST CHAR16 *FirstString,
- CONST CHAR16 *SecondString,
- UINTN Length
- );
-
-RETURN_STATUS
-StrToGuid (
- CONST CHAR16 *String,
- EFI_GUID *Guid
- );
-
-RETURN_STATUS
-StrHexToBytes (
- CONST CHAR16 *String,
- UINTN Length,
- UINT8 *Buffer,
- UINTN MaxBufferSize
- );
-
-UINTN
-InternalHexCharToUintn (
- CHAR16 Char
- );
-
-VOID *
-InternalAllocateCopyPool (
- UINTN AllocationSize,
- CONST VOID *Buffer
- );
-
-BOOLEAN
-InternalIsDecimalDigitCharacter (
- CHAR16 Char
- );
-
-UINT32
-SwapBytes32 (
- UINT32 Value
- );
-
-UINT16
-SwapBytes16 (
- UINT16 Value
- );
-
-EFI_GUID *
-CopyGuid (
- EFI_GUID *DestinationGuid,
- CONST EFI_GUID *SourceGuid
- );
-
-UINT64
-WriteUnaligned64 (
- UINT64 *Buffer,
- UINT64 Value
- );
-
-UINT64
-ReadUnaligned64 (
- CONST UINT64 *Buffer
- );
-
-UINTN
-StrSize (
- CONST CHAR16 *String
- );
-
-UINT64
-StrHexToUint64 (
- CONST CHAR16 *String
- );
-
-UINT64
-StrDecimalToUint64 (
- CONST CHAR16 *String
- );
-
-RETURN_STATUS
-StrHexToUint64S (
- CONST CHAR16 *String,
- CHAR16 **EndPointer,
- UINT64 *Data
- );
-
-RETURN_STATUS
-StrDecimalToUint64S (
- CONST CHAR16 *String,
- CHAR16 **EndPointer, OPTIONAL
- UINT64 *Data
- );
-
-VOID *
-ReallocatePool (
- UINTN OldSize,
- UINTN NewSize,
- VOID *OldBuffer OPTIONAL
- );
-
-VOID *
-InternalReallocatePool (
- UINTN OldSize,
- UINTN NewSize,
- VOID *OldBuffer OPTIONAL
- );
-
-VOID *
-InternalAllocateZeroPool (
- UINTN AllocationSize
- ) ;
-
-VOID *
-InternalAllocatePool (
- UINTN AllocationSize
- );
-
-UINTN
-StrnLenS (
- CONST CHAR16 *String,
- UINTN MaxSize
- );
-
-CHAR16
-InternalCharToUpper (
- CHAR16 Char
- );
-
-INTN
-StrCmp (
- CONST CHAR16 *FirstString,
- CONST CHAR16 *SecondString
- );
-
-UINT64
-SwapBytes64 (
- UINT64 Value
- );
-
-UINT64
-InternalMathSwapBytes64 (
- UINT64 Operand
- );
-
-RETURN_STATUS
-StrToIpv4Address (
- CONST CHAR16 *String,
- CHAR16 **EndPointer,
- EFI_IPv4_ADDRESS *Address,
- UINT8 *PrefixLength
- );
-
-RETURN_STATUS
-StrToIpv6Address (
- CONST CHAR16 *String,
- CHAR16 **EndPointer,
- EFI_IPv6_ADDRESS *Address,
- UINT8 *PrefixLength
- );
-
-RETURN_STATUS
-StrCpyS (
- CHAR16 *Destination,
- UINTN DestMax,
- CONST CHAR16 *Source
- );
-
-RETURN_STATUS
-UnicodeStrToAsciiStrS (
- CONST CHAR16 *Source,
- CHAR8 *Destination,
- UINTN DestMax
- );
-VOID *
-AllocatePool (
- UINTN AllocationSize
- );
-
-UINT16
-WriteUnaligned16 (
- UINT16 *Buffer,
- UINT16 Value
- );
-
-UINT16
-ReadUnaligned16 (
- CONST UINT16 *Buffer
- );
-
-VOID *
-AllocateZeroPool (
- UINTN AllocationSize
- );
-
-BOOLEAN
-InternalIsHexaDecimalDigitCharacter (
- CHAR16 Char
- );
-
-BOOLEAN
-InternalSafeStringIsOverlap (
- IN VOID *Base1,
- IN UINTN Size1,
- IN VOID *Base2,
- IN UINTN Size2
- );
-
-BOOLEAN
-InternalSafeStringNoStrOverlap (
- IN CHAR16 *Str1,
- IN UINTN Size1,
- IN CHAR16 *Str2,
- IN UINTN Size2
- );
BOOLEAN
IsHexStr (
diff --git a/BaseTools/Source/C/Common/Crc32.c b/BaseTools/Source/C/Common/Crc32.c
index 00cae94898..7c79e4d7de 100644
--- a/BaseTools/Source/C/Common/Crc32.c
+++ b/BaseTools/Source/C/Common/Crc32.c
@@ -1,5 +1,5 @@
/** @file
-CalculateCrc32 routine.
+BtCalculateCrc32 routine.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -7,299 +7,41 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include
+#include
+#include
#include "Crc32.h"
-UINT32 mCrcTable[256] = {
- 0x00000000,
- 0x77073096,
- 0xEE0E612C,
- 0x990951BA,
- 0x076DC419,
- 0x706AF48F,
- 0xE963A535,
- 0x9E6495A3,
- 0x0EDB8832,
- 0x79DCB8A4,
- 0xE0D5E91E,
- 0x97D2D988,
- 0x09B64C2B,
- 0x7EB17CBD,
- 0xE7B82D07,
- 0x90BF1D91,
- 0x1DB71064,
- 0x6AB020F2,
- 0xF3B97148,
- 0x84BE41DE,
- 0x1ADAD47D,
- 0x6DDDE4EB,
- 0xF4D4B551,
- 0x83D385C7,
- 0x136C9856,
- 0x646BA8C0,
- 0xFD62F97A,
- 0x8A65C9EC,
- 0x14015C4F,
- 0x63066CD9,
- 0xFA0F3D63,
- 0x8D080DF5,
- 0x3B6E20C8,
- 0x4C69105E,
- 0xD56041E4,
- 0xA2677172,
- 0x3C03E4D1,
- 0x4B04D447,
- 0xD20D85FD,
- 0xA50AB56B,
- 0x35B5A8FA,
- 0x42B2986C,
- 0xDBBBC9D6,
- 0xACBCF940,
- 0x32D86CE3,
- 0x45DF5C75,
- 0xDCD60DCF,
- 0xABD13D59,
- 0x26D930AC,
- 0x51DE003A,
- 0xC8D75180,
- 0xBFD06116,
- 0x21B4F4B5,
- 0x56B3C423,
- 0xCFBA9599,
- 0xB8BDA50F,
- 0x2802B89E,
- 0x5F058808,
- 0xC60CD9B2,
- 0xB10BE924,
- 0x2F6F7C87,
- 0x58684C11,
- 0xC1611DAB,
- 0xB6662D3D,
- 0x76DC4190,
- 0x01DB7106,
- 0x98D220BC,
- 0xEFD5102A,
- 0x71B18589,
- 0x06B6B51F,
- 0x9FBFE4A5,
- 0xE8B8D433,
- 0x7807C9A2,
- 0x0F00F934,
- 0x9609A88E,
- 0xE10E9818,
- 0x7F6A0DBB,
- 0x086D3D2D,
- 0x91646C97,
- 0xE6635C01,
- 0x6B6B51F4,
- 0x1C6C6162,
- 0x856530D8,
- 0xF262004E,
- 0x6C0695ED,
- 0x1B01A57B,
- 0x8208F4C1,
- 0xF50FC457,
- 0x65B0D9C6,
- 0x12B7E950,
- 0x8BBEB8EA,
- 0xFCB9887C,
- 0x62DD1DDF,
- 0x15DA2D49,
- 0x8CD37CF3,
- 0xFBD44C65,
- 0x4DB26158,
- 0x3AB551CE,
- 0xA3BC0074,
- 0xD4BB30E2,
- 0x4ADFA541,
- 0x3DD895D7,
- 0xA4D1C46D,
- 0xD3D6F4FB,
- 0x4369E96A,
- 0x346ED9FC,
- 0xAD678846,
- 0xDA60B8D0,
- 0x44042D73,
- 0x33031DE5,
- 0xAA0A4C5F,
- 0xDD0D7CC9,
- 0x5005713C,
- 0x270241AA,
- 0xBE0B1010,
- 0xC90C2086,
- 0x5768B525,
- 0x206F85B3,
- 0xB966D409,
- 0xCE61E49F,
- 0x5EDEF90E,
- 0x29D9C998,
- 0xB0D09822,
- 0xC7D7A8B4,
- 0x59B33D17,
- 0x2EB40D81,
- 0xB7BD5C3B,
- 0xC0BA6CAD,
- 0xEDB88320,
- 0x9ABFB3B6,
- 0x03B6E20C,
- 0x74B1D29A,
- 0xEAD54739,
- 0x9DD277AF,
- 0x04DB2615,
- 0x73DC1683,
- 0xE3630B12,
- 0x94643B84,
- 0x0D6D6A3E,
- 0x7A6A5AA8,
- 0xE40ECF0B,
- 0x9309FF9D,
- 0x0A00AE27,
- 0x7D079EB1,
- 0xF00F9344,
- 0x8708A3D2,
- 0x1E01F268,
- 0x6906C2FE,
- 0xF762575D,
- 0x806567CB,
- 0x196C3671,
- 0x6E6B06E7,
- 0xFED41B76,
- 0x89D32BE0,
- 0x10DA7A5A,
- 0x67DD4ACC,
- 0xF9B9DF6F,
- 0x8EBEEFF9,
- 0x17B7BE43,
- 0x60B08ED5,
- 0xD6D6A3E8,
- 0xA1D1937E,
- 0x38D8C2C4,
- 0x4FDFF252,
- 0xD1BB67F1,
- 0xA6BC5767,
- 0x3FB506DD,
- 0x48B2364B,
- 0xD80D2BDA,
- 0xAF0A1B4C,
- 0x36034AF6,
- 0x41047A60,
- 0xDF60EFC3,
- 0xA867DF55,
- 0x316E8EEF,
- 0x4669BE79,
- 0xCB61B38C,
- 0xBC66831A,
- 0x256FD2A0,
- 0x5268E236,
- 0xCC0C7795,
- 0xBB0B4703,
- 0x220216B9,
- 0x5505262F,
- 0xC5BA3BBE,
- 0xB2BD0B28,
- 0x2BB45A92,
- 0x5CB36A04,
- 0xC2D7FFA7,
- 0xB5D0CF31,
- 0x2CD99E8B,
- 0x5BDEAE1D,
- 0x9B64C2B0,
- 0xEC63F226,
- 0x756AA39C,
- 0x026D930A,
- 0x9C0906A9,
- 0xEB0E363F,
- 0x72076785,
- 0x05005713,
- 0x95BF4A82,
- 0xE2B87A14,
- 0x7BB12BAE,
- 0x0CB61B38,
- 0x92D28E9B,
- 0xE5D5BE0D,
- 0x7CDCEFB7,
- 0x0BDBDF21,
- 0x86D3D2D4,
- 0xF1D4E242,
- 0x68DDB3F8,
- 0x1FDA836E,
- 0x81BE16CD,
- 0xF6B9265B,
- 0x6FB077E1,
- 0x18B74777,
- 0x88085AE6,
- 0xFF0F6A70,
- 0x66063BCA,
- 0x11010B5C,
- 0x8F659EFF,
- 0xF862AE69,
- 0x616BFFD3,
- 0x166CCF45,
- 0xA00AE278,
- 0xD70DD2EE,
- 0x4E048354,
- 0x3903B3C2,
- 0xA7672661,
- 0xD06016F7,
- 0x4969474D,
- 0x3E6E77DB,
- 0xAED16A4A,
- 0xD9D65ADC,
- 0x40DF0B66,
- 0x37D83BF0,
- 0xA9BCAE53,
- 0xDEBB9EC5,
- 0x47B2CF7F,
- 0x30B5FFE9,
- 0xBDBDF21C,
- 0xCABAC28A,
- 0x53B39330,
- 0x24B4A3A6,
- 0xBAD03605,
- 0xCDD70693,
- 0x54DE5729,
- 0x23D967BF,
- 0xB3667A2E,
- 0xC4614AB8,
- 0x5D681B02,
- 0x2A6F2B94,
- 0xB40BBE37,
- 0xC30C8EA1,
- 0x5A05DF1B,
- 0x2D02EF8D
-};
-
-/**
- The CalculateCrc32 routine.
-
- @param Data The buffer containing the data to be processed
- @param DataSize The size of data to be processed
- @param CrcOut A pointer to the caller allocated UINT32 that on
- contains the CRC32 checksum of Data
-
- @retval EFI_SUCCESS Calculation is successful.
- @retval EFI_INVALID_PARAMETER Data / CrcOut = NULL, or DataSize = 0
-**/
EFI_STATUS
-CalculateCrc32 (
+BtCalculateCrc32 (
IN UINT8 *Data,
IN UINTN DataSize,
IN OUT UINT32 *CrcOut
)
-{
- UINT32 Crc;
- UINTN Index;
- UINT8 *Ptr;
+/*++
+Routine Description:
+
+ The BtCalculateCrc32 routine.
+
+Arguments:
+
+ Data - The buffer containing the data to be processed
+ DataSize - The size of data to be processed
+ CrcOut - A pointer to the caller allocated UINT32 that on
+ contains the CRC32 checksum of Data
+
+Returns:
+
+ EFI_SUCCESS - Calculation is successful.
+ EFI_INVALID_PARAMETER - Data / CrcOut = NULL, or DataSize = 0
+
+--*/
+{
if ((DataSize == 0) || (Data == NULL) || (CrcOut == NULL)) {
return EFI_INVALID_PARAMETER;
}
- Crc = 0xffffffff;
- for (Index = 0, Ptr = Data; Index < DataSize; Index++, Ptr++) {
- Crc = (Crc >> 8) ^ mCrcTable[(UINT8) Crc ^ *Ptr];
- }
-
- *CrcOut = Crc ^ 0xffffffff;
+ *CrcOut = CalculateCrc32 (Data, DataSize);
return EFI_SUCCESS;
}
diff --git a/BaseTools/Source/C/Common/Crc32.h b/BaseTools/Source/C/Common/Crc32.h
index 3f6b5b35fc..b57717f397 100644
--- a/BaseTools/Source/C/Common/Crc32.h
+++ b/BaseTools/Source/C/Common/Crc32.h
@@ -1,5 +1,5 @@
/** @file
-Header file for CalculateCrc32 routine
+Header file for BtCalculateCrc32 routine
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -23,11 +23,30 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
@retval EFI_INVALID_PARAMETER - Data / CrcOut = NULL, or DataSize = 0
**/
EFI_STATUS
-CalculateCrc32 (
+BtCalculateCrc32 (
IN UINT8 *Data,
IN UINTN DataSize,
IN OUT UINT32 *CrcOut
)
+/*++
+
+Routine Description:
+
+ The BtCalculateCrc32 routine.
+
+Arguments:
+
+ Data - The buffer containing the data to be processed
+ DataSize - The size of data to be processed
+ CrcOut - A pointer to the caller allocated UINT32 that on
+ contains the CRC32 checksum of Data
+
+Returns:
+
+ EFI_SUCCESS - Calculation is successful.
+ EFI_INVALID_PARAMETER - Data / CrcOut = NULL, or DataSize = 0
+
+--*/
;
#endif
diff --git a/BaseTools/Source/C/Common/DebugLib.c b/BaseTools/Source/C/Common/DebugLib.c
new file mode 100644
index 0000000000..e385dec19e
--- /dev/null
+++ b/BaseTools/Source/C/Common/DebugLib.c
@@ -0,0 +1,356 @@
+/** @file
+ BaseTools Debug Library that sends messages to the standard output.
+
+ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2023, Marvin Häuser. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+//
+// Define the maximum debug and assert message length that this library supports
+//
+#define MAX_DEBUG_MESSAGE_LENGTH 0x100
+
+//
+// VA_LIST can not initialize to NULL for all compiler, so we use this to
+// indicate a null VA_LIST
+//
+VA_LIST mVaListNull;
+
+/**
+ Prints a debug message to the debug output device if the specified error level is enabled.
+
+ If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
+ GetDebugPrintErrorLevel (), then print the message specified by Format and the
+ associated variable argument list to the debug output device.
+
+ If Format is NULL, then ASSERT().
+
+ @param ErrorLevel The error level of the debug message.
+ @param Format Format string for the debug message to print.
+ @param ... A variable argument list whose contents are accessed
+ based on the format string specified by Format.
+
+**/
+VOID
+EFIAPI
+DebugPrint (
+ IN UINTN ErrorLevel,
+ IN CONST CHAR8 *Format,
+ ...
+ )
+{
+ VA_LIST Marker;
+
+ VA_START (Marker, Format);
+ DebugVPrint (ErrorLevel, Format, Marker);
+ VA_END (Marker);
+}
+
+/**
+ Prints a debug message to the debug output device if the specified
+ error level is enabled base on Null-terminated format string and a
+ VA_LIST argument list or a BASE_LIST argument list.
+
+ If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
+ GetDebugPrintErrorLevel (), then print the message specified by Format and
+ the associated variable argument list to the debug output device.
+
+ If Format is NULL, then ASSERT().
+
+ @param ErrorLevel The error level of the debug message.
+ @param Format Format string for the debug message to print.
+ @param VaListMarker VA_LIST marker for the variable argument list.
+ @param BaseListMarker BASE_LIST marker for the variable argument list.
+
+**/
+VOID
+DebugPrintMarker (
+ IN UINTN ErrorLevel,
+ IN CONST CHAR8 *Format,
+ IN VA_LIST VaListMarker,
+ IN BASE_LIST BaseListMarker
+ )
+{
+ CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+
+ //
+ // If Format is NULL, then ASSERT().
+ //
+ ASSERT (Format != NULL);
+
+ //
+ // Check driver debug mask value and global mask
+ //
+ if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {
+ return;
+ }
+
+ //
+ // Convert the DEBUG() message to a Unicode String
+ //
+ if (BaseListMarker == NULL) {
+ AsciiVSPrint (Buffer, sizeof (Buffer), Format, VaListMarker);
+ } else {
+ AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMarker);
+ }
+
+ //
+ // Send the print string to the Console Output device
+ //
+ printf("%s", Buffer);
+}
+
+/**
+ Prints a debug message to the debug output device if the specified
+ error level is enabled.
+
+ If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
+ GetDebugPrintErrorLevel (), then print the message specified by Format and
+ the associated variable argument list to the debug output device.
+
+ If Format is NULL, then ASSERT().
+
+ @param ErrorLevel The error level of the debug message.
+ @param Format Format string for the debug message to print.
+ @param VaListMarker VA_LIST marker for the variable argument list.
+
+**/
+VOID
+EFIAPI
+DebugVPrint (
+ IN UINTN ErrorLevel,
+ IN CONST CHAR8 *Format,
+ IN VA_LIST VaListMarker
+ )
+{
+ DebugPrintMarker (ErrorLevel, Format, VaListMarker, NULL);
+}
+
+/**
+ Prints a debug message to the debug output device if the specified
+ error level is enabled.
+ This function use BASE_LIST which would provide a more compatible
+ service than VA_LIST.
+
+ If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
+ GetDebugPrintErrorLevel (), then print the message specified by Format and
+ the associated variable argument list to the debug output device.
+
+ If Format is NULL, then ASSERT().
+
+ @param ErrorLevel The error level of the debug message.
+ @param Format Format string for the debug message to print.
+ @param BaseListMarker BASE_LIST marker for the variable argument list.
+
+**/
+VOID
+EFIAPI
+DebugBPrint (
+ IN UINTN ErrorLevel,
+ IN CONST CHAR8 *Format,
+ IN BASE_LIST BaseListMarker
+ )
+{
+ DebugPrintMarker (ErrorLevel, Format, mVaListNull, BaseListMarker);
+}
+
+/**
+ Prints an assert message containing a filename, line number, and description.
+ This may be followed by a breakpoint or a dead loop.
+
+ Print a message of the form "ASSERT (): \n"
+ to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
+ PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
+ DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
+ CpuDeadLoop() is called. If neither of these bits are set, then this function
+ returns immediately after the message is printed to the debug output device.
+ DebugAssert() must actively prevent recursion. If DebugAssert() is called while
+ processing another DebugAssert(), then DebugAssert() must return immediately.
+
+ If FileName is NULL, then a string of "(NULL) Filename" is printed.
+ If Description is NULL, then a string of "(NULL) Description" is printed.
+
+ @param FileName The pointer to the name of the source file that generated
+ the assert condition.
+ @param LineNumber The line number in the source file that generated the
+ assert condition
+ @param Description The pointer to the description of the assert condition.
+
+**/
+VOID
+EFIAPI
+DebugAssert (
+ IN CONST CHAR8 *FileName,
+ IN UINTN LineNumber,
+ IN CONST CHAR8 *Description
+ )
+{
+ CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+
+ //
+ // Generate the ASSERT() message in Unicode format
+ //
+ AsciiSPrint (
+ Buffer,
+ sizeof (Buffer),
+ "ASSERT [%a] %a(%d): %a\n",
+ gEfiCallerBaseName,
+ FileName,
+ LineNumber,
+ Description
+ );
+
+ //
+ // Send the print string to the Console Output device
+ //
+ printf ("%s", Buffer);
+
+ //
+ // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
+ //
+ if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
+ CpuBreakpoint ();
+ } else if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
+ CpuDeadLoop ();
+ }
+}
+
+/**
+ Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
+
+ This function fills Length bytes of Buffer with the value specified by
+ PcdDebugClearMemoryValue, and returns Buffer.
+
+ If Buffer is NULL, then ASSERT().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
+
+ @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.
+ @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
+
+ @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.
+
+**/
+VOID *
+EFIAPI
+DebugClearMemory (
+ OUT VOID *Buffer,
+ IN UINTN Length
+ )
+{
+ //
+ // If Buffer is NULL, then ASSERT().
+ //
+ ASSERT (Buffer != NULL);
+
+ //
+ // SetMem() checks for the the ASSERT() condition on Length and returns Buffer
+ //
+ return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));
+}
+
+/**
+ Returns TRUE if ASSERT() macros are enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugAssertEnabled (
+ VOID
+ )
+{
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
+}
+
+/**
+ Returns TRUE if DEBUG() macros are enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintEnabled (
+ VOID
+ )
+{
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
+}
+
+/**
+ Returns TRUE if DEBUG_CODE() macros are enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugCodeEnabled (
+ VOID
+ )
+{
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
+}
+
+/**
+ Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
+
+ This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
+ PcdDebugProperyMask is set. Otherwise FALSE is returned.
+
+ @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
+ @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
+
+**/
+BOOLEAN
+EFIAPI
+DebugClearMemoryEnabled (
+ VOID
+ )
+{
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
+}
+
+/**
+ Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+ This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+ @retval TRUE Current ErrorLevel is supported.
+ @retval FALSE Current ErrorLevel is not supported.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintLevelEnabled (
+ IN CONST UINTN ErrorLevel
+ )
+{
+ return (BOOLEAN)((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0);
+}
diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
index 40e068c303..7e530200ac 100644
--- a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
+++ b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
@@ -62,7 +62,7 @@ FvBufGetSecFileLen (
STATIC
UINT16
-FvBufCalculateChecksum16 (
+FvBufBtCalculateChecksum16 (
IN UINT16 *Buffer,
IN UINTN Size
);
@@ -181,7 +181,7 @@ FvBufRemoveFile (
return Status;
}
- if (CommonLibBinderCompareGuid (Name, &NextFile->Name)) {
+ if (CommonLibBinderBtCompareGuid (Name, &NextFile->Name)) {
continue;
}
else {
@@ -265,7 +265,7 @@ FvBufChecksumHeader (
FvHeader->Checksum = 0;
FvHeader->Checksum =
- FvBufCalculateChecksum16 (
+ FvBufBtCalculateChecksum16 (
(UINT16*) FvHeader,
FvHeader->HeaderLength / sizeof (UINT16)
);
@@ -919,7 +919,7 @@ FvBufFindFileByName (
return Status;
}
- if (CommonLibBinderCompareGuid (Name, &NextFile->Name)) {
+ if (CommonLibBinderBtCompareGuid (Name, &NextFile->Name)) {
if (File != NULL) {
*File = NextFile;
}
@@ -1429,7 +1429,7 @@ FvBufUnifyBlockSizes (
**/
STATIC
UINT16
-FvBufCalculateSum16 (
+FvBufBtCalculateSum16 (
IN UINT16 *Buffer,
IN UINTN Size
)
@@ -1459,12 +1459,12 @@ FvBufCalculateSum16 (
**/
STATIC
UINT16
-FvBufCalculateChecksum16 (
+FvBufBtCalculateChecksum16 (
IN UINT16 *Buffer,
IN UINTN Size
)
{
- return (UINT16)(0x10000 - FvBufCalculateSum16 (Buffer, Size));
+ return (UINT16)(0x10000 - FvBufBtCalculateSum16 (Buffer, Size));
}
/**
diff --git a/BaseTools/Source/C/Common/FvLib.c b/BaseTools/Source/C/Common/FvLib.c
index 37631f470f..9bd415b64b 100644
--- a/BaseTools/Source/C/Common/FvLib.c
+++ b/BaseTools/Source/C/Common/FvLib.c
@@ -246,7 +246,7 @@ GetFileByName (
// Loop as long as we have a valid file
//
while (CurrentFile) {
- if (!CompareGuid (&CurrentFile->Name, FileName)) {
+ if (!BtCompareGuid (&CurrentFile->Name, FileName)) {
*File = CurrentFile;
return EFI_SUCCESS;
}
@@ -543,7 +543,7 @@ VerifyFv (
//
// Verify header checksum
//
- Checksum = CalculateSum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ Checksum = BtCalculateSum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
if (Checksum != 0) {
Error (NULL, 0, 0006, "invalid FV header checksum", NULL);
diff --git a/BaseTools/Source/C/Common/GNUmakefile b/BaseTools/Source/C/Common/GNUmakefile
index b3eef7460f..17e166d62e 100644
--- a/BaseTools/Source/C/Common/GNUmakefile
+++ b/BaseTools/Source/C/Common/GNUmakefile
@@ -30,4 +30,66 @@ OBJECTS = \
StringFuncs.o \
TianoCompress.o
+OBJECTS += AutoGen.o DebugLib.o
+
+OBJECTS += \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.o
+
+OBJECTS += \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/ARShiftU64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/BitField.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/CheckSum.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/DivS64x64Remainder.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/DivU64x32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/DivU64x32Remainder.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/DivU64x64Remainder.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/FilePaths.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/GetPowerOfTwo32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/GetPowerOfTwo64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/HighBitSet32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/HighBitSet64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/LinkedList.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/LowBitSet32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/LRotU32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/LRotU64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/LShiftU64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/Math64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/ModU64x32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/MultS64x64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/MultU64x32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/MultU64x64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/QuickSort.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/RRotU32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/RRotU64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/RShiftU64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/SafeString.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/SafeString.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/String.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/SwapBytes16.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/SwapBytes32.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/SwapBytes64.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseLib/Unaligned.o
+
+OBJECTS += \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/CopyMem.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/IsZeroBufferWrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/MemLibGeneric.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/MemLibGuid.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/SetMem.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/SetMemWrapper.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.o
+
+OBJECTS += \
+ $(EDK2_OBJPATH)/MdePkg/Library/BasePrintLib/PrintLib.o \
+ $(EDK2_OBJPATH)/MdePkg/Library/BasePrintLib/PrintLibInternal.o
+
include $(MAKEROOT)/Makefiles/lib.makefile
diff --git a/BaseTools/Source/C/Common/Makefile b/BaseTools/Source/C/Common/Makefile
index ec61e45c81..c2abbca39b 100644
--- a/BaseTools/Source/C/Common/Makefile
+++ b/BaseTools/Source/C/Common/Makefile
@@ -30,6 +30,67 @@ OBJECTS = \
StringFuncs.obj \
TianoCompress.obj
+OBJECTS = $(OBJECTS) AutoGen.obj DebugLib.obj
+
+OBJECTS = $(OBJECTS) \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseDebugPrintErrorLevelLib\BaseDebugPrintErrorLevelLib.obj
+
+OBJECTS = $(OBJECTS) \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\ARShiftU64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\BitField.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\CheckSum.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\DivS64x64Remainder.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\DivU64x32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\DivU64x32Remainder.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\DivU64x64Remainder.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\FilePaths.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\GetPowerOfTwo32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\GetPowerOfTwo64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\HighBitSet32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\HighBitSet64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\LinkedList.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\LowBitSet32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\LRotU32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\LRotU64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\LShiftU64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\Math64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\ModU64x32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\MultS64x64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\MultU64x32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\MultU64x64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\QuickSort.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\RRotU32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\RRotU64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\RShiftU64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\SafeString.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\String.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\SwapBytes16.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\SwapBytes32.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\SwapBytes64.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseLib\Unaligned.obj
+
+OBJECTS = $(OBJECTS) \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\CompareMemWrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\CopyMem.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\CopyMemWrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\IsZeroBufferWrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\MemLibGeneric.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\MemLibGuid.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\ScanMem8Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\ScanMem16Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\ScanMem32Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\ScanMem64Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\SetMem.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\SetMem16Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\SetMem32Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\SetMem64Wrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\SetMemWrapper.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\ZeroMemWrapper.obj
+
+OBJECTS = $(OBJECTS) \
+ $(EDK2_OBJPATH)\MdePkg\Library\BasePrintLib\PrintLib.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\BasePrintLib\PrintLibInternal.obj
+
!INCLUDE ..\Makefiles\ms.lib
diff --git a/BaseTools/Source/C/Common/ParseGuidedSectionTools.c b/BaseTools/Source/C/Common/ParseGuidedSectionTools.c
index e1e9a97e7b..e7709828f8 100644
--- a/BaseTools/Source/C/Common/ParseGuidedSectionTools.c
+++ b/BaseTools/Source/C/Common/ParseGuidedSectionTools.c
@@ -168,7 +168,7 @@ LookupGuidedSectionToolPath (
}
for ( ; GuidTool != NULL; GuidTool = GuidTool->Next) {
- if (CompareGuid (&(GuidTool->Guid), SectionGuid) == 0) {
+ if (BtCompareGuid (&(GuidTool->Guid), SectionGuid) == 0) {
return CloneString (GuidTool->Path);
}
}
diff --git a/BaseTools/Source/C/Common/PeCoffLoaderEx.c b/BaseTools/Source/C/Common/PeCoffLoaderEx.c
index 181192035e..088e470d17 100644
--- a/BaseTools/Source/C/Common/PeCoffLoaderEx.c
+++ b/BaseTools/Source/C/Common/PeCoffLoaderEx.c
@@ -10,19 +10,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
--*/
#include
-#include
+#include
#include "PeCoffLib.h"
#include "CommonLib.h"
#include "EfiUtilityMsgs.h"
-
-#define EXT_IMM64(Value, Address, Size, InstPos, ValPos) \
- Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos)
-
-#define INS_IMM64(Value, Address, Size, InstPos, ValPos) \
- *(UINT32*)Address = (*(UINT32*)Address & ~(((1 << Size) - 1) << InstPos)) | \
- ((UINT32)((((UINT64)Value >> ValPos) & (((UINT64)1 << Size) - 1))) << InstPos)
-
#define IMM64_IMM7B_INST_WORD_X 3
#define IMM64_IMM7B_SIZE_X 7
#define IMM64_IMM7B_INST_WORD_POS_X 4
@@ -166,6 +158,7 @@ PeCoffLoaderRelocateRiscVImage (
**/
UINT16
+EFIAPI
ThumbMovtImmediateAddress (
IN UINT16 *Instruction
)
@@ -196,6 +189,7 @@ ThumbMovtImmediateAddress (
@param Address New address to patch into the instruction
**/
VOID
+EFIAPI
ThumbMovtImmediatePatch (
IN OUT UINT16 *Instruction,
IN UINT16 Address
diff --git a/BaseTools/Source/C/Common/WinNtInclude.h b/BaseTools/Source/C/Common/WinNtInclude.h
index 181e6ac333..c549dc7d73 100644
--- a/BaseTools/Source/C/Common/WinNtInclude.h
+++ b/BaseTools/Source/C/Common/WinNtInclude.h
@@ -43,7 +43,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
#pragma warning(default : 4115)
#pragma warning(default : 4201)
-#pragma warning(default : 4214)
#endif
@@ -63,4 +62,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#undef LoadImage
#undef CreateEvent
+//
+// FAR is used as a struct member name by DebugSupport.h.
+//
+#undef FAR
+
+//
+// These two macros collide with re-definitions and case labels.
+//
+#undef ERROR
+#undef MAX_PATH
+
#endif
diff --git a/BaseTools/Source/C/DevicePath/Makefile b/BaseTools/Source/C/DevicePath/Makefile
index 177a96dfb6..9ee776db07 100644
--- a/BaseTools/Source/C/DevicePath/Makefile
+++ b/BaseTools/Source/C/DevicePath/Makefile
@@ -10,7 +10,14 @@ APPNAME = DevicePath
LIBS = $(LIB_PATH)\Common.lib
-OBJECTS = DevicePath.obj UefiDevicePathLib.obj DevicePathFromText.obj DevicePathUtilities.obj
+OBJECTS = DevicePath.obj
+
+OBJECTS = $(OBJECTS) \
+ $(EDK2_OBJPATH)\MdePkg\Library\UefiDevicePathLib\DevicePathFromText.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\UefiDevicePathLib\DevicePathToText.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\UefiDevicePathLib\DevicePathUtilities.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\UefiDevicePathLib\DevicePathUtilitiesBase.obj \
+ $(EDK2_OBJPATH)\MdePkg\Library\UefiDevicePathLib\UefiDevicePathLib.obj
#CFLAGS = $(CFLAGS) /nodefaultlib:libc.lib
diff --git a/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h b/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
index 1c171c8085..30d8854c99 100644
--- a/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
+++ b/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
@@ -24,6 +24,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "CommonLib.h"
#include "EfiUtilityMsgs.h"
+
+#include
+#define EFI_UART_DEVICE_PATH_GUID DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL
+
+
#define END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
#define MAX_DEVICE_PATH_NODE_COUNT 1024
#define SIZE_64KB 0x00010000
@@ -436,4 +441,111 @@ ConvertTextToDevicePath (
CONST CHAR16 *TextDevicePath
);
+
+
+VOID
+SetDevicePathEndNode (
+ VOID *Node
+ );
+
+BOOLEAN
+IsDevicePathValid (
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ UINTN MaxSize
+ );
+
+UINT8
+DevicePathType (
+ CONST VOID *Node
+ );
+
+UINT8
+DevicePathSubType (
+ CONST VOID *Node
+ );
+
+UINTN
+DevicePathNodeLength (
+ CONST VOID *Node
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+NextDevicePathNode (
+ CONST VOID *Node
+ );
+
+BOOLEAN
+IsDevicePathEndType (
+ CONST VOID *Node
+ );
+
+BOOLEAN
+IsDevicePathEnd (
+ CONST VOID *Node
+ );
+BOOLEAN
+IsDevicePathEndInstance (
+ CONST VOID *Node
+ );
+
+UINT16
+SetDevicePathNodeLength (
+ VOID *Node,
+ UINTN Length
+ );
+
+VOID
+SetDevicePathEndNode (
+ VOID *Node
+ );
+
+UINTN
+UefiDevicePathLibGetDevicePathSize (
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+UefiDevicePathLibDuplicateDevicePath (
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+UefiDevicePathLibAppendDevicePath (
+ CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
+ CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+UefiDevicePathLibAppendDevicePathNode (
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+UefiDevicePathLibAppendDevicePathInstance (
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+UefiDevicePathLibGetNextDevicePathInstance (
+ EFI_DEVICE_PATH_PROTOCOL **DevicePath,
+ UINTN *Size
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+UefiDevicePathLibCreateDeviceNode (
+ UINT8 NodeType,
+ UINT8 NodeSubType,
+ UINT16 NodeLength
+ );
+
+BOOLEAN
+UefiDevicePathLibIsDevicePathMultiInstance (
+ CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+
+
+
#endif
diff --git a/BaseTools/Source/C/EfiRom/EfiRom.h b/BaseTools/Source/C/EfiRom/EfiRom.h
index 0b39e2af2e..637f621529 100644
--- a/BaseTools/Source/C/EfiRom/EfiRom.h
+++ b/BaseTools/Source/C/EfiRom/EfiRom.h
@@ -14,10 +14,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#include
-#include // for PE32 structure definitions
+#include // for PE32 structure definitions
-#include // for option ROM header structures
-#include
+#include // for option ROM header structures
+#include
#include "Compress.h"
#include "CommonLib.h"
diff --git a/BaseTools/Source/C/GenCrc32/GenCrc32.c b/BaseTools/Source/C/GenCrc32/GenCrc32.c
index 8c2056e369..877b83a53d 100644
--- a/BaseTools/Source/C/GenCrc32/GenCrc32.c
+++ b/BaseTools/Source/C/GenCrc32/GenCrc32.c
@@ -304,7 +304,7 @@ Returns:
// Calculate Crc32 value
//
if (FileAction == CRC32_ENCODE) {
- Status = CalculateCrc32 (FileBuffer, FileSize, &Crc32Value);
+ Status = BtCalculateCrc32 (FileBuffer, FileSize, &Crc32Value);
if (Status != EFI_SUCCESS) {
Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
goto Finish;
@@ -324,7 +324,7 @@ Returns:
Error (NULL, 0, 3000, "Invalid", "Input file is invalid!");
goto Finish;
}
- Status = CalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - sizeof (UINT32), &Crc32Value);
+ Status = BtCalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - sizeof (UINT32), &Crc32Value);
if (Status != EFI_SUCCESS) {
Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
goto Finish;
diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c b/BaseTools/Source/C/GenFfs/GenFfs.c
index d78d62ab36..a2092f66ff 100644
--- a/BaseTools/Source/C/GenFfs/GenFfs.c
+++ b/BaseTools/Source/C/GenFfs/GenFfs.c
@@ -6,6 +6,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+#include "WinNtInclude.h"
+
#ifndef __GNUC__
#include
#include
@@ -23,7 +25,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#include
-#include
+#include
#include
#include "CommonLib.h"
@@ -469,6 +471,7 @@ Returns:
}
EFI_STATUS
+EFIAPI
FfsRebaseImageRead (
IN VOID *FileHandle,
IN UINTN FileOffset,
@@ -895,7 +898,7 @@ Returns:
goto Finish;
}
- if (CompareGuid (&FileGuid, &mZeroGuid) == 0) {
+ if (BtCompareGuid (&FileGuid, &mZeroGuid) == 0) {
Error (NULL, 0, 1001, "Missing option", "fileguid");
goto Finish;
}
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index 0f8ab45511..b80cf68a71 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -1105,7 +1105,7 @@ Returns:
Status = GetSectionByType (FfsFile, EFI_SECTION_FREEFORM_SUBTYPE_GUID, 1,
&PadSection);
if (EFI_ERROR (Status) ||
- CompareGuid (&PadSection.FreeformSubtypeSection->SubTypeGuid,
+ BtCompareGuid (&PadSection.FreeformSubtypeSection->SubTypeGuid,
&mEfiFfsSectionAlignmentPaddingGuid) != 0) {
return FALSE;
}
@@ -1312,7 +1312,7 @@ Returns:
// Verify the input file is the duplicated file in this Fv image
//
for (Index1 = 0; Index1 < Index; Index1 ++) {
- if (CompareGuid ((EFI_GUID *) FileBuffer, &mFileGuidArray [Index1]) == 0) {
+ if (BtCompareGuid ((EFI_GUID *) FileBuffer, &mFileGuidArray [Index1]) == 0) {
Error (NULL, 0, 2000, "Invalid parameter", "the %dth file and %uth file have the same file GUID.", (unsigned) Index1 + 1, (unsigned) Index + 1);
PrintGuid ((EFI_GUID *) FileBuffer);
free (FileBuffer);
@@ -2802,8 +2802,8 @@ Returns:
mFvDataInfo.FvNameGuid.Data4[7]);
}
- if (CompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0 ||
- CompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem3Guid) == 0) {
+ if (BtCompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0 ||
+ BtCompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem3Guid) == 0) {
mFvDataInfo.IsPiFvImage = TRUE;
}
@@ -2944,7 +2944,7 @@ Returns:
//
FvHeader->HeaderLength = (UINT16) (((UINTN) &(FvHeader->BlockMap[Index + 1])) - (UINTN) FvImage);
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
//
// If there is no FFS file, generate one empty FV
@@ -3024,7 +3024,7 @@ Returns:
// Fv Extension header change update Fv Header Check sum
//
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
}
//
@@ -3090,7 +3090,7 @@ Returns:
// Update Checksum for FvHeader
//
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
}
if (mRiscV) {
@@ -3106,7 +3106,7 @@ Returns:
// Update Checksum for FvHeader
//
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
}
if (mLoongArch) {
@@ -3119,7 +3119,7 @@ Returns:
// Update Checksum for FvHeader
//
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
}
//
@@ -3132,16 +3132,16 @@ Returns:
// Update Checksum for FvHeader
//
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
}
//
// If there are large FFS in FV, the file system GUID should set to system 3 GUID.
//
- if (mIsLargeFfs && CompareGuid (&FvHeader->FileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0) {
+ if (mIsLargeFfs && BtCompareGuid (&FvHeader->FileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0) {
memcpy (&FvHeader->FileSystemGuid, &mEfiFirmwareFileSystem3Guid, sizeof (EFI_GUID));
FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
+ FvHeader->Checksum = BtCalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
}
WriteFile:
@@ -3464,6 +3464,7 @@ Returns:
}
EFI_STATUS
+EFIAPI
FfsRebaseImageRead (
IN VOID *FileHandle,
IN UINTN FileOffset,
@@ -4614,7 +4615,7 @@ Returns:
//
// Set Default Capsule Guid value
//
- if (CompareGuid (&mCapDataInfo.CapGuid, &mZeroGuid) == 0) {
+ if (BtCompareGuid (&mCapDataInfo.CapGuid, &mZeroGuid) == 0) {
memcpy (&mCapDataInfo.CapGuid, &mDefaultCapsuleGuid, sizeof (EFI_GUID));
}
//
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.h b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
index bf476f2c08..7bace6ad36 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.h
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
@@ -20,8 +20,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#include
-#include
-#include
+#include
+#include
+#include
#include "CommonLib.h"
#include "ParseInf.h"
diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index 0d543166f0..479d0f77a5 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -5,6 +5,8 @@ Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+#include "WinNtInclude.h"
+
#ifndef __GNUC__
#include
#include
@@ -19,8 +21,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#include
-#include
-#include
+#include
+#include
#include "CommonLib.h"
#include "Compress.h"
@@ -870,7 +872,7 @@ Returns:
);
if (Status == EFI_BUFFER_TOO_SMALL) {
- if (CompareGuid (VendorGuid, &mZeroGuid) == 0) {
+ if (BtCompareGuid (VendorGuid, &mZeroGuid) == 0) {
Offset = sizeof (CRC32_SECTION_HEADER);
if (InputLength + Offset >= MAX_SECTION_SIZE) {
Offset = sizeof (CRC32_SECTION_HEADER2);
@@ -927,12 +929,12 @@ Returns:
//
// Now data is in FileBuffer + Offset
//
- if (CompareGuid (VendorGuid, &mZeroGuid) == 0) {
+ if (BtCompareGuid (VendorGuid, &mZeroGuid) == 0) {
//
// Default Guid section is CRC32.
//
Crc32Checksum = 0;
- CalculateCrc32 (FileBuffer + Offset, InputLength, &Crc32Checksum);
+ BtCalculateCrc32 (FileBuffer + Offset, InputLength, &Crc32Checksum);
if (TotalLength >= MAX_SECTION_SIZE) {
Crc32GuidSect2 = (CRC32_SECTION_HEADER2 *) FileBuffer;
@@ -1142,6 +1144,7 @@ Returns:
}
EFI_STATUS
+EFIAPI
FfsRebaseImageRead (
IN VOID *FileHandle,
IN UINTN FileOffset,
@@ -1750,14 +1753,14 @@ Returns:
//
if ((SectType != EFI_SECTION_GUID_DEFINED) && (SectType != EFI_SECTION_FREEFORM_SUBTYPE_GUID) &&
(SectionName != NULL) &&
- (CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
+ (BtCompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
fprintf (stdout, "Warning: the input guid value is not required for this section type %s\n", SectionName);
}
//
// Check whether there is GUID for the SubtypeGuid section
//
- if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid (&VendorGuid, &mZeroGuid) == 0)) {
+ if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (BtCompareGuid (&VendorGuid, &mZeroGuid) == 0)) {
Error (NULL, 0, 1001, "Missing options", "GUID");
goto Finish;
}
@@ -1811,7 +1814,7 @@ Returns:
break;
case EFI_SECTION_GUID_DEFINED:
- if (InputFileAlign != NULL && (CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
+ if (InputFileAlign != NULL && (BtCompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
//
// Only process alignment for the default known CRC32 guided section.
// For the unknown guided section, the alignment is processed when the dummy all section (EFI_SECTION_ALL) is generated.
diff --git a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
deleted file mode 100644
index dfa725b2e3..0000000000
--- a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for AArch64.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Portions copyright (c) 2013, ARM Ltd. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-///
-/// Define the processor type so other code can make processor based choices
-///
-#define MDE_CPU_AARCH64
-
-//
-// Make sure we are using the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-#if _MSC_EXTENSIONS
- //
- // use Microsoft* C compiler dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-#else
- //
- // Use ANSI C 2000 stdint.h integer width declarations
- //
- #include
- typedef uint8_t BOOLEAN;
- typedef int8_t INT8;
- typedef uint8_t UINT8;
- typedef int16_t INT16;
- typedef uint16_t UINT16;
- typedef int32_t INT32;
- typedef uint32_t UINT32;
- typedef int64_t INT64;
- typedef uint64_t UINT64;
- typedef char CHAR8;
- typedef uint16_t CHAR16;
-
-#endif
-
-///
-/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef UINT64 UINTN;
-
-///
-/// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef INT64 INTN;
-
-//
-// Processor specific defines
-//
-
-///
-/// A value of native width with the highest bit set.
-///
-#define MAX_BIT 0x8000000000000000
-
-///
-/// A value of native width with the two highest bits set.
-///
-#define MAX_2_BITS 0xC000000000000000
-
-///
-/// The stack alignment required for AARCH64
-///
-#define CPU_STACK_ALIGNMENT 16
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#define EFIAPI
-
-#if defined(__GNUC__)
- ///
- /// For GNU assembly code, .global or .globl can declare global symbols.
- /// Define this macro to unify the usage.
- ///
- #define ASM_GLOBAL .globl
-
- #if !defined(__APPLE__)
- ///
- /// ARM EABI defines that the linker should not manipulate call relocations
- /// (do bl/blx conversion) unless the target symbol has function type.
- /// CodeSourcery 2010.09 started requiring the .type to function properly
- ///
- #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
-
- #define GCC_ASM_EXPORT(func__) \
- .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
- .type ASM_PFX(func__), %function
-
- #define GCC_ASM_IMPORT(func__) \
- .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
-
- #else
- //
- // .type not supported by Apple Xcode tools
- //
- #define INTERWORK_FUNC(func__)
-
- #define GCC_ASM_EXPORT(func__) \
- .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
-
- #define GCC_ASM_IMPORT(name)
-
- #endif
-#endif
-
-/**
- Return the pointer to the first instruction of a function given a function pointer.
- On ARM CPU architectures, these two pointer values are the same,
- so the implementation of this macro is very simple.
-
- @param FunctionPointer A pointer to a function.
-
- @return The pointer to the first instruction of a function given a function pointer.
-
-**/
-#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
-
-#endif
-
diff --git a/BaseTools/Source/C/Include/Arm/ProcessorBind.h b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
deleted file mode 100644
index 8fe4d5f162..0000000000
--- a/BaseTools/Source/C/Include/Arm/ProcessorBind.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for ARM.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-///
-/// Define the processor type so other code can make processor based choices
-///
-#define MDE_CPU_ARM
-
-//
-// Make sure we are using the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-#if _MSC_EXTENSIONS
- //
- // use Microsoft* C compiler dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-#else
- //
- // Assume standard ARM alignment.
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-
- #define UINT8_MAX 0xff
-#endif
-
-///
-/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef UINT32 UINTN;
-
-///
-/// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef INT32 INTN;
-
-//
-// Processor specific defines
-//
-
-///
-/// A value of native width with the highest bit set.
-///
-#define MAX_BIT 0x80000000
-
-///
-/// A value of native width with the two highest bits set.
-///
-#define MAX_2_BITS 0xC0000000
-
-///
-/// The stack alignment required for ARM
-///
-#define CPU_STACK_ALIGNMENT sizeof(UINT64)
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#define EFIAPI
-
-#if defined(__GNUC__)
- ///
- /// For GNU assembly code, .global or .globl can declare global symbols.
- /// Define this macro to unify the usage.
- ///
- #define ASM_GLOBAL .globl
-
- #if !defined(__APPLE__)
- ///
- /// ARM EABI defines that the linker should not manipulate call relocations
- /// (do bl/blx conversion) unless the target symbol has function type.
- /// CodeSourcery 2010.09 started requiring the .type to function properly
- ///
- #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
-
- #define GCC_ASM_EXPORT(func__) \
- .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
- .type ASM_PFX(func__), %function
-
- #define GCC_ASM_IMPORT(func__) \
- .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
-
- #else
- //
- // .type not supported by Apple Xcode tools
- //
- #define INTERWORK_FUNC(func__)
-
- #define GCC_ASM_EXPORT(func__) \
- .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
-
- #define GCC_ASM_IMPORT(name)
-
- #endif
-#endif
-
-/**
- Return the pointer to the first instruction of a function given a function pointer.
- On ARM CPU architectures, these two pointer values are the same,
- so the implementation of this macro is very simple.
-
- @param FunctionPointer A pointer to a function.
-
- @return The pointer to the first instruction of a function given a function pointer.
-
-**/
-#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
-
-#endif
-
-
diff --git a/BaseTools/Source/C/Include/Common/AutoGen.h b/BaseTools/Source/C/Include/Common/AutoGen.h
new file mode 100644
index 0000000000..8136bd1e2a
--- /dev/null
+++ b/BaseTools/Source/C/Include/Common/AutoGen.h
@@ -0,0 +1,94 @@
+/** @file
+ AutoGen definitions for edk2 package code consumption in BaseTools.
+
+ Copyright (c) 2023, Marvin Häuser. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _BT_AUTOGENH
+#define _BT_AUTOGENH
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+extern GUID gEfiCallerIdGuid;
+extern GUID gEdkiiDscPlatformGuid;
+extern CHAR8 *gEfiCallerBaseName;
+
+#define EFI_CALLER_ID_GUID \
+ {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}
+#define EDKII_DSC_PLATFORM_GUID \
+ {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}
+
+// Definition of SkuId Array
+extern UINT64 _gPcd_SkuId_Array[];
+
+// Definition of PCDs used in this module
+
+#define _PCD_TOKEN_PcdMaximumAsciiStringLength 0U
+#define _PCD_SIZE_PcdMaximumAsciiStringLength 4
+#define _PCD_GET_MODE_SIZE_PcdMaximumAsciiStringLength _PCD_SIZE_PcdMaximumAsciiStringLength
+#define _PCD_VALUE_PcdMaximumAsciiStringLength 0U
+#define _PCD_GET_MODE_32_PcdMaximumAsciiStringLength _PCD_VALUE_PcdMaximumAsciiStringLength
+//#define _PCD_SET_MODE_32_PcdMaximumAsciiStringLength ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdMaximumUnicodeStringLength 0U
+#define _PCD_SIZE_PcdMaximumUnicodeStringLength 4
+#define _PCD_GET_MODE_SIZE_PcdMaximumUnicodeStringLength _PCD_SIZE_PcdMaximumUnicodeStringLength
+#define _PCD_VALUE_PcdMaximumUnicodeStringLength 0U
+#define _PCD_GET_MODE_32_PcdMaximumUnicodeStringLength _PCD_VALUE_PcdMaximumUnicodeStringLength
+//#define _PCD_SET_MODE_32_PcdMaximumUnicodeStringLength ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdMaximumLinkedListLength 0U
+#define _PCD_SIZE_PcdMaximumLinkedListLength 4
+#define _PCD_GET_MODE_SIZE_PcdMaximumLinkedListLength _PCD_SIZE_PcdMaximumLinkedListLength
+#define _PCD_VALUE_PcdMaximumLinkedListLength 0U
+#define _PCD_GET_MODE_32_PcdMaximumLinkedListLength _PCD_VALUE_PcdMaximumLinkedListLength
+//#define _PCD_SET_MODE_32_PcdMaximumLinkedListLength ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdVerifyNodeInList 0U
+#define _PCD_SIZE_PcdVerifyNodeInList 1
+#define _PCD_GET_MODE_SIZE_PcdVerifyNodeInList _PCD_SIZE_PcdVerifyNodeInList
+#define _PCD_VALUE_PcdVerifyNodeInList 1U
+#define _PCD_GET_MODE_BOOL_PcdVerifyNodeInList _PCD_VALUE_PcdVerifyNodeInList
+//#define _PCD_SET_MODE_BOOL_PcdVerifyNodeInList ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdFixedDebugPrintErrorLevel 0U
+#define _PCD_SIZE_PcdFixedDebugPrintErrorLevel 4
+#define _PCD_GET_MODE_SIZE_PcdFixedDebugPrintErrorLevel _PCD_SIZE_PcdFixedDebugPrintErrorLevel
+#define _PCD_VALUE_PcdFixedDebugPrintErrorLevel 0xFFFFFFFFU
+#define _PCD_GET_MODE_32_PcdFixedDebugPrintErrorLevel _PCD_VALUE_PcdFixedDebugPrintErrorLevel
+//#define _PCD_SET_MODE_32_PcdFixedDebugPrintErrorLevel ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdDebugPropertyMask 0U
+#define _PCD_SIZE_PcdDebugPropertyMask 1
+#define _PCD_GET_MODE_SIZE_PcdDebugPropertyMask _PCD_SIZE_PcdDebugPropertyMask
+#define _PCD_VALUE_PcdDebugPropertyMask 0xFFU
+#define _PCD_GET_MODE_8_PcdDebugPropertyMask _PCD_VALUE_PcdDebugPropertyMask
+//#define _PCD_SET_MODE_8_PcdDebugPropertyMask ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdDebugClearMemoryValue 0U
+#define _PCD_SIZE_PcdDebugClearMemoryValue 1
+#define _PCD_GET_MODE_SIZE_PcdDebugClearMemoryValue _PCD_SIZE_PcdDebugClearMemoryValue
+#define _PCD_VALUE_PcdDebugClearMemoryValue 0xAFU
+#define _PCD_GET_MODE_8_PcdDebugClearMemoryValue _PCD_VALUE_PcdDebugClearMemoryValue
+//#define _PCD_SET_MODE_8_PcdDebugClearMemoryValue ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+#define _PCD_TOKEN_PcdDebugPrintErrorLevel 0U
+#define _PCD_SIZE_PcdDebugPrintErrorLevel 4
+#define _PCD_GET_MODE_SIZE_PcdDebugPrintErrorLevel _PCD_SIZE_PcdDebugPrintErrorLevel
+#define _PCD_VALUE_PcdDebugPrintErrorLevel 0x8000004F
+#define _PCD_GET_MODE_32_PcdDebugPrintErrorLevel _PCD_VALUE_PcdDebugPrintErrorLevel
+//#define _PCD_SET_MODE_32_PcdDebugPrintErrorLevel ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h b/BaseTools/Source/C/Include/Common/BaseTypes.h
index e669da894c..9e50325905 100644
--- a/BaseTools/Source/C/Include/Common/BaseTypes.h
+++ b/BaseTools/Source/C/Include/Common/BaseTypes.h
@@ -8,303 +8,37 @@
**/
-#ifndef __BASE_TYPES_H__
-#define __BASE_TYPES_H__
+#ifndef __BT_BASE_TYPES_H__
+#define __BT_BASE_TYPES_H__
//
-// Include processor specific binding
+// To be able to safely include Windows headers, we need to include
+// WinNtInclude.h first.
//
-#include
+#include "WinNtInclude.h"
+
#include
+#include
//
-// Modifiers to abstract standard types to aid in debug of problems
+// Base.h is a C header and must be linked against as such.
+// Without this, MSVC may fail to link against _ReturnAddress.
//
-#define CONST const
-#define STATIC static
-#define VOID void
-
-//
-// Modifiers for Data Types used to self document code.
-// This concept is borrowed for UEFI specification.
-//
-#ifndef IN
-//
-// Some other environments use this construct, so #ifndef to prevent
-// multiple definition.
-//
-#define IN
-#define OUT
-#define OPTIONAL
+#ifdef __cplusplus
+extern "C" {
#endif
//
-// Constants. They may exist in other build structures, so #ifndef them.
+// These macros may have been declared previously by C standard libraries.
//
-#ifndef TRUE
-//
-// BugBug: UEFI specification claims 1 and 0. We are concerned about the
-// compiler portability so we did it this way.
-//
-#define TRUE ((BOOLEAN)(1==1))
+#undef NULL
+#undef FALSE
+#undef TRUE
+
+#include
+
+#ifdef __cplusplus
+}
#endif
-#ifndef FALSE
-#define FALSE ((BOOLEAN)(0==1))
-#endif
-
-#ifndef NULL
-#define NULL ((VOID *) 0)
-#endif
-
-#define PACKED
-
-//
-// Support for variable length argument lists using the ANSI standard.
-//
-// Since we are using the ANSI standard we used the standard naming and
-// did not follow the coding convention
-//
-// VA_LIST - typedef for argument list.
-// VA_START (VA_LIST Marker, argument before the ...) - Init Marker for use.
-// VA_END (VA_LIST Marker) - Clear Marker
-// VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argument from
-// the ... list. You must know the size and pass it in this macro.
-//
-// example:
-//
-// UINTN
-// ExampleVarArg (
-// IN UINTN NumberOfArgs,
-// ...
-// )
-// {
-// VA_LIST Marker;
-// UINTN Index;
-// UINTN Result;
-//
-// //
-// // Initialize the Marker
-// //
-// VA_START (Marker, NumberOfArgs);
-// for (Index = 0, Result = 0; Index < NumberOfArgs; Index++) {
-// //
-// // The ... list is a series of UINTN values, so average them up.
-// //
-// Result += VA_ARG (Marker, UINTN);
-// }
-//
-// VA_END (Marker);
-// return Result
-// }
-//
-
-#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
-
-//
-// Also support coding convention rules for var arg macros
-//
-#ifndef VA_START
-
-// typedef CHAR8 *VA_LIST;
-// #define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v))
-// #define VA_ARG(ap, t) (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t)))
-// #define VA_END(ap) (ap = (VA_LIST) 0)
-// Use the native arguments for tools.
-#define VA_START va_start
-#define VA_ARG va_arg
-#define VA_END va_end
-#define VA_LIST va_list
-
-#endif
-
-#ifndef GUID_DEFINED
-#define GUID_DEFINED
-///
-/// 128 bit buffer containing a unique identifier value.
-/// Unless otherwise specified, aligned on a 64 bit boundary.
-///
-typedef struct {
- UINT32 Data1;
- UINT16 Data2;
- UINT16 Data3;
- UINT8 Data4[8];
-} GUID;
-#endif
-
-///
-/// 4-byte buffer. An IPv4 internet protocol address.
-///
-typedef struct {
- UINT8 Addr[4];
-} IPv4_ADDRESS;
-
-///
-/// 16-byte buffer. An IPv6 internet protocol address.
-///
-typedef struct {
- UINT8 Addr[16];
-} IPv6_ADDRESS;
-
-//
-// Macro that returns the byte offset of a field in a data structure.
-//
-#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field))
-
-///
-/// _CR - returns a pointer to the structure
-/// from one of its elements.
-///
-#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
-
-///
-/// ALIGN_POINTER - aligns a pointer to the lowest boundary
-///
-#define ALIGN_POINTER(p, s) ((VOID *) ((UINTN)(p) + (((s) - ((UINTN) (p))) & ((s) - 1))))
-
-///
-/// ALIGN_VARIABLE - aligns a variable up to the next natural boundary for int size of a processor
-///
-#define ALIGN_VARIABLE(Value, Adjustment) \
- Adjustment = 0U; \
- if ((UINTN) (Value) % sizeof (UINTN)) { \
- (Adjustment) = (UINTN)(sizeof (UINTN) - ((UINTN) (Value) % sizeof (UINTN))); \
- } \
- (Value) = (UINTN)((UINTN) (Value) + (UINTN) (Adjustment))
-
-//
-// Return the maximum of two operands.
-// This macro returns the maximum of two operand specified by a and b.
-// Both a and b must be the same numerical types, signed or unsigned.
-//
-#define MAX(a, b) \
- (((a) > (b)) ? (a) : (b))
-
-
-//
-// Return the minimum of two operands.
-// This macro returns the minimal of two operand specified by a and b.
-// Both a and b must be the same numerical types, signed or unsigned.
-//
-#define MIN(a, b) \
- (((a) < (b)) ? (a) : (b))
-
-
-//
-// EFI Error Codes common to all execution phases
-//
-
-typedef UINTN RETURN_STATUS;
-
-///
-/// Set the upper bit to indicate EFI Error.
-///
-#define ENCODE_ERROR(a) ((RETURN_STATUS)(MAX_BIT | (a)))
-
-#define ENCODE_WARNING(a) ((RETURN_STATUS)(a))
-#define RETURN_ERROR(a) (((INTN)(RETURN_STATUS)(a)) < 0)
-
-#define RETURN_SUCCESS 0
-#define RETURN_LOAD_ERROR ENCODE_ERROR (1)
-#define RETURN_INVALID_PARAMETER ENCODE_ERROR (2)
-#define RETURN_UNSUPPORTED ENCODE_ERROR (3)
-#define RETURN_BAD_BUFFER_SIZE ENCODE_ERROR (4)
-#define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5)
-#define RETURN_NOT_READY ENCODE_ERROR (6)
-#define RETURN_DEVICE_ERROR ENCODE_ERROR (7)
-#define RETURN_WRITE_PROTECTED ENCODE_ERROR (8)
-#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9)
-#define RETURN_VOLUME_CORRUPTED ENCODE_ERROR (10)
-#define RETURN_VOLUME_FULL ENCODE_ERROR (11)
-#define RETURN_NO_MEDIA ENCODE_ERROR (12)
-#define RETURN_MEDIA_CHANGED ENCODE_ERROR (13)
-#define RETURN_NOT_FOUND ENCODE_ERROR (14)
-#define RETURN_ACCESS_DENIED ENCODE_ERROR (15)
-#define RETURN_NO_RESPONSE ENCODE_ERROR (16)
-#define RETURN_NO_MAPPING ENCODE_ERROR (17)
-#define RETURN_TIMEOUT ENCODE_ERROR (18)
-#define RETURN_NOT_STARTED ENCODE_ERROR (19)
-#define RETURN_ALREADY_STARTED ENCODE_ERROR (20)
-#define RETURN_ABORTED ENCODE_ERROR (21)
-#define RETURN_ICMP_ERROR ENCODE_ERROR (22)
-#define RETURN_TFTP_ERROR ENCODE_ERROR (23)
-#define RETURN_PROTOCOL_ERROR ENCODE_ERROR (24)
-#define RETURN_INCOMPATIBLE_VERSION ENCODE_ERROR (25)
-#define RETURN_SECURITY_VIOLATION ENCODE_ERROR (26)
-#define RETURN_CRC_ERROR ENCODE_ERROR (27)
-#define RETURN_END_OF_MEDIA ENCODE_ERROR (28)
-#define RETURN_END_OF_FILE ENCODE_ERROR (31)
-
-#define RETURN_WARN_UNKNOWN_GLYPH ENCODE_WARNING (1)
-#define RETURN_WARN_DELETE_FAILURE ENCODE_WARNING (2)
-#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3)
-#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)
-
-typedef UINT64 PHYSICAL_ADDRESS;
-
-#define BIT0 0x00000001
-#define BIT1 0x00000002
-#define BIT2 0x00000004
-#define BIT3 0x00000008
-#define BIT4 0x00000010
-#define BIT5 0x00000020
-#define BIT6 0x00000040
-#define BIT7 0x00000080
-#define BIT8 0x00000100
-#define BIT9 0x00000200
-#define BIT10 0x00000400
-#define BIT11 0x00000800
-#define BIT12 0x00001000
-#define BIT13 0x00002000
-#define BIT14 0x00004000
-#define BIT15 0x00008000
-#define BIT16 0x00010000
-#define BIT17 0x00020000
-#define BIT18 0x00040000
-#define BIT19 0x00080000
-#define BIT20 0x00100000
-#define BIT21 0x00200000
-#define BIT22 0x00400000
-#define BIT23 0x00800000
-#define BIT24 0x01000000
-#define BIT25 0x02000000
-#define BIT26 0x04000000
-#define BIT27 0x08000000
-#define BIT28 0x10000000
-#define BIT29 0x20000000
-#define BIT30 0x40000000
-#define BIT31 0x80000000
-#define BIT32 0x0000000100000000ULL
-#define BIT33 0x0000000200000000ULL
-#define BIT34 0x0000000400000000ULL
-#define BIT35 0x0000000800000000ULL
-#define BIT36 0x0000001000000000ULL
-#define BIT37 0x0000002000000000ULL
-#define BIT38 0x0000004000000000ULL
-#define BIT39 0x0000008000000000ULL
-#define BIT40 0x0000010000000000ULL
-#define BIT41 0x0000020000000000ULL
-#define BIT42 0x0000040000000000ULL
-#define BIT43 0x0000080000000000ULL
-#define BIT44 0x0000100000000000ULL
-#define BIT45 0x0000200000000000ULL
-#define BIT46 0x0000400000000000ULL
-#define BIT47 0x0000800000000000ULL
-#define BIT48 0x0001000000000000ULL
-#define BIT49 0x0002000000000000ULL
-#define BIT50 0x0004000000000000ULL
-#define BIT51 0x0008000000000000ULL
-#define BIT52 0x0010000000000000ULL
-#define BIT53 0x0020000000000000ULL
-#define BIT54 0x0040000000000000ULL
-#define BIT55 0x0080000000000000ULL
-#define BIT56 0x0100000000000000ULL
-#define BIT57 0x0200000000000000ULL
-#define BIT58 0x0400000000000000ULL
-#define BIT59 0x0800000000000000ULL
-#define BIT60 0x1000000000000000ULL
-#define BIT61 0x2000000000000000ULL
-#define BIT62 0x4000000000000000ULL
-#define BIT63 0x8000000000000000ULL
-
#endif
diff --git a/BaseTools/Source/C/Include/Common/GuidedSectionExtractionEx.h b/BaseTools/Source/C/Include/Common/GuidedSectionExtractionEx.h
new file mode 100644
index 0000000000..3a9f505190
--- /dev/null
+++ b/BaseTools/Source/C/Include/Common/GuidedSectionExtractionEx.h
@@ -0,0 +1,36 @@
+/** @file
+ This file declares GUIDed section extraction protocol.
+
+ This interface provides a means of decoding a GUID defined encapsulation
+ section. There may be multiple different GUIDs associated with the GUIDed
+ section extraction protocol. That is, all instances of the GUIDed section
+ extraction protocol must have the same interface structure.
+
+ @par Revision Reference: PI
+ Version 1.00.
+
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __BT_EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
+#define __BT_EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
+
+#include
+#include
+
+//
+// Protocol GUID definition. Each GUIDed section extraction protocol has the
+// same interface but with different GUID. All the GUIDs is defined here.
+// May add multiple GUIDs here.
+//
+#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID
+
+//
+// may add other GUID here
+//
+#define gEfiCrc32GuidedSectionExtractionProtocolGuid gEfiCrc32GuidedSectionExtractionGuid
+
+#endif
\ No newline at end of file
diff --git a/BaseTools/Source/C/Include/Common/MdeModuleHii.h b/BaseTools/Source/C/Include/Common/MdeModuleHii.h
index d4944efe45..60697b9422 100644
--- a/BaseTools/Source/C/Include/Common/MdeModuleHii.h
+++ b/BaseTools/Source/C/Include/Common/MdeModuleHii.h
@@ -7,227 +7,10 @@
**/
-#ifndef _MDEMODULE_HII_H
-#define _MDEMODULE_HII_H
+#ifndef _BT_MDEMODULE_HII_H
+#define _BT_MDEMODULE_HII_H
-#define NARROW_CHAR 0xFFF0
-#define WIDE_CHAR 0xFFF1
-#define NON_BREAKING_CHAR 0xFFF2
-
-///
-/// State defined for password statemachine .
-///
-#define BROWSER_STATE_VALIDATE_PASSWORD 0
-#define BROWSER_STATE_SET_PASSWORD 1
-
-///
-/// GUIDed opcodes defined for EDKII implementation.
-///
-#define EFI_IFR_TIANO_GUID \
- { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }
-
-#pragma pack(1)
-
-///
-/// EDKII implementation extension opcodes, new extension can be added here later.
-///
-#define EFI_IFR_EXTEND_OP_LABEL 0x0
-#define EFI_IFR_EXTEND_OP_BANNER 0x1
-#define EFI_IFR_EXTEND_OP_TIMEOUT 0x2
-#define EFI_IFR_EXTEND_OP_CLASS 0x3
-#define EFI_IFR_EXTEND_OP_SUBCLASS 0x4
-
-///
-/// Label opcode.
-///
-typedef struct _EFI_IFR_GUID_LABEL {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_LABEL.
- ///
- UINT8 ExtendOpCode;
- ///
- /// Label Number.
- ///
- UINT16 Number;
-} EFI_IFR_GUID_LABEL;
-
-#define EFI_IFR_BANNER_ALIGN_LEFT 0
-#define EFI_IFR_BANNER_ALIGN_CENTER 1
-#define EFI_IFR_BANNER_ALIGN_RIGHT 2
-
-///
-/// Banner opcode.
-///
-typedef struct _EFI_IFR_GUID_BANNER {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_BANNER
- ///
- UINT8 ExtendOpCode;
- EFI_STRING_ID Title; ///< The string token for the banner title.
- UINT16 LineNumber; ///< 1-based line number.
- UINT8 Alignment; ///< left, center, or right-aligned.
-} EFI_IFR_GUID_BANNER;
-
-///
-/// Timeout opcode.
-///
-typedef struct _EFI_IFR_GUID_TIMEOUT {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_TIMEOUT.
- ///
- UINT8 ExtendOpCode;
- UINT16 TimeOut; ///< TimeOut Value.
-} EFI_IFR_GUID_TIMEOUT;
-
-#define EFI_NON_DEVICE_CLASS 0x00
-#define EFI_DISK_DEVICE_CLASS 0x01
-#define EFI_VIDEO_DEVICE_CLASS 0x02
-#define EFI_NETWORK_DEVICE_CLASS 0x04
-#define EFI_INPUT_DEVICE_CLASS 0x08
-#define EFI_ON_BOARD_DEVICE_CLASS 0x10
-#define EFI_OTHER_DEVICE_CLASS 0x20
-
-///
-/// Device Class opcode.
-///
-typedef struct _EFI_IFR_GUID_CLASS {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_CLASS.
- ///
- UINT8 ExtendOpCode;
- UINT16 Class; ///< Device Class from the above.
-} EFI_IFR_GUID_CLASS;
-
-#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
-#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
-#define EFI_FRONT_PAGE_SUBCLASS 0x02
-#define EFI_SINGLE_USE_SUBCLASS 0x03
-
-///
-/// SubClass opcode
-///
-typedef struct _EFI_IFR_GUID_SUBCLASS {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_SUBCLASS.
- ///
- UINT8 ExtendOpCode;
- UINT16 SubClass; ///< Sub Class type from the above.
-} EFI_IFR_GUID_SUBCLASS;
-
-///
-/// GUIDed opcodes support for framework vfr.
-///
-#define EFI_IFR_FRAMEWORK_GUID \
- { 0x31ca5d1a, 0xd511, 0x4931, { 0xb7, 0x82, 0xae, 0x6b, 0x2b, 0x17, 0x8c, 0xd7 } }
-
-///
-/// Two extended opcodes are added, and new extensions can be added here later.
-/// One is for framework OneOf question Option Key value;
-/// another is for framework vareqval.
-///
-#define EFI_IFR_EXTEND_OP_OPTIONKEY 0x0
-#define EFI_IFR_EXTEND_OP_VAREQNAME 0x1
-
-///
-/// Store the framework vfr option key value.
-///
-typedef struct _EFI_IFR_GUID_OPTIONKEY {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_FRAMEWORK_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_OPTIONKEY.
- ///
- UINT8 ExtendOpCode;
- ///
- /// OneOf Questiond ID binded by OneOf Option.
- ///
- EFI_QUESTION_ID QuestionId;
- ///
- /// The OneOf Option Value.
- ///
- EFI_IFR_TYPE_VALUE OptionValue;
- ///
- /// The Framework OneOf Option Key Value.
- ///
- UINT16 KeyValue;
-} EFI_IFR_GUID_OPTIONKEY;
-
-///
-/// Store the framework vfr vareqval name number.
-///
-typedef struct _EFI_IFR_GUID_VAREQNAME {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_FRAMEWORK_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_VAREQNAME.
- ///
- UINT8 ExtendOpCode;
- ///
- /// Question ID of the Numeric Opcode created.
- ///
- EFI_QUESTION_ID QuestionId;
- ///
- /// For vareqval (0x100), NameId is 0x100.
- /// This value will convert to a Unicode String following this rule;
- /// sprintf(StringBuffer, "%d", NameId) .
- /// The Unicode String will be used as a EFI Variable Name.
- ///
- UINT16 NameId;
-} EFI_IFR_GUID_VAREQNAME;
-
-///
-/// EDKII implementation extension GUID, used to indicate there are bit fields in the varstore.
-///
-#define EDKII_IFR_BIT_VARSTORE_GUID \
- { 0x82DDD68B, 0x9163, 0x4187, {0x9B, 0x27, 0x20, 0xA8, 0xFD, 0x60 ,0xA7, 0x1D}}
-
-///
-/// EDKII implementation extension flags, used to indicate the display style and bit width for bit filed storage.
-/// Two high bits for display style and the low six bits for bit width.
-///
-#define EDKII_IFR_DISPLAY_BIT 0xC0
-#define EDKII_IFR_DISPLAY_INT_DEC_BIT 0x00
-#define EDKII_IFR_DISPLAY_UINT_DEC_BIT 0x40
-#define EDKII_IFR_DISPLAY_UINT_HEX_BIT 0x80
-
-#define EDKII_IFR_NUMERIC_SIZE_BIT 0x3F
-
-#pragma pack()
-
-extern EFI_GUID gEfiIfrTianoGuid;
-extern EFI_GUID gEfiIfrFrameworkGuid;
-extern EFI_GUID gEdkiiIfrBitVarStoreGuid;
+#include
#endif
diff --git a/BaseTools/Source/C/Include/Common/PeImageEx.h b/BaseTools/Source/C/Include/Common/PeImageEx.h
new file mode 100644
index 0000000000..3e4e129778
--- /dev/null
+++ b/BaseTools/Source/C/Include/Common/PeImageEx.h
@@ -0,0 +1,59 @@
+/** @file
+ EFI image format for PE32+. Please note some data structures are different
+ for IA-32 and Itanium-based images, look for UINTN and the #ifdef EFI_IA64
+
+ @bug Fix text - doc as defined in MSFT EFI specification.
+
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
+ Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __BT_PE_IMAGE_H__
+#define __BT_PE_IMAGE_H__
+
+#include
+
+//
+// PE32+ Machine type for EFI images
+//
+#define IMAGE_FILE_MACHINE_ARM 0x01c0
+#define IMAGE_FILE_MACHINE_ARMT IMAGE_FILE_MACHINE_ARMTHUMB_MIXED
+
+//
+// Support old names for backward compatible
+//
+#define EFI_IMAGE_MACHINE_ARMT EFI_IMAGE_MACHINE_ARMTHUMB_MIXED
+
+#define EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 // Supports addresses > 2-GB
+
+//
+// Based export types.
+//
+#define EFI_IMAGE_EXPORT_ORDINAL_BASE 1
+#define EFI_IMAGE_EXPORT_ADDR_SIZE 4
+#define EFI_IMAGE_EXPORT_ORDINAL_SIZE 2
+
+//
+// .pdata entries for X64
+//
+typedef struct {
+ UINT32 FunctionStartAddress;
+ UINT32 FunctionEndAddress;
+ UINT32 UnwindInfoAddress;
+} RUNTIME_FUNCTION;
+
+typedef struct {
+ UINT8 Version:3;
+ UINT8 Flags:5;
+ UINT8 SizeOfProlog;
+ UINT8 CountOfUnwindCodes;
+ UINT8 FrameRegister:4;
+ UINT8 FrameRegisterOffset:4;
+} UNWIND_INFO;
+
+#endif
diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareFile.h b/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
index 56874374ca..a3d1c76956 100644
--- a/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
+++ b/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
@@ -10,308 +10,24 @@
**/
-#ifndef __PI_FIRMWARE_FILE_H__
-#define __PI_FIRMWARE_FILE_H__
+#ifndef __BT_PI_FIRMWARE_FILE_H__
+#define __BT_PI_FIRMWARE_FILE_H__
-#pragma pack(1)
-//
-// Used to verify the integrity of the file.
-//
-typedef union {
- struct {
- UINT8 Header;
- UINT8 File;
- } Checksum;
- UINT16 Checksum16;
-} EFI_FFS_INTEGRITY_CHECK;
+#include
+#include
-typedef UINT8 EFI_FV_FILETYPE;
-typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
-typedef UINT8 EFI_FFS_FILE_STATE;
+#define MAX_FFS_SIZE 0x1000000
+#define MAX_SECTION_SIZE 0x1000000
-//
-// File Types Definitions
-//
-#define EFI_FV_FILETYPE_ALL 0x00
-#define EFI_FV_FILETYPE_RAW 0x01
-#define EFI_FV_FILETYPE_FREEFORM 0x02
-#define EFI_FV_FILETYPE_SECURITY_CORE 0x03
-#define EFI_FV_FILETYPE_PEI_CORE 0x04
-#define EFI_FV_FILETYPE_DXE_CORE 0x05
-#define EFI_FV_FILETYPE_PEIM 0x06
-#define EFI_FV_FILETYPE_DRIVER 0x07
-#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08
-#define EFI_FV_FILETYPE_APPLICATION 0x09
-#define EFI_FV_FILETYPE_SMM 0x0A
-#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
-#define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C
-#define EFI_FV_FILETYPE_SMM_CORE 0x0D
-#define EFI_FV_FILETYPE_MM_STANDALONE 0x0E
-#define EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F
-#define EFI_FV_FILETYPE_OEM_MIN 0xc0
-#define EFI_FV_FILETYPE_OEM_MAX 0xdf
-#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0
-#define EFI_FV_FILETYPE_DEBUG_MAX 0xef
-#define EFI_FV_FILETYPE_FFS_MIN 0xf0
-#define EFI_FV_FILETYPE_FFS_MAX 0xff
-#define EFI_FV_FILETYPE_FFS_PAD 0xf0
//
// FFS File Attributes.
//
-#define FFS_ATTRIB_LARGE_FILE 0x01
-#define FFS_ATTRIB_DATA_ALIGNMENT2 0x02
-#define FFS_ATTRIB_FIXED 0x04
-#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
-#define FFS_ATTRIB_CHECKSUM 0x40
-//
-// FFS_FIXED_CHECKSUM is the checksum value used when the
-// FFS_ATTRIB_CHECKSUM attribute bit is clear
-//
-#define FFS_FIXED_CHECKSUM 0xAA
-
-//
-// FFS File State Bits.
-//
-#define EFI_FILE_HEADER_CONSTRUCTION 0x01
-#define EFI_FILE_HEADER_VALID 0x02
-#define EFI_FILE_DATA_VALID 0x04
-#define EFI_FILE_MARKED_FOR_UPDATE 0x08
-#define EFI_FILE_DELETED 0x10
-#define EFI_FILE_HEADER_INVALID 0x20
-
-#define EFI_FILE_ALL_STATE_BITS (EFI_FILE_HEADER_CONSTRUCTION | \
- EFI_FILE_HEADER_VALID | \
- EFI_FILE_DATA_VALID | \
- EFI_FILE_MARKED_FOR_UPDATE | \
- EFI_FILE_DELETED | \
- EFI_FILE_HEADER_INVALID \
- )
-
-//
-// Each file begins with the header that describe the
-// contents and state of the files.
-//
-typedef struct {
- EFI_GUID Name;
- EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
- EFI_FV_FILETYPE Type;
- EFI_FFS_FILE_ATTRIBUTES Attributes;
- UINT8 Size[3];
- EFI_FFS_FILE_STATE State;
-} EFI_FFS_FILE_HEADER;
-
-typedef struct {
- EFI_GUID Name;
- EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
- EFI_FV_FILETYPE Type;
- EFI_FFS_FILE_ATTRIBUTES Attributes;
- UINT8 Size[3];
- EFI_FFS_FILE_STATE State;
- UINT64 ExtendedSize;
-} EFI_FFS_FILE_HEADER2;
-
-#define MAX_FFS_SIZE 0x1000000
-
-typedef UINT8 EFI_SECTION_TYPE;
-
-//
-// Pseudo type. It is
-// used as a wild card when retrieving sections. The section
-// type EFI_SECTION_ALL matches all section types.
-//
-#define EFI_SECTION_ALL 0x00
-
-//
-// Encapsulation section Type values
-//
-#define EFI_SECTION_COMPRESSION 0x01
-
-#define EFI_SECTION_GUID_DEFINED 0x02
-
-//
-// Leaf section Type values
-//
-#define EFI_SECTION_PE32 0x10
-#define EFI_SECTION_PIC 0x11
-#define EFI_SECTION_TE 0x12
-#define EFI_SECTION_DXE_DEPEX 0x13
-#define EFI_SECTION_VERSION 0x14
-#define EFI_SECTION_USER_INTERFACE 0x15
-#define EFI_SECTION_COMPATIBILITY16 0x16
-#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17
-#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
-#define EFI_SECTION_RAW 0x19
-#define EFI_SECTION_PEI_DEPEX 0x1B
-#define EFI_SECTION_SMM_DEPEX 0x1C
-
-typedef struct {
- UINT8 Size[3];
- EFI_SECTION_TYPE Type;
-} EFI_COMMON_SECTION_HEADER;
-
-typedef struct {
- UINT8 Size[3];
- EFI_SECTION_TYPE Type;
- UINT32 ExtendedSize;
-} EFI_COMMON_SECTION_HEADER2;
-
-#define MAX_SECTION_SIZE 0x1000000
-
-//
-// Leaf section type that contains an
-// IA-32 16-bit executable image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2;
+#define FFS_ATTRIB_DATA_ALIGNMENT2 FFS_ATTRIB_DATA_ALIGNMENT_2
//
// CompressionType of EFI_COMPRESSION_SECTION.
//
-#define EFI_NOT_COMPRESSED 0x00
-#define EFI_STANDARD_COMPRESSION 0x01
#define TIANO_COMPRESS 0x02
-//
-// An encapsulation section type in which the
-// section data is compressed.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- UINT32 UncompressedLength;
- UINT8 CompressionType;
-} EFI_COMPRESSION_SECTION;
-
-typedef struct {
- EFI_COMMON_SECTION_HEADER2 CommonHeader;
- UINT32 UncompressedLength;
- UINT8 CompressionType;
-} EFI_COMPRESSION_SECTION2;
-
-//
-// Leaf section which could be used to determine the dispatch order of DXEs.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2;
-
-//
-// Leaf section witch contains a PI FV.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2;
-
-//
-// Leaf section which contains a single GUID.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- EFI_GUID SubTypeGuid;
-} EFI_FREEFORM_SUBTYPE_GUID_SECTION;
-
-typedef struct {
- EFI_COMMON_SECTION_HEADER2 CommonHeader;
- EFI_GUID SubTypeGuid;
-} EFI_FREEFORM_SUBTYPE_GUID_SECTION2;
-
-//
-// Attributes of EFI_GUID_DEFINED_SECTION
-//
-#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
-#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
-//
-// Leaf section which is encapsulation defined by specific GUID
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- EFI_GUID SectionDefinitionGuid;
- UINT16 DataOffset;
- UINT16 Attributes;
-} EFI_GUID_DEFINED_SECTION;
-
-typedef struct {
- EFI_COMMON_SECTION_HEADER2 CommonHeader;
- EFI_GUID SectionDefinitionGuid;
- UINT16 DataOffset;
- UINT16 Attributes;
-} EFI_GUID_DEFINED_SECTION2;
-
-//
-// Leaf section which contains PE32+ image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2;
-
-//
-// Leaf section which contains PIC image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2;
-
-//
-// Leaf section which used to determine the dispatch order of PEIMs.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2;
-
-//
-// Leaf section which constains the position-independent-code image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2;
-
-//
-// Leaf section which contains an array of zero or more bytes.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;
-typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2;
-
-//
-// Leaf section which contains a unicode string that
-// is human readable file name.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
-
- //
- // Array of unicode string.
- //
- CHAR16 FileNameString[1];
-} EFI_USER_INTERFACE_SECTION;
-
-typedef struct {
- EFI_COMMON_SECTION_HEADER2 CommonHeader;
-
- //
- // Array of unicode string.
- //
- CHAR16 FileNameString[1];
-} EFI_USER_INTERFACE_SECTION2;
-
-//
-// Leaf section which contains a numeric build number and
-// an optional unicode string that represent the file revision.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- UINT16 BuildNumber;
- CHAR16 VersionString[1];
-} EFI_VERSION_SECTION;
-
-typedef struct {
- EFI_COMMON_SECTION_HEADER2 CommonHeader;
- UINT16 BuildNumber;
- CHAR16 VersionString[1];
-} EFI_VERSION_SECTION2;
-
-//
-// The argument passed as the SectionHeaderPtr parameter to the SECTION_SIZE()
-// function-like macro below must not have side effects: SectionHeaderPtr is
-// evaluated multiple times.
-//
-#define SECTION_SIZE(SectionHeaderPtr) ((UINT32) ( \
- (((EFI_COMMON_SECTION_HEADER *) (SectionHeaderPtr))->Size[0] ) | \
- (((EFI_COMMON_SECTION_HEADER *) (SectionHeaderPtr))->Size[1] << 8) | \
- (((EFI_COMMON_SECTION_HEADER *) (SectionHeaderPtr))->Size[2] << 16)))
-
-#pragma pack()
typedef union {
EFI_COMMON_SECTION_HEADER *CommonHeader;
diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
index 35afbdf00a..f0d28dae30 100644
--- a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
+++ b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
@@ -10,148 +10,9 @@
**/
-#ifndef __PI_FIRMWAREVOLUME_H__
-#define __PI_FIRMWAREVOLUME_H__
+#ifndef __BT_PI_FIRMWAREVOLUME_H__
+#define __BT_PI_FIRMWAREVOLUME_H__
-//
-// EFI_FV_FILE_ATTRIBUTES
-//
-typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
-
-//
-// Value of EFI_FV_FILE_ATTRIBUTES.
-//
-#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F
-#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
-#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
-
-typedef UINT32 EFI_FVB_ATTRIBUTES_2;
-
-//
-// Attributes bit definitions
-//
-#define EFI_FVB2_READ_DISABLED_CAP 0x00000001
-#define EFI_FVB2_READ_ENABLED_CAP 0x00000002
-#define EFI_FVB2_READ_STATUS 0x00000004
-#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008
-#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010
-#define EFI_FVB2_WRITE_STATUS 0x00000020
-#define EFI_FVB2_LOCK_CAP 0x00000040
-#define EFI_FVB2_LOCK_STATUS 0x00000080
-#define EFI_FVB2_STICKY_WRITE 0x00000200
-#define EFI_FVB2_MEMORY_MAPPED 0x00000400
-#define EFI_FVB2_ERASE_POLARITY 0x00000800
-#define EFI_FVB2_READ_LOCK_CAP 0x00001000
-#define EFI_FVB2_READ_LOCK_STATUS 0x00002000
-#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000
-#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000
-#define EFI_FVB2_ALIGNMENT 0x001F0000
-#define EFI_FVB2_WEAK_ALIGNMENT 0x80000000
-#define EFI_FVB2_ALIGNMENT_1 0x00000000
-#define EFI_FVB2_ALIGNMENT_2 0x00010000
-#define EFI_FVB2_ALIGNMENT_4 0x00020000
-#define EFI_FVB2_ALIGNMENT_8 0x00030000
-#define EFI_FVB2_ALIGNMENT_16 0x00040000
-#define EFI_FVB2_ALIGNMENT_32 0x00050000
-#define EFI_FVB2_ALIGNMENT_64 0x00060000
-#define EFI_FVB2_ALIGNMENT_128 0x00070000
-#define EFI_FVB2_ALIGNMENT_256 0x00080000
-#define EFI_FVB2_ALIGNMENT_512 0x00090000
-#define EFI_FVB2_ALIGNMENT_1K 0x000A0000
-#define EFI_FVB2_ALIGNMENT_2K 0x000B0000
-#define EFI_FVB2_ALIGNMENT_4K 0x000C0000
-#define EFI_FVB2_ALIGNMENT_8K 0x000D0000
-#define EFI_FVB2_ALIGNMENT_16K 0x000E0000
-#define EFI_FVB2_ALIGNMENT_32K 0x000F0000
-#define EFI_FVB2_ALIGNMENT_64K 0x00100000
-#define EFI_FVB2_ALIGNMENT_128K 0x00110000
-#define EFI_FVB2_ALIGNMENT_256K 0x00120000
-#define EFI_FVB2_ALIGNMENT_512K 0x00130000
-#define EFI_FVB2_ALIGNMENT_1M 0x00140000
-#define EFI_FVB2_ALIGNMENT_2M 0x00150000
-#define EFI_FVB2_ALIGNMENT_4M 0x00160000
-#define EFI_FVB2_ALIGNMENT_8M 0x00170000
-#define EFI_FVB2_ALIGNMENT_16M 0x00180000
-#define EFI_FVB2_ALIGNMENT_32M 0x00190000
-#define EFI_FVB2_ALIGNMENT_64M 0x001A0000
-#define EFI_FVB2_ALIGNMENT_128M 0x001B0000
-#define EFI_FVB2_ALIGNMENT_256M 0x001C0000
-#define EFI_FVB2_ALIGNMENT_512M 0x001D0000
-#define EFI_FVB2_ALIGNMENT_1G 0x001E0000
-#define EFI_FVB2_ALIGNMENT_2G 0x001F0000
-
-
-typedef struct {
- UINT32 NumBlocks;
- UINT32 Length;
-} EFI_FV_BLOCK_MAP_ENTRY;
-
-//
-// Describes the features and layout of the firmware volume.
-//
-typedef struct {
- UINT8 ZeroVector[16];
- EFI_GUID FileSystemGuid;
- UINT64 FvLength;
- UINT32 Signature;
- EFI_FVB_ATTRIBUTES_2 Attributes;
- UINT16 HeaderLength;
- UINT16 Checksum;
- UINT16 ExtHeaderOffset;
- UINT8 Reserved[1];
- UINT8 Revision;
- EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];
-} EFI_FIRMWARE_VOLUME_HEADER;
-
-#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H')
-
-///
-/// Firmware Volume Header Revision definition
-///
-#define EFI_FVH_REVISION 0x02
-
-//
-// Extension header pointed by ExtHeaderOffset of volume header.
-//
-typedef struct {
- EFI_GUID FvName;
- UINT32 ExtHeaderSize;
-} EFI_FIRMWARE_VOLUME_EXT_HEADER;
-
-typedef struct {
- UINT16 ExtEntrySize;
- UINT16 ExtEntryType;
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY;
-
-#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01
-typedef struct {
- EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
- UINT32 TypeMask;
-
- //
- // Array of GUIDs.
- // Each GUID represents an OEM file type.
- //
- // EFI_GUID Types[1];
- //
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
-
-#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002
-typedef struct {
- EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
- EFI_GUID FormatType;
-
- //
- // An array of bytes of length Length.
- //
- // UINT8 Data[1];
- //
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;
-
-#define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03
-typedef struct {
- EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
- UINT32 UsedSize;
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE;
+#include
#endif
diff --git a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
index acf179af23..a47549cc9b 100644
--- a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
+++ b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
@@ -7,162 +7,10 @@
**/
-#ifndef __UEFI_BASETYPE_H__
-#define __UEFI_BASETYPE_H__
+#ifndef __BT_UEFI_BASETYPE_H__
+#define __BT_UEFI_BASETYPE_H__
#include
-
-//
-// Basical data type definitions introduced in UEFI.
-//
-typedef struct {
- UINT32 Data1;
- UINT16 Data2;
- UINT16 Data3;
- UINT8 Data4[8];
-} EFI_GUID;
-
-typedef RETURN_STATUS EFI_STATUS;
-typedef VOID *EFI_HANDLE;
-
-typedef VOID *EFI_EVENT;
-
-typedef UINTN EFI_TPL;
-
-
-typedef UINT64 EFI_LBA;
-
-
-typedef UINT16 STRING_REF;
-
-typedef UINT64 EFI_PHYSICAL_ADDRESS;
-typedef UINT64 EFI_VIRTUAL_ADDRESS;
-
-//
-// EFI Time Abstraction:
-// Year: 2000 - 20XX
-// Month: 1 - 12
-// Day: 1 - 31
-// Hour: 0 - 23
-// Minute: 0 - 59
-// Second: 0 - 59
-// Nanosecond: 0 - 999,999,999
-// TimeZone: -1440 to 1440 or 2047
-//
-typedef struct {
- UINT16 Year;
- UINT8 Month;
- UINT8 Day;
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
- UINT8 Pad1;
- UINT32 Nanosecond;
- INT16 TimeZone;
- UINT8 Daylight;
- UINT8 Pad2;
-} EFI_TIME;
-
-
-//
-// Networking Definitions
-//
-typedef struct {
- UINT8 Addr[4];
-} EFI_IPv4_ADDRESS;
-
-typedef struct {
- UINT8 Addr[16];
-} EFI_IPv6_ADDRESS;
-
-typedef struct {
- UINT8 Addr[32];
-} EFI_MAC_ADDRESS;
-
-typedef union {
- UINT32 Addr[4];
- EFI_IPv4_ADDRESS v4;
- EFI_IPv6_ADDRESS v6;
-} EFI_IP_ADDRESS;
-
-
-//
-// Enumeration of EFI_STATUS.
-//
-#define EFI_SUCCESS RETURN_SUCCESS
-#define EFI_LOAD_ERROR RETURN_LOAD_ERROR
-#define EFI_INVALID_PARAMETER RETURN_INVALID_PARAMETER
-#define EFI_UNSUPPORTED RETURN_UNSUPPORTED
-#define EFI_BAD_BUFFER_SIZE RETURN_BAD_BUFFER_SIZE
-#define EFI_BUFFER_TOO_SMALL RETURN_BUFFER_TOO_SMALL
-#define EFI_NOT_READY RETURN_NOT_READY
-#define EFI_DEVICE_ERROR RETURN_DEVICE_ERROR
-#define EFI_WRITE_PROTECTED RETURN_WRITE_PROTECTED
-#define EFI_OUT_OF_RESOURCES RETURN_OUT_OF_RESOURCES
-#define EFI_VOLUME_CORRUPTED RETURN_VOLUME_CORRUPTED
-#define EFI_VOLUME_FULL RETURN_VOLUME_FULL
-#define EFI_NO_MEDIA RETURN_NO_MEDIA
-#define EFI_MEDIA_CHANGED RETURN_MEDIA_CHANGED
-#define EFI_NOT_FOUND RETURN_NOT_FOUND
-#define EFI_ACCESS_DENIED RETURN_ACCESS_DENIED
-#define EFI_NO_RESPONSE RETURN_NO_RESPONSE
-#define EFI_NO_MAPPING RETURN_NO_MAPPING
-#define EFI_TIMEOUT RETURN_TIMEOUT
-#define EFI_NOT_STARTED RETURN_NOT_STARTED
-#define EFI_ALREADY_STARTED RETURN_ALREADY_STARTED
-#define EFI_ABORTED RETURN_ABORTED
-#define EFI_ICMP_ERROR RETURN_ICMP_ERROR
-#define EFI_TFTP_ERROR RETURN_TFTP_ERROR
-#define EFI_PROTOCOL_ERROR RETURN_PROTOCOL_ERROR
-#define EFI_INCOMPATIBLE_VERSION RETURN_INCOMPATIBLE_VERSION
-#define EFI_SECURITY_VIOLATION RETURN_SECURITY_VIOLATION
-#define EFI_CRC_ERROR RETURN_CRC_ERROR
-#define EFI_END_OF_MEDIA RETURN_END_OF_MEDIA
-#define EFI_END_OF_FILE RETURN_END_OF_FILE
-
-#define EFI_WARN_UNKNOWN_GLYPH RETURN_WARN_UNKNOWN_GLYPH
-#define EFI_WARN_DELETE_FAILURE RETURN_WARN_DELETE_FAILURE
-#define EFI_WARN_WRITE_FAILURE RETURN_WARN_WRITE_FAILURE
-#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
-
-
-#define NULL_HANDLE ((VOID *) 0)
-
-//
-// Define macro to encode the status code.
-//
-#define EFIERR(_a) ENCODE_ERROR(_a)
-
-#define EFI_ERROR(A) RETURN_ERROR(A)
-
-//
-// Define macros to build data structure signatures from characters.
-//
-#define SIGNATURE_16(A, B) ((A) | (B << 8))
-#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
-#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
- (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
-
-
-//
-// Returns the byte offset to a field within a structure
-//
-#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
-
-//
-// The EFI memory allocation functions work in units of EFI_PAGEs that are
-// 4K. This should in no way be confused with the page size of the processor.
-// An EFI_PAGE is just the quanta of memory in EFI.
-//
-#define EFI_PAGE_SIZE 0x1000
-#define EFI_PAGE_MASK 0xFFF
-#define EFI_PAGE_SHIFT 12
-
-#define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))
-
-#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
-
-
-#define EFI_MAX_BIT MAX_BIT
+#include
#endif
diff --git a/BaseTools/Source/C/Include/Common/UefiCapsule.h b/BaseTools/Source/C/Include/Common/UefiCapsule.h
index ecfe3a0a7a..01beb6b84f 100644
--- a/BaseTools/Source/C/Include/Common/UefiCapsule.h
+++ b/BaseTools/Source/C/Include/Common/UefiCapsule.h
@@ -9,18 +9,10 @@
**/
-#ifndef _EFI_CAPSULE_H_
-#define _EFI_CAPSULE_H_
+#ifndef _BT_EFI_CAPSULE_H_
+#define _BT_EFI_CAPSULE_H_
-typedef struct {
- EFI_GUID CapsuleGuid;
- UINT32 HeaderSize;
- UINT32 Flags;
- UINT32 CapsuleImageSize;
-} EFI_CAPSULE_HEADER;
+#include
+#include
-#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
-#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
-#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
-
-#endif // #ifndef _EFI_CAPSULE_H_
+#endif // #ifndef _EFI_CAPSULE_H_
diff --git a/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h b/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
index b9fa8c39a6..76b8f8254a 100644
--- a/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
+++ b/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
@@ -13,1668 +13,13 @@
**/
-#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
-#define __UEFI_INTERNAL_FORMREPRESENTATION_H__
+#ifndef __BT_UEFI_INTERNAL_FORMREPRESENTATION_H__
+#define __BT_UEFI_INTERNAL_FORMREPRESENTATION_H__
-#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
- { 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }
+#include
+#include
-//
-// The following types are currently defined:
-//
-typedef UINT32 RELOFST;
-
-typedef VOID* EFI_HII_HANDLE;
-typedef CHAR16* EFI_STRING;
-typedef UINT16 EFI_IMAGE_ID;
-typedef UINT16 EFI_QUESTION_ID;
-typedef UINT16 EFI_STRING_ID;
-typedef UINT16 EFI_FORM_ID;
-typedef UINT16 EFI_VARSTORE_ID;
-typedef UINT16 EFI_DEFAULT_ID;
-typedef UINT32 EFI_HII_FONT_STYLE;
-
-
-
-#pragma pack(1)
-
-
-//
-// HII package list
-//
-typedef struct {
- EFI_GUID PackageListGuid;
- UINT32 PackageLength;
-} EFI_HII_PACKAGE_LIST_HEADER;
-
-/**
-
- Each package starts with a header, as defined above, which
- indicates the size and type of the package. When added to a
- pointer pointing to the start of the header, Length points at
- the next package. The package lists form a package list when
- concatenated together and terminated with an
- EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The
- type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII
- packages, whose contents are determined by the Guid. The range
- of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN
- through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system
- firmware implementers.
-
- @param Length The size of the package in bytes.
-
- @param Type The package type. See EFI_HII_PACKAGE_TYPE_x,
- below.
-
- @param Data The package data, the format of which is
- determined by Type.
-
-**/
-typedef struct {
- UINT32 Length:24;
- UINT32 Type:8;
- // UINT8 Data[...];
-} EFI_HII_PACKAGE_HEADER;
-
-//
-// EFI_HII_PACKAGE_TYPE_x.
-//
-#define EFI_HII_PACKAGE_TYPE_ALL 0x00
-#define EFI_HII_PACKAGE_TYPE_GUID 0x01
-#define EFI_HII_PACKAGE_FORM 0x02
-#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x03
-#define EFI_HII_PACKAGE_STRINGS 0x04
-#define EFI_HII_PACKAGE_FONTS 0x05
-#define EFI_HII_PACKAGE_IMAGES 0x06
-#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07
-#define EFI_HII_PACKAGE_DEVICE_PATH 0x08
-#define EFI_HII_PACKAGE_END 0xDF
-#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
-#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
-
-//
-// Simplified Font Package
-//
-
-#define EFI_GLYPH_HEIGHT 19
-#define EFI_GLYPH_WIDTH 8
-//
-// Contents of EFI_NARROW_GLYPH.Attributes
-//
-#define EFI_GLYPH_NON_SPACING 0x01
-#define EFI_GLYPH_WIDE 0x02
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
-} EFI_NARROW_GLYPH;
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
- UINT8 GlyphCol2[EFI_GLYPH_HEIGHT];
- UINT8 Pad[3];
-} EFI_WIDE_GLYPH;
-
-
-typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT16 NumberOfNarrowGlyphs;
- UINT16 NumberOfWideGlyphs;
- // EFI_NARROW_GLYPH NarrowGlyphs[];
- // EFI_WIDE_GLYPH WideGlyphs[];
-} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
-
-//
-// Font Package
-//
-
-#define EFI_HII_FONT_STYLE_BOLD 0x00000001
-#define EFI_HII_FONT_STYLE_ITALIC 0x00000002
-#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000
-#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000
-#define EFI_HII_FONT_STYLE_SHADOW 0x00040000
-#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000
-#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000
-
-typedef struct _EFI_HII_GLYPH_INFO {
- UINT16 Width;
- UINT16 Height;
- INT16 OffsetX;
- INT16 OffsetY;
- INT16 AdvanceX;
-} EFI_HII_GLYPH_INFO;
-
-typedef struct _EFI_HII_FONT_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT32 HdrSize;
- UINT32 GlyphBlockOffset;
- EFI_HII_GLYPH_INFO Cell;
- EFI_HII_FONT_STYLE FontStyle;
- CHAR16 FontFamily[1];
-} EFI_HII_FONT_PACKAGE_HDR;
-
-#define EFI_HII_GIBT_END 0x00
-#define EFI_HII_GIBT_GLYPH 0x10
-#define EFI_HII_GIBT_GLYPHS 0x11
-#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12
-#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13
-#define EFI_HII_GIBT_GLYPH_VARIABILITY 0x14
-#define EFI_HII_GIBT_DUPLICATE 0x20
-#define EFI_HII_GIBT_SKIP2 0x21
-#define EFI_HII_GIBT_SKIP1 0x22
-#define EFI_HII_GIBT_DEFAULTS 0x23
-#define EFI_HII_GIBT_EXT1 0x30
-#define EFI_HII_GIBT_EXT2 0x31
-#define EFI_HII_GIBT_EXT4 0x32
-
-typedef struct _EFI_HII_GLYPH_BLOCK {
- UINT8 BlockType;
-} EFI_HII_GLYPH_BLOCK;
-
-typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
-} EFI_HII_GIBT_DEFAULTS_BLOCK;
-
-typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- CHAR16 CharValue;
-} EFI_HII_GIBT_DUPLICATE_BLOCK;
-
-typedef struct _EFI_GLYPH_GIBT_END_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
-} EFI_GLYPH_GIBT_END_BLOCK;
-
-typedef struct _EFI_HII_GIBT_EXT1_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BlockType2;
- UINT8 Length;
-} EFI_HII_GIBT_EXT1_BLOCK;
-
-typedef struct _EFI_HII_GIBT_EXT2_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BlockType2;
- UINT16 Length;
-} EFI_HII_GIBT_EXT2_BLOCK;
-
-typedef struct _EFI_HII_GIBT_EXT4_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BlockType2;
- UINT32 Length;
-} EFI_HII_GIBT_EXT4_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
-} EFI_HII_GIBT_GLYPH_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
- UINT16 Count;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
-} EFI_HII_GIBT_GLYPHS_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
-} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT16 Count;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
-} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
-
-typedef struct _EFI_HII_GIBT_VARIABILITY_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
- UINT8 GlyphPackInBits;
- UINT8 BitmapData [1];
-} EFI_HII_GIBT_VARIABILITY_BLOCK;
-
-typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 SkipCount;
-} EFI_HII_GIBT_SKIP1_BLOCK;
-
-typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT16 SkipCount;
-} EFI_HII_GIBT_SKIP2_BLOCK;
-
-//
-// Device Path Package
-//
-typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {
- EFI_HII_PACKAGE_HEADER Header;
- // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
-} EFI_HII_DEVICE_PATH_PACKAGE;
-
-//
-// GUID Package
-//
-typedef struct _EFI_HII_GUID_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- EFI_GUID Guid;
- // Data per GUID definition may follow
-} EFI_HII_GUID_PACKAGE_HDR;
-
-//
-// String Package
-//
-
-#define UEFI_CONFIG_LANG "x-UEFI"
-#define UEFI_CONFIG_LANG2 "x-i-UEFI"
-
-typedef struct _EFI_HII_STRING_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT32 HdrSize;
- UINT32 StringInfoOffset;
- CHAR16 LanguageWindow[16];
- EFI_STRING_ID LanguageName;
- CHAR8 Language[1];
-} EFI_HII_STRING_PACKAGE_HDR;
-
-typedef struct {
- UINT8 BlockType;
-} EFI_HII_STRING_BLOCK;
-
-#define EFI_HII_SIBT_END 0x00
-#define EFI_HII_SIBT_STRING_SCSU 0x10
-#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11
-#define EFI_HII_SIBT_STRINGS_SCSU 0x12
-#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13
-#define EFI_HII_SIBT_STRING_UCS2 0x14
-#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15
-#define EFI_HII_SIBT_STRINGS_UCS2 0x16
-#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17
-#define EFI_HII_SIBT_DUPLICATE 0x20
-#define EFI_HII_SIBT_SKIP2 0x21
-#define EFI_HII_SIBT_SKIP1 0x22
-#define EFI_HII_SIBT_EXT1 0x30
-#define EFI_HII_SIBT_EXT2 0x31
-#define EFI_HII_SIBT_EXT4 0x32
-#define EFI_HII_SIBT_FONT 0x40
-
-typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- EFI_STRING_ID StringId;
-} EFI_HII_SIBT_DUPLICATE_BLOCK;
-
-typedef struct _EFI_HII_SIBT_END_BLOCK {
- EFI_HII_STRING_BLOCK Header;
-} EFI_HII_SIBT_END_BLOCK;
-
-typedef struct _EFI_HII_SIBT_EXT1_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 BlockType2;
- UINT8 Length;
-} EFI_HII_SIBT_EXT1_BLOCK;
-
-typedef struct _EFI_HII_SIBT_EXT2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 BlockType2;
- UINT16 Length;
-} EFI_HII_SIBT_EXT2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_EXT4_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 BlockType2;
- UINT32 Length;
-} EFI_HII_SIBT_EXT4_BLOCK;
-
-typedef struct _EFI_HII_SIBT_FONT_BLOCK {
- EFI_HII_SIBT_EXT2_BLOCK Header;
- UINT8 FontId;
- UINT16 FontSize;
- EFI_HII_FONT_STYLE FontStyle;
- CHAR16 FontName[1];
-} EFI_HII_SIBT_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 SkipCount;
-} EFI_HII_SIBT_SKIP1_BLOCK;
-
-typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT16 SkipCount;
-} EFI_HII_SIBT_SKIP2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRING_SCSU_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT16 StringCount;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRINGS_SCSU_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- UINT16 StringCount;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRING_UCS2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT16 StringCount;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRINGS_UCS2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- UINT16 StringCount;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;
-
-//
-// Image Packages
-//
-
-typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT32 ImageInfoOffset;
- UINT32 PaletteInfoOffset;
-} EFI_HII_IMAGE_PACKAGE_HDR;
-
-typedef struct _EFI_HII_IMAGE_BLOCK {
- UINT8 BlockType;
-} EFI_HII_IMAGE_BLOCK;
-
-#define EFI_HII_IIBT_END 0x00
-#define EFI_HII_IIBT_IMAGE_1BIT 0x10
-#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11
-#define EFI_HII_IIBT_IMAGE_4BIT 0x12
-#define EFI_HII_IIBT_IMAGE_4BIT_TRANS 0x13
-#define EFI_HII_IIBT_IMAGE_8BIT 0x14
-#define EFI_HII_IIBT_IMAGE_8BIT_TRANS 0x15
-#define EFI_HII_IIBT_IMAGE_24BIT 0x16
-#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
-#define EFI_HII_IIBT_IMAGE_JPEG 0x18
-#define EFI_HII_IIBT_IMAGE_PNG 0x19
-#define EFI_HII_IIBT_DUPLICATE 0x20
-#define EFI_HII_IIBT_SKIP2 0x21
-#define EFI_HII_IIBT_SKIP1 0x22
-#define EFI_HII_IIBT_EXT1 0x30
-#define EFI_HII_IIBT_EXT2 0x31
-#define EFI_HII_IIBT_EXT4 0x32
-
-typedef struct _EFI_HII_IIBT_END_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
-} EFI_HII_IIBT_END_BLOCK;
-
-typedef struct _EFI_HII_IIBT_EXT1_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 BlockType2;
- UINT8 Length;
-} EFI_HII_IIBT_EXT1_BLOCK;
-
-typedef struct _EFI_HII_IIBT_EXT2_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 BlockType2;
- UINT16 Length;
-} EFI_HII_IIBT_EXT2_BLOCK;
-
-typedef struct _EFI_HII_IIBT_EXT4_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 BlockType2;
- UINT32 Length;
-} EFI_HII_IIBT_EXT4_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- UINT8 Data[1];
-} EFI_HII_IIBT_IMAGE_1BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_1BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;
-
-typedef struct _EFI_HII_RGB_PIXEL {
- UINT8 b;
- UINT8 g;
- UINT8 r;
-} EFI_HII_RGB_PIXEL;
-
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- EFI_HII_RGB_PIXEL Bitmap[1];
-} EFI_HII_IIBT_IMAGE_24BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_24BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- UINT8 Data[1];
-} EFI_HII_IIBT_IMAGE_4BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_4BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- UINT8 Data[1];
-} EFI_HII_IIBT_IMAGE_8BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_8BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;
-
-typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- EFI_IMAGE_ID ImageId;
-} EFI_HII_IIBT_DUPLICATE_BLOCK;
-
-typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT32 Size;
- UINT8 Data[1];
-} EFI_HII_IIBT_JPEG_BLOCK;
-
-typedef struct _EFI_HII_IIBT_PNG_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT32 Size;
- UINT8 Data[1];
-} EFI_HII_IIBT_PNG_BLOCK;
-
-typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 SkipCount;
-} EFI_HII_IIBT_SKIP1_BLOCK;
-
-typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT16 SkipCount;
-} EFI_HII_IIBT_SKIP2_BLOCK;
-
-typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
- UINT16 PaletteCount;
-} EFI_HII_IMAGE_PALETTE_INFO_HEADER;
-
-typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
- UINT16 PaletteSize;
- EFI_HII_RGB_PIXEL PaletteValue[1];
-} EFI_HII_IMAGE_PALETTE_INFO;
-
-//
-// Forms Package
-//
-
-typedef struct _EFI_HII_FORM_PACKAGE {
- EFI_HII_PACKAGE_HEADER Header;
- // EFI_IFR_OP_HEADER OpCodeHeader;
- // More op-codes follow
-} EFI_HII_FORM_PACKAGE;
-
-typedef struct {
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
-} EFI_HII_TIME;
-
-typedef struct {
- UINT16 Year;
- UINT8 Month;
- UINT8 Day;
-} EFI_HII_DATE;
-
-typedef struct {
- EFI_QUESTION_ID QuestionId;
- EFI_FORM_ID FormId;
- EFI_GUID FormSetGuid;
- EFI_STRING_ID DevicePath;
-} EFI_HII_REF;
-
-typedef union {
- UINT8 u8;
- UINT16 u16;
- UINT32 u32;
- UINT64 u64;
- BOOLEAN b;
- EFI_HII_TIME time;
- EFI_HII_DATE date;
- EFI_STRING_ID string;
- EFI_HII_REF ref;
-} EFI_IFR_TYPE_VALUE;
-
-#define EFI_IFR_FORM_OP 0x01
-#define EFI_IFR_SUBTITLE_OP 0x02
-#define EFI_IFR_TEXT_OP 0x03
-#define EFI_IFR_IMAGE_OP 0x04
-#define EFI_IFR_ONE_OF_OP 0x05
-#define EFI_IFR_CHECKBOX_OP 0x06
-#define EFI_IFR_NUMERIC_OP 0x07
-#define EFI_IFR_PASSWORD_OP 0x08
-#define EFI_IFR_ONE_OF_OPTION_OP 0x09
-#define EFI_IFR_SUPPRESS_IF_OP 0x0A
-#define EFI_IFR_LOCKED_OP 0x0B
-#define EFI_IFR_ACTION_OP 0x0C
-#define EFI_IFR_RESET_BUTTON_OP 0x0D
-#define EFI_IFR_FORM_SET_OP 0x0E
-#define EFI_IFR_REF_OP 0x0F
-#define EFI_IFR_NO_SUBMIT_IF_OP 0x10
-#define EFI_IFR_INCONSISTENT_IF_OP 0x11
-#define EFI_IFR_EQ_ID_VAL_OP 0x12
-#define EFI_IFR_EQ_ID_ID_OP 0x13
-#define EFI_IFR_EQ_ID_VAL_LIST_OP 0x14
-#define EFI_IFR_AND_OP 0x15
-#define EFI_IFR_OR_OP 0x16
-#define EFI_IFR_NOT_OP 0x17
-#define EFI_IFR_RULE_OP 0x18
-#define EFI_IFR_GRAY_OUT_IF_OP 0x19
-#define EFI_IFR_DATE_OP 0x1A
-#define EFI_IFR_TIME_OP 0x1B
-#define EFI_IFR_STRING_OP 0x1C
-#define EFI_IFR_REFRESH_OP 0x1D
-#define EFI_IFR_DISABLE_IF_OP 0x1E
-#define EFI_IFR_TO_LOWER_OP 0x20
-#define EFI_IFR_TO_UPPER_OP 0x21
-#define EFI_IFR_MAP_OP 0x22
-#define EFI_IFR_ORDERED_LIST_OP 0x23
-#define EFI_IFR_VARSTORE_OP 0x24
-#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
-#define EFI_IFR_VARSTORE_EFI_OP 0x26
-#define EFI_IFR_VARSTORE_DEVICE_OP 0x27
-#define EFI_IFR_VERSION_OP 0x28
-#define EFI_IFR_END_OP 0x29
-#define EFI_IFR_MATCH_OP 0x2A
-#define EFI_IFR_GET_OP 0x2B
-#define EFI_IFR_SET_OP 0x2C
-#define EFI_IFR_READ_OP 0x2D
-#define EFI_IFR_WRITE_OP 0x2E
-#define EFI_IFR_EQUAL_OP 0x2F
-#define EFI_IFR_NOT_EQUAL_OP 0x30
-#define EFI_IFR_GREATER_THAN_OP 0x31
-#define EFI_IFR_GREATER_EQUAL_OP 0x32
-#define EFI_IFR_LESS_THAN_OP 0x33
-#define EFI_IFR_LESS_EQUAL_OP 0x34
-#define EFI_IFR_BITWISE_AND_OP 0x35
-#define EFI_IFR_BITWISE_OR_OP 0x36
-#define EFI_IFR_BITWISE_NOT_OP 0x37
-#define EFI_IFR_SHIFT_LEFT_OP 0x38
-#define EFI_IFR_SHIFT_RIGHT_OP 0x39
-#define EFI_IFR_ADD_OP 0x3A
-#define EFI_IFR_SUBTRACT_OP 0x3B
-#define EFI_IFR_MULTIPLY_OP 0x3C
-#define EFI_IFR_DIVIDE_OP 0x3D
-#define EFI_IFR_MODULO_OP 0x3E
-#define EFI_IFR_RULE_REF_OP 0x3F
-#define EFI_IFR_QUESTION_REF1_OP 0x40
-#define EFI_IFR_QUESTION_REF2_OP 0x41
-#define EFI_IFR_UINT8_OP 0x42
-#define EFI_IFR_UINT16_OP 0x43
-#define EFI_IFR_UINT32_OP 0x44
-#define EFI_IFR_UINT64_OP 0x45
-#define EFI_IFR_TRUE_OP 0x46
-#define EFI_IFR_FALSE_OP 0x47
-#define EFI_IFR_TO_UINT_OP 0x48
-#define EFI_IFR_TO_STRING_OP 0x49
-#define EFI_IFR_TO_BOOLEAN_OP 0x4A
-#define EFI_IFR_MID_OP 0x4B
-#define EFI_IFR_FIND_OP 0x4C
-#define EFI_IFR_TOKEN_OP 0x4D
-#define EFI_IFR_STRING_REF1_OP 0x4E
-#define EFI_IFR_STRING_REF2_OP 0x4F
-#define EFI_IFR_CONDITIONAL_OP 0x50
-#define EFI_IFR_QUESTION_REF3_OP 0x51
-#define EFI_IFR_ZERO_OP 0x52
-#define EFI_IFR_ONE_OP 0x53
-#define EFI_IFR_ONES_OP 0x54
-#define EFI_IFR_UNDEFINED_OP 0x55
-#define EFI_IFR_LENGTH_OP 0x56
-#define EFI_IFR_DUP_OP 0x57
-#define EFI_IFR_THIS_OP 0x58
-#define EFI_IFR_SPAN_OP 0x59
-#define EFI_IFR_VALUE_OP 0x5A
-#define EFI_IFR_DEFAULT_OP 0x5B
-#define EFI_IFR_DEFAULTSTORE_OP 0x5C
-#define EFI_IFR_FORM_MAP_OP 0x5D
-#define EFI_IFR_CATENATE_OP 0x5E
-#define EFI_IFR_GUID_OP 0x5F
-#define EFI_IFR_SECURITY_OP 0x60
-#define EFI_IFR_MODAL_TAG_OP 0x61
-#define EFI_IFR_REFRESH_ID_OP 0x62
-#define EFI_IFR_WARNING_IF_OP 0x63
-#define EFI_IFR_MATCH2_OP 0x64
-
-
-typedef struct _EFI_IFR_OP_HEADER {
- UINT8 OpCode;
- UINT8 Length:7;
- UINT8 Scope:1;
-} EFI_IFR_OP_HEADER;
-
-typedef struct _EFI_IFR_STATEMENT_HEADER {
- EFI_STRING_ID Prompt;
- EFI_STRING_ID Help;
-} EFI_IFR_STATEMENT_HEADER;
-
-typedef struct _EFI_IFR_QUESTION_HEADER {
- EFI_IFR_STATEMENT_HEADER Header;
- EFI_QUESTION_ID QuestionId;
- EFI_VARSTORE_ID VarStoreId;
- union {
- EFI_STRING_ID VarName;
- UINT16 VarOffset;
- } VarStoreInfo;
- UINT8 Flags;
-} EFI_IFR_QUESTION_HEADER;
-
-#define EFI_IFR_FLAG_READ_ONLY 0x01
-#define EFI_IFR_FLAG_CALLBACK 0x04
-#define EFI_IFR_FLAG_RESET_REQUIRED 0x10
-#define EFI_IFR_FLAG_REST_STYLE 0x20
-#define EFI_IFR_FLAG_RECONNECT_REQUIRED 0x40
-#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80
-
-typedef struct _EFI_IFR_DEFAULTSTORE {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DefaultName;
- UINT16 DefaultId;
-} EFI_IFR_DEFAULTSTORE;
-
-#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000
-#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001
-#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002
-#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000
-#define EFI_HII_DEFAULT_CLASS_PLATFORM_END 0x7fff
-#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000
-#define EFI_HII_DEFAULT_CLASS_HARDWARE_END 0xbfff
-#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000
-#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END 0xffff
-
-typedef struct _EFI_IFR_VARSTORE {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID Guid;
- EFI_VARSTORE_ID VarStoreId;
- UINT16 Size;
- UINT8 Name[1];
-} EFI_IFR_VARSTORE;
-
-typedef struct _EFI_IFR_VARSTORE_EFI {
- EFI_IFR_OP_HEADER Header;
- EFI_VARSTORE_ID VarStoreId;
- EFI_GUID Guid;
- UINT32 Attributes;
- UINT16 Size;
- UINT8 Name[1];
-} EFI_IFR_VARSTORE_EFI;
-
-typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
- EFI_IFR_OP_HEADER Header;
- EFI_VARSTORE_ID VarStoreId;
- EFI_GUID Guid;
-} EFI_IFR_VARSTORE_NAME_VALUE;
-
-typedef struct _EFI_IFR_FORM_SET {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID Guid;
- EFI_STRING_ID FormSetTitle;
- EFI_STRING_ID Help;
- UINT8 Flags;
- // EFI_GUID ClassGuid[];
-} EFI_IFR_FORM_SET;
-
-typedef struct _EFI_IFR_END {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_END;
-
-typedef struct _EFI_IFR_FORM {
- EFI_IFR_OP_HEADER Header;
- UINT16 FormId;
- EFI_STRING_ID FormTitle;
-} EFI_IFR_FORM;
-
-typedef struct _EFI_IFR_IMAGE {
- EFI_IFR_OP_HEADER Header;
- EFI_IMAGE_ID Id;
-} EFI_IFR_IMAGE;
-
-typedef struct _EFI_IFR_MODAL_TAG {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MODAL_TAG;
-
-typedef struct _EFI_IFR_LOCKED {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LOCKED;
-
-typedef struct _EFI_IFR_RULE {
- EFI_IFR_OP_HEADER Header;
- UINT8 RuleId;
-} EFI_IFR_RULE;
-
-typedef struct _EFI_IFR_DEFAULT {
- EFI_IFR_OP_HEADER Header;
- UINT16 DefaultId;
- UINT8 Type;
- EFI_IFR_TYPE_VALUE Value;
-} EFI_IFR_DEFAULT;
-
-typedef struct _EFI_IFR_DEFAULT_2 {
- EFI_IFR_OP_HEADER Header;
- UINT16 DefaultId;
- UINT8 Type;
-} EFI_IFR_DEFAULT_2;
-
-typedef struct _EFI_IFR_VALUE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_VALUE;
-
-typedef struct _EFI_IFR_SUBTITLE {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_STATEMENT_HEADER Statement;
- UINT8 Flags;
-} EFI_IFR_SUBTITLE;
-
-#define EFI_IFR_FLAGS_HORIZONTAL 0x01
-
-typedef struct _EFI_IFR_CHECKBOX {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
-} EFI_IFR_CHECKBOX;
-
-#define EFI_IFR_CHECKBOX_DEFAULT 0x01
-#define EFI_IFR_CHECKBOX_DEFAULT_MFG 0x02
-
-typedef struct _EFI_IFR_TEXT {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_STATEMENT_HEADER Statement;
- EFI_STRING_ID TextTwo;
-} EFI_IFR_TEXT;
-
-typedef struct _EFI_IFR_REF {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
-} EFI_IFR_REF;
-
-typedef struct _EFI_IFR_REF2 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
- EFI_QUESTION_ID QuestionId;
-} EFI_IFR_REF2;
-
-typedef struct _EFI_IFR_REF3 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
- EFI_QUESTION_ID QuestionId;
- EFI_GUID FormSetId;
-} EFI_IFR_REF3;
-
-typedef struct _EFI_IFR_REF4 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
- EFI_QUESTION_ID QuestionId;
- EFI_GUID FormSetId;
- EFI_STRING_ID DevicePath;
-} EFI_IFR_REF4;
-
-typedef struct _EFI_IFR_REF5 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
-} EFI_IFR_REF5;
-
-typedef struct _EFI_IFR_RESET_BUTTON {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_STATEMENT_HEADER Statement;
- EFI_DEFAULT_ID DefaultId;
-} EFI_IFR_RESET_BUTTON;
-
-typedef struct _EFI_IFR_ACTION {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_STRING_ID QuestionConfig;
-} EFI_IFR_ACTION;
-
-typedef struct _EFI_IFR_ACTION_1 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
-} EFI_IFR_ACTION_1;
-
-typedef struct _EFI_IFR_DATE {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
-} EFI_IFR_DATE;
-
-#define EFI_QF_DATE_YEAR_SUPPRESS 0x01
-#define EFI_QF_DATE_MONTH_SUPPRESS 0x02
-#define EFI_QF_DATE_DAY_SUPPRESS 0x04
-
-#define EFI_QF_DATE_STORAGE 0x30
-#define QF_DATE_STORAGE_NORMAL 0x00
-#define QF_DATE_STORAGE_TIME 0x10
-#define QF_DATE_STORAGE_WAKEUP 0x20
-
-typedef union {
- struct {
- UINT8 MinValue;
- UINT8 MaxValue;
- UINT8 Step;
- } u8;
- struct {
- UINT16 MinValue;
- UINT16 MaxValue;
- UINT16 Step;
- } u16;
- struct {
- UINT32 MinValue;
- UINT32 MaxValue;
- UINT32 Step;
- } u32;
- struct {
- UINT64 MinValue;
- UINT64 MaxValue;
- UINT64 Step;
- } u64;
-} MINMAXSTEP_DATA;
-
-typedef struct _EFI_IFR_NUMERIC {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
- MINMAXSTEP_DATA data;
-} EFI_IFR_NUMERIC;
-
-#define EFI_IFR_NUMERIC_SIZE 0x03
-#define EFI_IFR_NUMERIC_SIZE_1 0x00
-#define EFI_IFR_NUMERIC_SIZE_2 0x01
-#define EFI_IFR_NUMERIC_SIZE_4 0x02
-#define EFI_IFR_NUMERIC_SIZE_8 0x03
-
-#define EFI_IFR_DISPLAY 0x30
-#define EFI_IFR_DISPLAY_INT_DEC 0x00
-#define EFI_IFR_DISPLAY_UINT_DEC 0x10
-#define EFI_IFR_DISPLAY_UINT_HEX 0x20
-
-typedef struct _EFI_IFR_ONE_OF {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
- MINMAXSTEP_DATA data;
-} EFI_IFR_ONE_OF;
-
-typedef struct _EFI_IFR_STRING {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 MinSize;
- UINT8 MaxSize;
- UINT8 Flags;
-} EFI_IFR_STRING;
-
-#define EFI_IFR_STRING_MULTI_LINE 0x01
-
-typedef struct _EFI_IFR_PASSWORD {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT16 MinSize;
- UINT16 MaxSize;
-} EFI_IFR_PASSWORD;
-
-typedef struct _EFI_IFR_ORDERED_LIST {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 MaxContainers;
- UINT8 Flags;
-} EFI_IFR_ORDERED_LIST;
-
-#define EFI_IFR_UNIQUE_SET 0x01
-#define EFI_IFR_NO_EMPTY_SET 0x02
-
-typedef struct _EFI_IFR_TIME {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
-} EFI_IFR_TIME;
-
-#define QF_TIME_HOUR_SUPPRESS 0x01
-#define QF_TIME_MINUTE_SUPPRESS 0x02
-#define QF_TIME_SECOND_SUPPRESS 0x04
-
-#define QF_TIME_STORAGE 0x30
-#define QF_TIME_STORAGE_NORMAL 0x00
-#define QF_TIME_STORAGE_TIME 0x10
-#define QF_TIME_STORAGE_WAKEUP 0x20
-
-typedef struct _EFI_IFR_DISABLE_IF {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_DISABLE_IF;
-
-typedef struct _EFI_IFR_SUPPRESS_IF {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SUPPRESS_IF;
-
-typedef struct _EFI_IFR_GRAY_OUT_IF {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_GRAY_OUT_IF;
-
-typedef struct _EFI_IFR_INCONSISTENT_IF {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Error;
-} EFI_IFR_INCONSISTENT_IF;
-
-typedef struct _EFI_IFR_NO_SUBMIT_IF {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Error;
-} EFI_IFR_NO_SUBMIT_IF;
-
-typedef struct _EFI_IFR_WARNING_IF {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Warning;
- UINT8 TimeOut;
-} EFI_IFR_WARNING_IF;
-
-typedef struct _EFI_IFR_REFRESH {
- EFI_IFR_OP_HEADER Header;
- UINT8 RefreshInterval;
-} EFI_IFR_REFRESH;
-
-typedef struct _EFI_IFR_REFRESH_ID {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID RefreshEventGroupId;
-} EFI_IFR_REFRESH_ID;
-
-typedef struct _EFI_IFR_VARSTORE_DEVICE {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DevicePath;
-} EFI_IFR_VARSTORE_DEVICE;
-
-typedef struct _EFI_IFR_ONE_OF_OPTION {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Option;
- UINT8 Flags;
- UINT8 Type;
- EFI_IFR_TYPE_VALUE Value;
-} EFI_IFR_ONE_OF_OPTION;
-
-#define EFI_IFR_TYPE_NUM_SIZE_8 0x00
-#define EFI_IFR_TYPE_NUM_SIZE_16 0x01
-#define EFI_IFR_TYPE_NUM_SIZE_32 0x02
-#define EFI_IFR_TYPE_NUM_SIZE_64 0x03
-#define EFI_IFR_TYPE_BOOLEAN 0x04
-#define EFI_IFR_TYPE_TIME 0x05
-#define EFI_IFR_TYPE_DATE 0x06
-#define EFI_IFR_TYPE_STRING 0x07
-#define EFI_IFR_TYPE_OTHER 0x08
-#define EFI_IFR_TYPE_UNDEFINED 0x09
-#define EFI_IFR_TYPE_ACTION 0x0A
-#define EFI_IFR_TYPE_BUFFER 0x0B
-#define EFI_IFR_TYPE_REF 0x0C
-
-#define EFI_IFR_OPTION_DEFAULT 0x10
-#define EFI_IFR_OPTION_DEFAULT_MFG 0x20
-
-typedef struct _EFI_IFR_GUID {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID Guid;
- //Optional Data Follows
-} EFI_IFR_GUID;
-
-typedef struct _EFI_IFR_DUP {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_DUP;
-
-typedef struct _EFI_IFR_EQ_ID_ID {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId1;
- EFI_QUESTION_ID QuestionId2;
-} EFI_IFR_EQ_ID_ID;
-
-typedef struct _EFI_IFR_EQ_ID_VAL {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
- UINT16 Value;
-} EFI_IFR_EQ_ID_VAL;
-
-typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
- UINT16 ListLength;
- UINT16 ValueList[1];
-} EFI_IFR_EQ_ID_VAL_LIST;
-
-typedef struct _EFI_IFR_QUESTION_REF1 {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
-} EFI_IFR_QUESTION_REF1;
-
-typedef struct _EFI_IFR_UINT8 {
- EFI_IFR_OP_HEADER Header;
- UINT8 Value;
-} EFI_IFR_UINT8;
-
-typedef struct _EFI_IFR_UINT16 {
- EFI_IFR_OP_HEADER Header;
- UINT16 Value;
-} EFI_IFR_UINT16;
-
-typedef struct _EFI_IFR_QUESTION_REF2 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_QUESTION_REF2;
-
-typedef struct _EFI_IFR_UINT32 {
- EFI_IFR_OP_HEADER Header;
- UINT32 Value;
-} EFI_IFR_UINT32;
-
-typedef struct _EFI_IFR_UINT64 {
- EFI_IFR_OP_HEADER Header;
- UINT64 Value;
-} EFI_IFR_UINT64;
-
-typedef struct _EFI_IFR_QUESTION_REF3 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_QUESTION_REF3;
-
-typedef struct _EFI_IFR_QUESTION_REF3_2 {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DevicePath;
-} EFI_IFR_QUESTION_REF3_2;
-
-typedef struct _EFI_IFR_QUESTION_REF3_3 {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DevicePath;
- EFI_GUID Guid;
-} EFI_IFR_QUESTION_REF3_3;
-
-typedef struct _EFI_IFR_RULE_REF {
- EFI_IFR_OP_HEADER Header;
- UINT8 RuleId;
-} EFI_IFR_RULE_REF;
-
-typedef struct _EFI_IFR_STRING_REF1 {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID StringId;
-} EFI_IFR_STRING_REF1;
-
-typedef struct _EFI_IFR_STRING_REF2 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_STRING_REF2;
-
-typedef struct _EFI_IFR_THIS {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_THIS;
-
-typedef struct _EFI_IFR_TRUE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TRUE;
-
-typedef struct _EFI_IFR_FALSE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_FALSE;
-
-typedef struct _EFI_IFR_ONE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ONE;
-
-typedef struct _EFI_IFR_ONES {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ONES;
-
-typedef struct _EFI_IFR_ZERO {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ZERO;
-
-typedef struct _EFI_IFR_UNDEFINED {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_UNDEFINED;
-
-typedef struct _EFI_IFR_VERSION {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_VERSION;
-
-typedef struct _EFI_IFR_LENGTH {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LENGTH;
-
-typedef struct _EFI_IFR_NOT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_NOT;
-
-typedef struct _EFI_IFR_BITWISE_NOT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_BITWISE_NOT;
-
-typedef struct _EFI_IFR_TO_BOOLEAN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_BOOLEAN;
-
-#define EFI_IFR_STRING_UNSIGNED_DEC 0
-#define EFI_IFR_STRING_SIGNED_DEC 1
-#define EFI_IFR_STRING_LOWERCASE_HEX 2
-#define EFI_IFR_STRING_UPPERCASE_HEX 3
-
-#define EFI_IFR_STRING_ASCII 0
-#define EFI_IFR_STRING_UNICODE 8
-
-typedef struct _EFI_IFR_TO_STRING {
- EFI_IFR_OP_HEADER Header;
- UINT8 Format;
-} EFI_IFR_TO_STRING;
-
-typedef struct _EFI_IFR_TO_UINT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_UINT;
-
-typedef struct _EFI_IFR_TO_UPPER {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_UPPER;
-
-typedef struct _EFI_IFR_TO_LOWER {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_LOWER;
-
-typedef struct _EFI_IFR_ADD {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ADD;
-
-typedef struct _EFI_IFR_AND {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_AND;
-
-typedef struct _EFI_IFR_BITWISE_AND {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_BITWISE_AND;
-
-typedef struct _EFI_IFR_BITWISE_OR {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_BITWISE_OR;
-
-typedef struct _EFI_IFR_CATENATE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_CATENATE;
-
-typedef struct _EFI_IFR_DIVIDE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_DIVIDE;
-
-typedef struct _EFI_IFR_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_EQUAL;
-
-typedef struct _EFI_IFR_GREATER_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_GREATER_EQUAL;
-
-typedef struct _EFI_IFR_GREATER_THAN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_GREATER_THAN;
-
-typedef struct _EFI_IFR_LESS_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LESS_EQUAL;
-
-typedef struct _EFI_IFR_LESS_THAN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LESS_THAN;
-
-typedef struct _EFI_IFR_MATCH {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MATCH;
-
-typedef struct _EFI_IFR_MATCH2 {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID SyntaxType;
-} EFI_IFR_MATCH2;
-
-typedef struct _EFI_IFR_MULTIPLY {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MULTIPLY;
-
-typedef struct _EFI_IFR_MODULO {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MODULO;
-
-typedef struct _EFI_IFR_NOT_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_NOT_EQUAL;
-
-typedef struct _EFI_IFR_OR {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_OR;
-
-typedef struct _EFI_IFR_SHIFT_LEFT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SHIFT_LEFT;
-
-typedef struct _EFI_IFR_SHIFT_RIGHT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SHIFT_RIGHT;
-
-typedef struct _EFI_IFR_SUBTRACT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SUBTRACT;
-
-typedef struct _EFI_IFR_CONDITIONAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_CONDITIONAL;
-
-#define EFI_IFR_FF_CASE_SENSITIVE 0x00
-#define EFI_IFR_FF_CASE_INSENSITIVE 0x01
-
-typedef struct _EFI_IFR_FIND {
- EFI_IFR_OP_HEADER Header;
- UINT8 Format;
-} EFI_IFR_FIND;
-
-typedef struct _EFI_IFR_MID {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MID;
-
-typedef struct _EFI_IFR_TOKEN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TOKEN;
-
-#define EFI_IFR_FLAGS_FIRST_MATCHING 0x00
-#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
-
-typedef struct _EFI_IFR_SPAN {
- EFI_IFR_OP_HEADER Header;
- UINT8 Flags;
-} EFI_IFR_SPAN;
-
-typedef struct _EFI_IFR_SECURITY {
- ///
- /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// Security permission level.
- ///
- EFI_GUID Permissions;
-} EFI_IFR_SECURITY;
-
-typedef struct _EFI_IFR_FORM_MAP_METHOD {
- ///
- /// The string identifier which provides the human-readable name of
- /// the configuration method for this standards map form.
- ///
- EFI_STRING_ID MethodTitle;
- ///
- /// Identifier which uniquely specifies the configuration methods
- /// associated with this standards map form.
- ///
- EFI_GUID MethodIdentifier;
-} EFI_IFR_FORM_MAP_METHOD;
-
-typedef struct _EFI_IFR_FORM_MAP {
- ///
- /// The sequence that defines the type of opcode as well as the length
- /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// The unique identifier for this particular form.
- ///
- EFI_FORM_ID FormId;
- ///
- /// One or more configuration method's name and unique identifier.
- ///
- // EFI_IFR_FORM_MAP_METHOD Methods[];
-} EFI_IFR_FORM_MAP;
-
-typedef struct _EFI_IFR_SET {
- ///
- /// The sequence that defines the type of opcode as well as the length
- /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// Specifies the identifier of a previously declared variable store to
- /// use when storing the question's value.
- ///
- EFI_VARSTORE_ID VarStoreId;
- union {
- ///
- /// A 16-bit Buffer Storage offset.
- ///
- EFI_STRING_ID VarName;
- ///
- /// A Name Value or EFI Variable name (VarName).
- ///
- UINT16 VarOffset;
- } VarStoreInfo;
- ///
- /// Specifies the type used for storage.
- ///
- UINT8 VarStoreType;
-} EFI_IFR_SET;
-
-typedef struct _EFI_IFR_GET {
- ///
- /// The sequence that defines the type of opcode as well as the length
- /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// Specifies the identifier of a previously declared variable store to
- /// use when retrieving the value.
- ///
- EFI_VARSTORE_ID VarStoreId;
- union {
- ///
- /// A 16-bit Buffer Storage offset.
- ///
- EFI_STRING_ID VarName;
- ///
- /// A Name Value or EFI Variable name (VarName).
- ///
- UINT16 VarOffset;
- } VarStoreInfo;
- ///
- /// Specifies the type used for storage.
- ///
- UINT8 VarStoreType;
-} EFI_IFR_GET;
-
-typedef struct _EFI_IFR_READ {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_READ;
-
-typedef struct _EFI_IFR_WRITE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_WRITE;
-
-typedef struct _EFI_IFR_MAP {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MAP;
-//
-// Keyboard Package
-//
-
-typedef enum {
- EfiKeyLCtrl,
- EfiKeyA0,
- EfiKeyLAlt,
- EfiKeySpaceBar,
- EfiKeyA2,
- EfiKeyA3,
- EfiKeyA4,
- EfiKeyRCtrl,
- EfiKeyLeftArrow,
- EfiKeyDownArrow,
- EfiKeyRightArrow,
- EfiKeyZero,
- EfiKeyPeriod,
- EfiKeyEnter,
- EfiKeyLShift,
- EfiKeyB0,
- EfiKeyB1,
- EfiKeyB2,
- EfiKeyB3,
- EfiKeyB4,
- EfiKeyB5,
- EfiKeyB6,
- EfiKeyB7,
- EfiKeyB8,
- EfiKeyB9,
- EfiKeyB10,
- EfiKeyRshift,
- EfiKeyUpArrow,
- EfiKeyOne,
- EfiKeyTwo,
- EfiKeyThree,
- EfiKeyCapsLock,
- EfiKeyC1,
- EfiKeyC2,
- EfiKeyC3,
- EfiKeyC4,
- EfiKeyC5,
- EfiKeyC6,
- EfiKeyC7,
- EfiKeyC8,
- EfiKeyC9,
- EfiKeyC10,
- EfiKeyC11,
- EfiKeyC12,
- EfiKeyFour,
- EfiKeyFive,
- EfiKeySix,
- EfiKeyPlus,
- EfiKeyTab,
- EfiKeyD1,
- EfiKeyD2,
- EfiKeyD3,
- EfiKeyD4,
- EfiKeyD5,
- EfiKeyD6,
- EfiKeyD7,
- EfiKeyD8,
- EfiKeyD9,
- EfiKeyD10,
- EfiKeyD11,
- EfiKeyD12,
- EfiKeyD13,
- EfiKeyDel,
- EfiKeyEnd,
- EfiKeyPgDn,
- EfiKeySeven,
- EfiKeyEight,
- EfiKeyNine,
- EfiKeyE0,
- EfiKeyE1,
- EfiKeyE2,
- EfiKeyE3,
- EfiKeyE4,
- EfiKeyE5,
- EfiKeyE6,
- EfiKeyE7,
- EfiKeyE8,
- EfiKeyE9,
- EfiKeyE10,
- EfiKeyE11,
- EfiKeyE12,
- EfiKeyBackSpace,
- EfiKeyIns,
- EfiKeyHome,
- EfiKeyPgUp,
- EfiKeyNLck,
- EfiKeySlash,
- EfiKeyAsterisk,
- EfiKeyMinus,
- EfiKeyEsc,
- EfiKeyF1,
- EfiKeyF2,
- EfiKeyF3,
- EfiKeyF4,
- EfiKeyF5,
- EfiKeyF6,
- EfiKeyF7,
- EfiKeyF8,
- EfiKeyF9,
- EfiKeyF10,
- EfiKeyF11,
- EfiKeyF12,
- EfiKeyPrint,
- EfiKeySLck,
- EfiKeyPause
-} EFI_KEY;
-
-typedef struct {
- EFI_KEY Key;
- CHAR16 Unicode;
- CHAR16 ShiftedUnicode;
- CHAR16 AltGrUnicode;
- CHAR16 ShiftedAltGrUnicode;
- UINT16 Modifier;
- UINT16 AffectedAttribute;
-} EFI_KEY_DESCRIPTOR;
-
-//
-// A key which is affected by all the standard shift modifiers.
-// Most keys would be expected to have this bit active.
-//
-#define EFI_AFFECTED_BY_STANDARD_SHIFT 0x0001
-//
-// This key is affected by the caps lock so that if a keyboard driver
-// would need to disambiguate between a key which had a "1" defined
-// versus a "a" character. Having this bit turned on would tell
-// the keyboard driver to use the appropriate shifted state or not.
-//
-#define EFI_AFFECTED_BY_CAPS_LOCK 0x0002
-//
-// Similar to the case of CAPS lock, if this bit is active, the key
-// is affected by the num lock being turned on.
-//
-#define EFI_AFFECTED_BY_NUM_LOCK 0x0004
-
-typedef struct {
- UINT16 LayoutLength;
- EFI_GUID Guid;
- UINT32 LayoutDescriptorStringOffset;
- UINT8 DescriptorCount;
- // EFI_KEY_DESCRIPTOR Descriptors[];
-} EFI_HII_KEYBOARD_LAYOUT;
-
-typedef struct {
- EFI_HII_PACKAGE_HEADER Header;
- UINT16 LayoutCount;
- // EFI_HII_KEYBOARD_LAYOUT Layout[];
-} EFI_HII_KEYBOARD_PACKAGE_HDR;
-
-typedef struct {
- CHAR16 Language[3];
- CHAR16 Space;
- CHAR16 DescriptionString[1];
-} EFI_DESCRIPTION_STRING;
-
-typedef struct {
- UINT16 DescriptionCount;
- EFI_DESCRIPTION_STRING DescriptionString[1];
-} EFI_DESCRIPTION_STRING_BUNDLE;
-
-//
-// Modifier values
-//
-#define EFI_NULL_MODIFIER 0x0000
-#define EFI_LEFT_CONTROL_MODIFIER 0x0001
-#define EFI_RIGHT_CONTROL_MODIFIER 0x0002
-#define EFI_LEFT_ALT_MODIFIER 0x0003
-#define EFI_RIGHT_ALT_MODIFIER 0x0004
-#define EFI_ALT_GR_MODIFIER 0x0005
-#define EFI_INSERT_MODIFIER 0x0006
-#define EFI_DELETE_MODIFIER 0x0007
-#define EFI_PAGE_DOWN_MODIFIER 0x0008
-#define EFI_PAGE_UP_MODIFIER 0x0009
-#define EFI_HOME_MODIFIER 0x000A
-#define EFI_END_MODIFIER 0x000B
-#define EFI_LEFT_SHIFT_MODIFIER 0x000C
-#define EFI_RIGHT_SHIFT_MODIFIER 0x000D
-#define EFI_CAPS_LOCK_MODIFIER 0x000E
-#define EFI_NUM_LOCK _MODIFIER 0x000F
-#define EFI_LEFT_ARROW_MODIFIER 0x0010
-#define EFI_RIGHT_ARROW_MODIFIER 0x0011
-#define EFI_DOWN_ARROW_MODIFIER 0x0012
-#define EFI_UP_ARROW_MODIFIER 0x0013
-#define EFI_NS_KEY_MODIFIER 0x0014
-#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015
-#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016
-#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017
-#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018
-#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019
-#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A
-#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B
-#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C
-#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D
-#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E
-#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F
-#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
-#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
-
-//
-// Keys that have multiple control functions based on modifier
-// settings are handled in the keyboard driver implementation.
-// For instance PRINT_KEY might have a modifier held down and
-// is still a nonprinting character, but might have an alternate
-// control function like SYSREQUEST
-//
-#define EFI_PRINT_MODIFIER 0x0022
-#define EFI_SYS_REQUEST_MODIFIER 0x0023
-#define EFI_SCROLL_LOCK_MODIFIER 0x0024
-#define EFI_PAUSE_MODIFIER 0x0025
-#define EFI_BREAK_MODIFIER 0x0026
-
-#pragma pack()
-
-
-
-//
-// References to string tokens must use this macro to enable scanning for
-// token usages.
-//
-//
-// STRING_TOKEN is not defined in UEFI specification. But it is placed
-// here for the easy access by C files and VFR source files.
-//
-#define STRING_TOKEN(t) t
+#define EFI_HII_PACKAGE_FORM EFI_HII_PACKAGE_FORMS
#endif
diff --git a/BaseTools/Source/C/Include/Common/UefiMultiPhase.h b/BaseTools/Source/C/Include/Common/UefiMultiPhase.h
deleted file mode 100644
index b889508b85..0000000000
--- a/BaseTools/Source/C/Include/Common/UefiMultiPhase.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/** @file
- This includes some definitions introduced in UEFI that will be used in both PEI
- and DXE phases.
-
- (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UEFI_MULTIPHASE_H__
-#define __UEFI_MULTIPHASE_H__
-
-//
-// Enumeration of memory types introduced in UEFI.
-//
-typedef enum {
- EfiReservedMemoryType,
- EfiLoaderCode,
- EfiLoaderData,
- EfiBootServicesCode,
- EfiBootServicesData,
- EfiRuntimeServicesCode,
- EfiRuntimeServicesData,
- EfiConventionalMemory,
- EfiUnusableMemory,
- EfiACPIReclaimMemory,
- EfiACPIMemoryNVS,
- EfiMemoryMappedIO,
- EfiMemoryMappedIOPortSpace,
- EfiPalCode,
- EfiPersistentMemory,
- EfiMaxMemoryType
-} EFI_MEMORY_TYPE;
-
-
-//
-// Data structure that precedes all of the standard EFI table types.
-//
-typedef struct {
- UINT64 Signature;
- UINT32 Revision;
- UINT32 HeaderSize;
- UINT32 CRC32;
- UINT32 Reserved;
-} EFI_TABLE_HEADER;
-
-//
-// Attributes of variable.
-//
-#define EFI_VARIABLE_NON_VOLATILE 0x00000001
-#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
-#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
-#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
-
-//
-// This attribute is identified by the mnemonic 'HR'
-// elsewhere in this specification.
-//
-#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
-
-
-
-//
-// _WIN_CERTIFICATE.wCertificateType
-//
-#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
-#define WIN_CERT_TYPE_EFI_GUID 0x0EF1
-
-/**
-
- The WIN_CERTIFICATE structure is part of the PE/COFF
- specification and has the following definition:
-
- @param dwLength The length of the entire certificate,
- including the length of the header, in
- bytes.
-
- @param wRevision The revision level of the WIN_CERTIFICATE
- structure. The current revision level is
- 0x0200.
-
- @param wCertificateType The certificate type. See
- WIN_CERT_TYPE_xxx for the UEFI
- certificate types. The UEFI
- specification reserves the range of
- certificate type values from 0x0EF0
- to 0x0EFF.
-
- @param bCertificate The actual certificate. The format of
- the certificate depends on
- wCertificateType. The format of the UEFI
- certificates is defined below.
-
-
-**/
-typedef struct _WIN_CERTIFICATE {
- UINT32 dwLength;
- UINT16 wRevision;
- UINT16 wCertificateType;
- //UINT8 bCertificate[ANYSIZE_ARRAY];
-} WIN_CERTIFICATE;
-
-//
-// WIN_CERTIFICATE_UEFI_GUID.CertType
-//
-#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
- {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
-
-//
-// WIN_CERTIFICATE_UEFI_GUID.CertData
-//
-typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
- EFI_GUID HashType;
- UINT8 PublicKey[256];
- UINT8 Signature[256];
-} EFI_CERT_BLOCK_RSA_2048_SHA256;
-
-
-/**
-
- @param Hdr This is the standard WIN_CERTIFICATE header, where
- wCertificateType is set to
- WIN_CERT_TYPE_EFI_GUID.
-
- @param CertType This is the unique id which determines the
- format of the CertData. In this case, the
- value is EFI_CERT_TYPE_RSA2048_SHA256_GUID.
-
- @param CertData This is the certificate data. The format of
- the data is determined by the CertType. In
- this case the value is
- EFI_CERT_BLOCK_RSA_2048_SHA256.
-
- @param Information The WIN_CERTIFICATE_UEFI_GUID certificate
- type allows new types of certificates to
- be developed for driver authentication
- without requiring a new certificate type.
- The CertType defines the format of the
- CertData, which length is defined by the
- size of the certificate less the fixed
- size of the WIN_CERTIFICATE_UEFI_GUID
- structure.
-
-**/
-typedef struct _WIN_CERTIFICATE_UEFI_GUID {
- WIN_CERTIFICATE Hdr;
- EFI_GUID CertType;
- UINT8 CertData[1];
-} WIN_CERTIFICATE_UEFI_GUID;
-
-
-/**
-
- Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital
- signature.
-
- The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
- WIN_CERTIFICATE and encapsulate the information needed to
- implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
- specified in RFC2437.
-
- @param Hdr This is the standard WIN_CERTIFICATE header, where
- wCertificateType is set to
- WIN_CERT_TYPE_UEFI_PKCS1_15.
-
- @param HashAlgorithm This is the hashing algorithm which was
- performed on the UEFI executable when
- creating the digital signature. It is
- one of the enumerated values pre-defined
- in Section 26.4.1. See
- EFI_HASH_ALGORITHM_x.
-
- @param Signature This is the actual digital signature. The
- size of the signature is the same size as
- the key (1024-bit key is 128 bytes) and can
- be determined by subtracting the length of
- the other parts of this header from the
- total length of the certificate as found in
- Hdr.dwLength.
-
-**/
-typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 {
- WIN_CERTIFICATE Hdr;
- EFI_GUID HashAlgorithm;
- // UINT8 Signature[ANYSIZE_ARRAY];
-} WIN_CERTIFICATE_EFI_PKCS1_15;
-
-
-/**
-
- AuthInfo is a WIN_CERTIFICATE using the wCertificateType
- WIN_CERTIFICATE_UEFI_GUID and the CertType
- EFI_CERT_TYPE_RSA2048_SHA256. If the attribute specifies
- authenticated access, then the Data buffer should begin with an
- authentication descriptor prior to the data payload and DataSize
- should reflect the data.and descriptor size. The caller
- shall digest the Monotonic Count value and the associated data
- for the variable update using the SHA-256 1-way hash algorithm.
- The ensuing the 32-byte digest will be signed using the private
- key associated w/ the public/private 2048-bit RSA key-pair. The
- WIN_CERTIFICATE shall be used to describe the signature of the
- Variable data *Data. In addition, the signature will also
- include the MonotonicCount value to guard against replay attacks
-
- @param MonotonicCount Included in the signature of
- AuthInfo.Used to ensure freshness/no
- replay. Incremented during each
- "Write" access.
-
- @param AuthInfo Provides the authorization for the variable
- access. It is a signature across the
- variable data and the Monotonic Count
- value. Caller uses Private key that is
- associated with a public key that has been
- provisioned via the key exchange.
-
-**/
-typedef struct {
- UINT64 MonotonicCount;
- WIN_CERTIFICATE_UEFI_GUID AuthInfo;
-} EFI_VARIABLE_AUTHENTICATION;
-
-#endif
-
diff --git a/BaseTools/Source/C/Include/Common/VariableFormat.h b/BaseTools/Source/C/Include/Common/VariableFormat.h
deleted file mode 100644
index 096db88bc7..0000000000
--- a/BaseTools/Source/C/Include/Common/VariableFormat.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**@file
- Header file for EFI Variable Services.
-
- Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __VARIABLE_FORMAT_H__
-#define __VARIABLE_FORMAT_H__
-
-#define VARIABLE_DATA 0x55AA
-
-//
-// Variable Store Header flags
-//
-#define VARIABLE_STORE_FORMATTED 0x5a
-#define VARIABLE_STORE_HEALTHY 0xfe
-
-#pragma pack(1)
-
-typedef struct {
- EFI_GUID Signature;
- UINT32 Size;
- UINT8 Format;
- UINT8 State;
- UINT16 Reserved;
- UINT32 Reserved1;
-} VARIABLE_STORE_HEADER;
-
-typedef struct {
- UINT16 StartId;
- UINT8 State;
- UINT8 Reserved;
- UINT32 Attributes;
- UINT32 NameSize;
- UINT32 DataSize;
- EFI_GUID VendorGuid;
-} VARIABLE_HEADER;
-
-#pragma pack()
-
-#endif // _EFI_VARIABLE_H_
diff --git a/BaseTools/Source/C/Include/Common/WorkingBlockHeader.h b/BaseTools/Source/C/Include/Common/WorkingBlockHeader.h
deleted file mode 100644
index a1b77dd3e8..0000000000
--- a/BaseTools/Source/C/Include/Common/WorkingBlockHeader.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- Defines data structure that is the headers found at the runtime
- updatable firmware volumes, such as the FileSystemGuid of the
- working block, the header structure of the variable block, FTW
- working block, or event log block.
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __EFI_WORKING_BLOCK_HEADER_H__
-#define __EFI_WORKING_BLOCK_HEADER_H__
-
-//
-// EFI Fault tolerant working block header
-// The header is immediately followed by the write queue.
-//
-typedef struct {
- EFI_GUID Signature;
- UINT32 Crc;
- UINT8 WorkingBlockValid : 1;
- UINT8 WorkingBlockInvalid : 1;
-#define WORKING_BLOCK_VALID 0x1
-#define WORKING_BLOCK_INVALID 0x2
- UINT8 Reserved : 6;
- UINT8 Reserved3[3];
- UINT64 WriteQueueSize;
- //
- // UINT8 WriteQueue[WriteQueueSize];
- //
-} EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Guid/PcAnsi.h b/BaseTools/Source/C/Include/Guid/PcAnsi.h
deleted file mode 100644
index 697cf418b9..0000000000
--- a/BaseTools/Source/C/Include/Guid/PcAnsi.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/** @file
- Terminal Device Path Vendor Guid.
- @par Revision Reference:
- GUIDs defined in UEFI 2.0 spec.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PC_ANSI_H__
-#define __PC_ANSI_H__
-
-#define EFI_PC_ANSI_GUID \
- { \
- 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
- }
-
-#define EFI_VT_100_GUID \
- { \
- 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
- }
-
-#define EFI_VT_100_PLUS_GUID \
- { \
- 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \
- }
-
-#define EFI_VT_UTF8_GUID \
- { \
- 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \
- }
-
-#define EFI_UART_DEVICE_PATH_GUID \
- { \
- 0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \
- }
-
-#define EFI_SAS_DEVICE_PATH_GUID \
- { \
- 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
- }
-
-extern EFI_GUID gEfiPcAnsiGuid;
-extern EFI_GUID gEfiVT100Guid;
-extern EFI_GUID gEfiVT100PlusGuid;
-extern EFI_GUID gEfiVTUTF8Guid;
-extern EFI_GUID gEfiUartDevicePathGuid;
-extern EFI_GUID gEfiSasDevicePathGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h b/BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h
deleted file mode 100644
index 0483966beb..0000000000
--- a/BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- Guid used to define the Firmware File System. See PI spec volume 3 for more
- details.
-
- @par Revision Reference:
- Guids defined in PI Spec Volume 3
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __FIRMWARE_FILE_SYSTEM2_GUID_H__
-#define __FIRMWARE_FILE_SYSTEM2_GUID_H__
-
-//
-// GUIDs defined by the PI specification.
-//
-#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \
- { \
- 0x8c8ce578, 0x8a3d, 0x4f1c, {0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } \
- }
-
-#define EFI_FIRMWARE_FILE_SYSTEM3_GUID \
- { \
- 0x5473c07a, 0x3dcb, 0x4dca, {0xbd, 0x6f, 0x1e, 0x96, 0x89, 0xe7, 0x34, 0x9a } \
- }
-
-#define EFI_FFS_VOLUME_TOP_FILE_GUID \
- { \
- 0x1BA0062E, 0xC779, 0x4582, {0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x09 } \
- }
-
-extern EFI_GUID gEfiFirmwareFileSystem2Guid;
-extern EFI_GUID gEfiFirmwareFileSystem3Guid;
-extern EFI_GUID gEfiFirmwareVolumeTopFileGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Ia32/ProcessorBind.h b/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
deleted file mode 100644
index d1b77ad04a..0000000000
--- a/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for x64.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-//
-// Define the processor type so other code can make processor based choices
-//
-#define MDE_CPU_IA32
-
-//
-// Make sure we are useing the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-#if _MSC_EXTENSIONS
-
-//
-// Disable warning that make it impossible to compile at /W4
-// This only works for Microsoft* tools
-//
-
-//
-// Disabling bitfield type checking warnings.
-//
-#pragma warning ( disable : 4214 )
-
-//
-// Disabling the unreferenced formal parameter warnings.
-//
-#pragma warning ( disable : 4100 )
-
-//
-// Disable slightly different base types warning as CHAR8 * can not be set
-// to a constant string.
-//
-#pragma warning ( disable : 4057 )
-
-//
-// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
-//
-#pragma warning ( disable : 4127 )
-
-
-#endif
-
-
-#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
- //
- // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
- //
-
- #if _MSC_EXTENSIONS
-
- //
- // use Microsoft* C compiler dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #else
-
- //
- // Assume standard IA-32 alignment.
- // BugBug: Need to check portability of long long
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #endif
-
- #define UINT8_MAX 0xff
-
-#else
- //
- // Use ANSI C 2000 stdint.h integer width declarations
- //
- #include "stdint.h"
- typedef uint8_t BOOLEAN;
- typedef int8_t INT8;
- typedef uint8_t UINT8;
- typedef int16_t INT16;
- typedef uint16_t UINT16;
- typedef int32_t INT32;
- typedef uint32_t UINT32;
- typedef int64_t INT64;
- typedef uint64_t UINT64;
- typedef char CHAR8;
- typedef uint16_t CHAR16;
-
-#endif
-
-typedef UINT32 UINTN;
-typedef INT32 INTN;
-
-
-//
-// Processor specific defines
-//
-#define MAX_BIT 0x80000000
-#define MAX_2_BITS 0xC0000000
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#if _MSC_EXTENSIONS
- //
- // Microsoft* compiler requires _EFIAPI usage, __cdecl is Microsoft* specific C.
- //
- #define EFIAPI __cdecl
-#endif
-
-#if __GNUC__
- #define EFIAPI __attribute__((cdecl))
-#endif
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if _MSC_EXTENSIONS
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi.h
deleted file mode 100644
index 3516478ce4..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/** @file
- This file contains some basic ACPI definitions that are consumed by drivers
- that do not care about ACPI versions.
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _ACPI_H_
-#define _ACPI_H_
-
-//
-// Common table header, this prefaces all ACPI tables, including FACS, but
-// excluding the RSD PTR structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
-} EFI_ACPI_COMMON_HEADER;
-
-//
-// Common ACPI description table header. This structure prefaces most ACPI tables.
-//
-#pragma pack(1)
-
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT8 Revision;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT64 OemTableId;
- UINT32 OemRevision;
- UINT32 CreatorId;
- UINT32 CreatorRevision;
-} EFI_ACPI_DESCRIPTION_HEADER;
-
-#pragma pack()
-//
-// Define for Pci Host Bridge Resource Allocation
-//
-#define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
-#define ACPI_END_TAG_DESCRIPTOR 0x79
-
-#define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
-#define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
-#define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
-
-//
-// Power Management Timer frequency is fixed at 3.579545MHz
-//
-#define ACPI_TIMER_FREQUENCY 3579545
-
-//
-// Make sure structures match spec
-//
-#pragma pack(1)
-
-typedef struct {
- UINT8 Desc;
- UINT16 Len;
- UINT8 ResType;
- UINT8 GenFlag;
- UINT8 SpecificFlag;
- UINT64 AddrSpaceGranularity;
- UINT64 AddrRangeMin;
- UINT64 AddrRangeMax;
- UINT64 AddrTranslationOffset;
- UINT64 AddrLen;
-} EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
-
-typedef struct {
- UINT8 Desc;
- UINT8 Checksum;
-} EFI_ACPI_END_TAG_DESCRIPTOR;
-
-//
-// General use definitions
-//
-#define EFI_ACPI_RESERVED_BYTE 0x00
-#define EFI_ACPI_RESERVED_WORD 0x0000
-#define EFI_ACPI_RESERVED_DWORD 0x00000000
-#define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
-
-//
-// Resource Type Specific Flags
-// Ref ACPI specification 6.4.3.5.5
-//
-// Bit [0] : Write Status, _RW
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
-//
-// Bit [2:1] : Memory Attributes, _MEM
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
-//
-// Bit [4:3] : Memory Attributes, _MTP
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
-#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
-//
-// Bit [5] : Memory to I/O Translation, _TTP
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h
index 62bd9f477e..4c91b94609 100644
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h
+++ b/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h
@@ -7,279 +7,11 @@
**/
-#ifndef _ACPI_1_0_H_
-#define _ACPI_1_0_H_
+#ifndef _BT_ACPI_1_0_H_
+#define _BT_ACPI_1_0_H_
-#include "IndustryStandard/Acpi.h"
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// ACPI 1.0b table structures
-//
-//
-// Root System Description Pointer Structure
-//
-typedef struct {
- UINT64 Signature;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT8 Reserved;
- UINT32 RsdtAddress;
-} EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
-
-//
-// Root System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT32 table pointers.
-//
-//
-// RSDT Revision (as defined in ACPI 1.0b spec.)
-//
-#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Structure (FADT)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 FirmwareCtrl;
- UINT32 Dsdt;
- UINT8 IntModel;
- UINT8 Reserved1;
- UINT16 SciInt;
- UINT32 SmiCmd;
- UINT8 AcpiEnable;
- UINT8 AcpiDisable;
- UINT8 S4BiosReq;
- UINT8 Reserved2;
- UINT32 Pm1aEvtBlk;
- UINT32 Pm1bEvtBlk;
- UINT32 Pm1aCntBlk;
- UINT32 Pm1bCntBlk;
- UINT32 Pm2CntBlk;
- UINT32 PmTmrBlk;
- UINT32 Gpe0Blk;
- UINT32 Gpe1Blk;
- UINT8 Pm1EvtLen;
- UINT8 Pm1CntLen;
- UINT8 Pm2CntLen;
- UINT8 PmTmLen;
- UINT8 Gpe0BlkLen;
- UINT8 Gpe1BlkLen;
- UINT8 Gpe1Base;
- UINT8 Reserved3;
- UINT16 PLvl2Lat;
- UINT16 PLvl3Lat;
- UINT16 FlushSize;
- UINT16 FlushStride;
- UINT8 DutyOffset;
- UINT8 DutyWidth;
- UINT8 DayAlrm;
- UINT8 MonAlrm;
- UINT8 Century;
- UINT8 Reserved4;
- UINT8 Reserved5;
- UINT8 Reserved6;
- UINT32 Flags;
-} EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
-
-//
-// FADT Version (as defined in ACPI 1.0b spec.)
-//
-#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Fixed Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_1_0_WBINVD (1 << 0)
-#define EFI_ACPI_1_0_WBINVD_FLUSH (1 << 1)
-#define EFI_ACPI_1_0_PROC_C1 (1 << 2)
-#define EFI_ACPI_1_0_P_LVL2_UP (1 << 3)
-#define EFI_ACPI_1_0_PWR_BUTTON (1 << 4)
-#define EFI_ACPI_1_0_SLP_BUTTON (1 << 5)
-#define EFI_ACPI_1_0_FIX_RTC (1 << 6)
-#define EFI_ACPI_1_0_RTC_S4 (1 << 7)
-#define EFI_ACPI_1_0_TMR_VAL_EXT (1 << 8)
-#define EFI_ACPI_1_0_DCK_CAP (1 << 9)
+#include
#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x0
-//
-// Firmware ACPI Control Structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT32 HardwareSignature;
- UINT32 FirmwareWakingVector;
- UINT32 GlobalLock;
- UINT32 Flags;
- UINT8 Reserved[40];
-} EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
-
-//
-// Firmware Control Structure Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_1_0_S4BIOS_F (1 << 0)
-
-//
-// Multiple APIC Description Table header definition. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 LocalApicAddress;
- UINT32 Flags;
-} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
-
-//
-// MADT Revision (as defined in ACPI 1.0b spec.)
-//
-#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Multiple APIC Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_1_0_PCAT_COMPAT (1 << 0)
-
-//
-// Multiple APIC Description Table APIC structure types
-// All other values between 0x09 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
-#define EFI_ACPI_1_0_IO_APIC 0x01
-#define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
-#define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
-#define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
-
-//
-// APIC Structure Definitions
-//
-//
-// Processor Local APIC Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 ApicId;
- UINT32 Flags;
-} EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
-
-//
-// Local APIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED (1 << 0)
-
-//
-// IO APIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 IoApicAddress;
- UINT32 SystemVectorBase;
-} EFI_ACPI_1_0_IO_APIC_STRUCTURE;
-
-//
-// Interrupt Source Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterruptVector;
- UINT16 Flags;
-} EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
-
-//
-// Non-Maskable Interrupt Source Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT32 GlobalSystemInterruptVector;
-} EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Local APIC NMI Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT16 Flags;
- UINT8 LocalApicInti;
-} EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
-
-//
-// Smart Battery Description Table (SBST)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 WarningEnergyLevel;
- UINT32 LowEnergyLevel;
- UINT32 CriticalEnergyLevel;
-} EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
-
-//
-// Known table signatures
-//
-//
-// "RSD PTR " Root System Description Pointer
-//
-#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352ULL
-
-//
-// "APIC" Multiple APIC Description Table
-//
-#define EFI_ACPI_1_0_APIC_SIGNATURE 0x43495041
-
-//
-// "DSDT" Differentiated System Description Table
-//
-#define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
-
-//
-// "FACS" Firmware ACPI Control Structure
-//
-#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
-
-//
-// "FACP" Fixed ACPI Description Table
-//
-#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
-
-//
-// "PSDT" Persistent System Description Table
-//
-#define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
-
-//
-// "RSDT" Root System Description Table
-//
-#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
-
-//
-// "SBST" Smart Battery Specification Table
-//
-#define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
-
-//
-// "SSDT" Secondary System Description Table
-//
-#define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
-
-#pragma pack()
#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h
index c95c996c07..4b51fb1baf 100644
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h
+++ b/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h
@@ -7,514 +7,9 @@
**/
-#ifndef _ACPI_2_0_H_
-#define _ACPI_2_0_H_
+#ifndef _BT_ACPI_1_0_H_
+#define _BT_ACPI_1_0_H_
-#include "IndustryStandard/Acpi.h"
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// ACPI Specification Revision
-//
-#define EFI_ACPI_2_0_REVISION 0x02
-
-//
-// BUGBUG: OEM values need to be moved somewhere else, probably read from data hub
-// and produced by a platform specific driver.
-//
-//
-// ACPI OEM ID
-//
-#define EFI_ACPI_2_0_OEM_ID "INTEL "
-#define EFI_ACPI_2_0_OEM_TABLE_ID 0x5034303738543245 // "E2T8704P"
-//
-// ACPI OEM Revision
-//
-#define EFI_ACPI_2_0_OEM_REVISION 0x00000002
-
-//
-// ACPI table creator ID
-//
-#define EFI_ACPI_2_0_CREATOR_ID 0x5446534D // TBD "MSFT"
-//
-// ACPI table creator revision
-//
-#define EFI_ACPI_2_0_CREATOR_REVISION 0x01000013 // TBD
-//
-// ACPI 2.0 Generic Address Space definition
-//
-typedef struct {
- UINT8 AddressSpaceId;
- UINT8 RegisterBitWidth;
- UINT8 RegisterBitOffset;
- UINT8 Reserved;
- UINT64 Address;
-} EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
-
-//
-// Generic Address Space Address IDs
-//
-#define EFI_ACPI_2_0_SYSTEM_MEMORY 0
-#define EFI_ACPI_2_0_SYSTEM_IO 1
-#define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
-#define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
-#define EFI_ACPI_2_0_SMBUS 4
-#define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
-
-//
-// ACPI 2.0 table structures
-//
-//
-// Root System Description Pointer Structure
-//
-typedef struct {
- UINT64 Signature;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT8 Revision;
- UINT32 RsdtAddress;
- UINT32 Length;
- UINT64 XsdtAddress;
- UINT8 ExtendedChecksum;
- UINT8 Reserved[3];
-} EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
-
-//
-// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
-
-//
-// Common table header, this prefaces all ACPI tables, including FACS, but
-// excluding the RSD PTR structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
-} EFI_ACPI_2_0_COMMON_HEADER;
-
-//
-// Root System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT32 table pointers.
-//
-//
-// RSDT Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Extended System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT64 table pointers.
-//
-//
-// XSDT Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Structure (FADT)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 FirmwareCtrl;
- UINT32 Dsdt;
- UINT8 Reserved0;
- UINT8 PreferredPmProfile;
- UINT16 SciInt;
- UINT32 SmiCmd;
- UINT8 AcpiEnable;
- UINT8 AcpiDisable;
- UINT8 S4BiosReq;
- UINT8 PstateCnt;
- UINT32 Pm1aEvtBlk;
- UINT32 Pm1bEvtBlk;
- UINT32 Pm1aCntBlk;
- UINT32 Pm1bCntBlk;
- UINT32 Pm2CntBlk;
- UINT32 PmTmrBlk;
- UINT32 Gpe0Blk;
- UINT32 Gpe1Blk;
- UINT8 Pm1EvtLen;
- UINT8 Pm1CntLen;
- UINT8 Pm2CntLen;
- UINT8 PmTmrLen;
- UINT8 Gpe0BlkLen;
- UINT8 Gpe1BlkLen;
- UINT8 Gpe1Base;
- UINT8 CstCnt;
- UINT16 PLvl2Lat;
- UINT16 PLvl3Lat;
- UINT16 FlushSize;
- UINT16 FlushStride;
- UINT8 DutyOffset;
- UINT8 DutyWidth;
- UINT8 DayAlrm;
- UINT8 MonAlrm;
- UINT8 Century;
- UINT16 IaPcBootArch;
- UINT8 Reserved1;
- UINT32 Flags;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
- UINT8 ResetValue;
- UINT8 Reserved2[3];
- UINT64 XFirmwareCtrl;
- UINT64 XDsdt;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
-} EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
-
-//
-// FADT Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
-
-//
-// Fixed ACPI Description Table Boot Architecture Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_LEGACY_DEVICES (1 << 0)
-#define EFI_ACPI_2_0_8042 (1 << 1)
-
-//
-// Fixed ACPI Description Table Fixed Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_WBINVD (1 << 0)
-#define EFI_ACPI_2_0_WBINVD_FLUSH (1 << 1)
-#define EFI_ACPI_2_0_PROC_C1 (1 << 2)
-#define EFI_ACPI_2_0_P_LVL2_UP (1 << 3)
-#define EFI_ACPI_2_0_PWR_BUTTON (1 << 4)
-#define EFI_ACPI_2_0_SLP_BUTTON (1 << 5)
-#define EFI_ACPI_2_0_FIX_RTC (1 << 6)
-#define EFI_ACPI_2_0_RTC_S4 (1 << 7)
-#define EFI_ACPI_2_0_TMR_VAL_EXT (1 << 8)
-#define EFI_ACPI_2_0_DCK_CAP (1 << 9)
-#define EFI_ACPI_2_0_RESET_REG_SUP (1 << 10)
-#define EFI_ACPI_2_0_SEALED_CASE (1 << 11)
-#define EFI_ACPI_2_0_HEADLESS (1 << 12)
-#define EFI_ACPI_2_0_CPU_SW_SLP (1 << 13)
-
-//
-// Firmware ACPI Control Structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT32 HardwareSignature;
- UINT32 FirmwareWakingVector;
- UINT32 GlobalLock;
- UINT32 Flags;
- UINT64 XFirmwareWakingVector;
- UINT8 Version;
- UINT8 Reserved[31];
-} EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
-
-//
-// FACS Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
-
-//
-// Firmware Control Structure Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_S4BIOS_F (1 << 0)
-
-//
-// Multiple APIC Description Table header definition. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 LocalApicAddress;
- UINT32 Flags;
-} EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
-
-//
-// MADT Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Multiple APIC Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_PCAT_COMPAT (1 << 0)
-
-//
-// Multiple APIC Description Table APIC structure types
-// All other values between 0x09 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
-#define EFI_ACPI_2_0_IO_APIC 0x01
-#define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
-#define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
-#define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
-#define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
-#define EFI_ACPI_2_0_IO_SAPIC 0x06
-#define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
-#define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
-
-//
-// APIC Structure Definitions
-//
-//
-// Processor Local APIC Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 ApicId;
- UINT32 Flags;
-} EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
-
-//
-// Local APIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_2_0_LOCAL_APIC_ENABLED (1 << 0)
-
-//
-// IO APIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 IoApicAddress;
- UINT32 GlobalSystemInterruptBase;
-} EFI_ACPI_2_0_IO_APIC_STRUCTURE;
-
-//
-// Interrupt Source Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterrupt;
- UINT16 Flags;
-} EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
-
-//
-// Non-Maskable Interrupt Source Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT32 GlobalSystemInterrupt;
-} EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Local APIC NMI Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT16 Flags;
- UINT8 LocalApicLint;
-} EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
-
-//
-// Local APIC Address Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Reserved;
- UINT64 LocalApicAddress;
-} EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
-
-//
-// IO SAPIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 GlobalSystemInterruptBase;
- UINT64 IoSapicAddress;
-} EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
-
-//
-// Local SAPIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 LocalSapicId;
- UINT8 LocalSapicEid;
- UINT8 Reserved[3];
- UINT32 Flags;
-} EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
-
-//
-// Platform Interrupt Sources Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT8 InterruptType;
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalSystemInterrupt;
- UINT32 Reserved;
-} EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
-
-//
-// Smart Battery Description Table (SBST)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 WarningEnergyLevel;
- UINT32 LowEnergyLevel;
- UINT32 CriticalEnergyLevel;
-} EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
-
-//
-// SBST Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Embedded Controller Boot Resources Table (ECDT)
-// The table is followed by a null terminated ASCII string that contains
-// a fully qualified reference to the name space object.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
- UINT32 Uid;
- UINT8 GpeBit;
-} EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
-
-//
-// ECDT Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
-
-//
-// Known table signatures
-//
-//
-// "RSD PTR " Root System Description Pointer
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352
-
-//
-// "SPIC" Multiple SAPIC Description Table
-//
-// BUGBUG: Don't know where this came from except SR870BN4 uses it.
-// #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
-//
-#define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
-
-//
-// "BOOT" MS Simple Boot Spec
-//
-#define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
-
-//
-// "DBGP" MS Bebug Port Spec
-//
-#define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
-
-//
-// "DSDT" Differentiated System Description Table
-//
-#define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
-
-//
-// "ECDT" Embedded Controller Boot Resources Table
-//
-#define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
-
-//
-// "ETDT" Event Timer Description Table
-//
-#define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
-
-//
-// "FACS" Firmware ACPI Control Structure
-//
-#define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
-
-//
-// "FACP" Fixed ACPI Description Table
-//
-#define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
-
-//
-// "APIC" Multiple APIC Description Table
-//
-#define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
-
-//
-// "PSDT" Persistent System Description Table
-//
-#define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
-
-//
-// "RSDT" Root System Description Table
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
-
-//
-// "SBST" Smart Battery Specification Table
-//
-#define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
-
-//
-// "SLIT" System Locality Information Table
-//
-#define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
-
-//
-// "SPCR" Serial Port Console Redirection Table
-//
-#define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
-
-//
-// "SRAT" Static Resource Affinity Table
-//
-#define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
-
-//
-// "SSDT" Secondary System Description Table
-//
-#define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
-
-//
-// "SPMI" Server Platform Management Interface Table
-//
-#define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE 0x494D5053
-
-//
-// "XSDT" Extended System Description Table
-//
-#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
-
-#pragma pack()
+#include
#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h
index 6c6e52f6bf..5111bdfef9 100644
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h
+++ b/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h
@@ -7,662 +7,9 @@
**/
-#ifndef _ACPI_3_0_H_
-#define _ACPI_3_0_H_
+#ifndef _BT_ACPI_1_0_H_
+#define _BT_ACPI_1_0_H_
-#include "IndustryStandard/Acpi.h"
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// ACPI Specification Revision
-//
-#define EFI_ACPI_3_0_REVISION 0x03 // BUGBUG: Not in spec yet.
-//
-// BUGBUG: OEM values need to be moved somewhere else, probably read from data hub
-// and produced by a platform specific driver.
-//
-//
-// ACPI 3.0 Generic Address Space definition
-//
-typedef struct {
- UINT8 AddressSpaceId;
- UINT8 RegisterBitWidth;
- UINT8 RegisterBitOffset;
- UINT8 AccessSize;
- UINT64 Address;
-} EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE;
-
-//
-// Generic Address Space Address IDs
-//
-#define EFI_ACPI_3_0_SYSTEM_MEMORY 0
-#define EFI_ACPI_3_0_SYSTEM_IO 1
-#define EFI_ACPI_3_0_PCI_CONFIGURATION_SPACE 2
-#define EFI_ACPI_3_0_EMBEDDED_CONTROLLER 3
-#define EFI_ACPI_3_0_SMBUS 4
-#define EFI_ACPI_3_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
-
-//
-// Generic Address Space Access Sizes
-//
-#define EFI_ACPI_3_0_UNDEFINED 0
-#define EFI_ACPI_3_0_BYTE 1
-#define EFI_ACPI_3_0_WORD 2
-#define EFI_ACPI_3_0_DWORD 3
-#define EFI_ACPI_3_0_QWORD 4
-
-//
-// ACPI 3.0 table structures
-//
-//
-// Root System Description Pointer Structure
-//
-typedef struct {
- UINT64 Signature;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT8 Revision;
- UINT32 RsdtAddress;
- UINT32 Length;
- UINT64 XsdtAddress;
- UINT8 ExtendedChecksum;
- UINT8 Reserved[3];
-} EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
-
-//
-// RSD_PTR Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02 // ACPISpec30 (Revision 3.0 September 2, 2004) says current value is 2
-//
-// Common table header, this prefaces all ACPI tables, including FACS, but
-// excluding the RSD PTR structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
-} EFI_ACPI_3_0_COMMON_HEADER;
-
-//
-// Root System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT32 table pointers.
-//
-//
-// RSDT Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Extended System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT64 table pointers.
-//
-//
-// XSDT Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Structure (FADT)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 FirmwareCtrl;
- UINT32 Dsdt;
- UINT8 Reserved0;
- UINT8 PreferredPmProfile;
- UINT16 SciInt;
- UINT32 SmiCmd;
- UINT8 AcpiEnable;
- UINT8 AcpiDisable;
- UINT8 S4BiosReq;
- UINT8 PstateCnt;
- UINT32 Pm1aEvtBlk;
- UINT32 Pm1bEvtBlk;
- UINT32 Pm1aCntBlk;
- UINT32 Pm1bCntBlk;
- UINT32 Pm2CntBlk;
- UINT32 PmTmrBlk;
- UINT32 Gpe0Blk;
- UINT32 Gpe1Blk;
- UINT8 Pm1EvtLen;
- UINT8 Pm1CntLen;
- UINT8 Pm2CntLen;
- UINT8 PmTmrLen;
- UINT8 Gpe0BlkLen;
- UINT8 Gpe1BlkLen;
- UINT8 Gpe1Base;
- UINT8 CstCnt;
- UINT16 PLvl2Lat;
- UINT16 PLvl3Lat;
- UINT16 FlushSize;
- UINT16 FlushStride;
- UINT8 DutyOffset;
- UINT8 DutyWidth;
- UINT8 DayAlrm;
- UINT8 MonAlrm;
- UINT8 Century;
- UINT16 IaPcBootArch;
- UINT8 Reserved1;
- UINT32 Flags;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
- UINT8 ResetValue;
- UINT8 Reserved2[3];
- UINT64 XFirmwareCtrl;
- UINT64 XDsdt;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
-} EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE;
-
-//
-// FADT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x04
-
-//
-// Fixed ACPI Description Table Preferred Power Management Profile
-//
-#define EFI_ACPI_3_0_PM_PROFILE_UNSPECIFIED 0
-#define EFI_ACPI_3_0_PM_PROFILE_DESKTOP 1
-#define EFI_ACPI_3_0_PM_PROFILE_MOBILE 2
-#define EFI_ACPI_3_0_PM_PROFILE_WORKSTATION 3
-#define EFI_ACPI_3_0_PM_PROFILE_ENTERPRISE_SERVER 4
-#define EFI_ACPI_3_0_PM_PROFILE_SOHO_SERVER 5
-#define EFI_ACPI_3_0_PM_PROFILE_APPLIANCE_PC 6
-#define EFI_ACPI_3_0_PM_PROFILE_PERFORMANCE_SERVER 7
-
-//
-// Fixed ACPI Description Table Boot Architecture Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_LEGACY_DEVICES (1 << 0)
-#define EFI_ACPI_3_0_8042 (1 << 1)
-#define EFI_ACPI_3_0_VGA_NOT_PRESENT (1 << 2)
-#define EFI_ACPI_3_0_MSI_NOT_SUPPORTED (1 << 3)
-//
-// Fixed ACPI Description Table Fixed Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_WBINVD (1 << 0)
-#define EFI_ACPI_3_0_WBINVD_FLUSH (1 << 1)
-#define EFI_ACPI_3_0_PROC_C1 (1 << 2)
-#define EFI_ACPI_3_0_P_LVL2_UP (1 << 3)
-#define EFI_ACPI_3_0_PWR_BUTTON (1 << 4)
-#define EFI_ACPI_3_0_SLP_BUTTON (1 << 5)
-#define EFI_ACPI_3_0_FIX_RTC (1 << 6)
-#define EFI_ACPI_3_0_RTC_S4 (1 << 7)
-#define EFI_ACPI_3_0_TMR_VAL_EXT (1 << 8)
-#define EFI_ACPI_3_0_DCK_CAP (1 << 9)
-#define EFI_ACPI_3_0_RESET_REG_SUP (1 << 10)
-#define EFI_ACPI_3_0_SEALED_CASE (1 << 11)
-#define EFI_ACPI_3_0_HEADLESS (1 << 12)
-#define EFI_ACPI_3_0_CPU_SW_SLP (1 << 13)
-#define EFI_ACPI_3_0_PCI_EXP_WAK (1 << 14)
-#define EFI_ACPI_3_0_USE_PLATFORM_CLOCK (1 << 15)
-#define EFI_ACPI_3_0_S4_RTC_STS_VALID (1 << 16)
-#define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE (1 << 17)
-#define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL (1 << 18)
-#define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE (1 << 19)
-
-//
-// Firmware ACPI Control Structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT32 HardwareSignature;
- UINT32 FirmwareWakingVector;
- UINT32 GlobalLock;
- UINT32 Flags;
- UINT64 XFirmwareWakingVector;
- UINT8 Version;
- UINT8 Reserved[31];
-} EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
-
-//
-// FACS Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
-
-//
-// Firmware Control Structure Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_S4BIOS_F (1 << 0)
-
-//
-// Differentiated System Description Table,
-// Secondary System Description Table
-// and Persistent System Description Table,
-// no definition needed as they are common description table header followed by a
-// definition block.
-//
-#define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
-#define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
-
-//
-// Multiple APIC Description Table header definition. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 LocalApicAddress;
- UINT32 Flags;
-} EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
-
-//
-// MADT Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x02
-
-//
-// Multiple APIC Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_PCAT_COMPAT (1 << 0)
-
-//
-// Multiple APIC Description Table APIC structure types
-// All other values between 0x09 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC 0x00
-#define EFI_ACPI_3_0_IO_APIC 0x01
-#define EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE 0x02
-#define EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
-#define EFI_ACPI_3_0_LOCAL_APIC_NMI 0x04
-#define EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
-#define EFI_ACPI_3_0_IO_SAPIC 0x06
-#define EFI_ACPI_3_0_LOCAL_SAPIC 0x07
-#define EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES 0x08
-
-//
-// APIC Structure Definitions
-//
-//
-// Processor Local APIC Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 ApicId;
- UINT32 Flags;
-} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
-
-//
-// Local APIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_3_0_LOCAL_APIC_ENABLED (1 << 0)
-
-//
-// IO APIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 IoApicAddress;
- UINT32 GlobalSystemInterruptBase;
-} EFI_ACPI_3_0_IO_APIC_STRUCTURE;
-
-//
-// Interrupt Source Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterrupt;
- UINT16 Flags;
-} EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
-
-//
-// Platform Interrupt Sources Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT8 InterruptType;
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalSystemInterrupt;
- UINT32 PlatformInterruptSourceFlags;
- UINT8 CpeiProcessorOverride;
- UINT8 Reserved[31];
-} EFI_ACPI_3_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
-
-//
-// MPS INTI flags.
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_POLARITY (3 << 0)
-#define EFI_ACPI_3_0_TRIGGER_MODE (3 << 2)
-
-//
-// Non-Maskable Interrupt Source Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT32 GlobalSystemInterrupt;
-} EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Local APIC NMI Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT16 Flags;
- UINT8 LocalApicLint;
-} EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE;
-
-//
-// Local APIC Address Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Reserved;
- UINT64 LocalApicAddress;
-} EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
-
-//
-// IO SAPIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 GlobalSystemInterruptBase;
- UINT64 IoSapicAddress;
-} EFI_ACPI_3_0_IO_SAPIC_STRUCTURE;
-
-//
-// Local SAPIC Structure
-// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 LocalSapicId;
- UINT8 LocalSapicEid;
- UINT8 Reserved[3];
- UINT32 Flags;
- UINT32 ACPIProcessorUIDValue;
-} EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
-
-//
-// Platform Interrupt Sources Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT8 InterruptType;
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalSystemInterrupt;
- UINT32 PlatformInterruptSourceFlags;
-} EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
-
-//
-// Platform Interrupt Source Flags.
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE (1 << 0)
-
-//
-// Smart Battery Description Table (SBST)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 WarningEnergyLevel;
- UINT32 LowEnergyLevel;
- UINT32 CriticalEnergyLevel;
-} EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE;
-
-//
-// SBST Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Embedded Controller Boot Resources Table (ECDT)
-// The table is followed by a null terminated ASCII string that contains
-// a fully qualified reference to the name space object.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcControl;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcData;
- UINT32 Uid;
- UINT8 GpeBit;
-} EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
-
-//
-// ECDT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
-
-//
-// System Resource Affinity Table (SRAT. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 Reserved1; // Must be set to 1
- UINT64 Reserved2;
-} EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
-
-//
-// SRAT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION 0x02
-
-//
-// SRAT structure types.
-// All other values between 0x02 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY 0x00
-#define EFI_ACPI_3_0_MEMORY_AFFINITY 0x01
-
-//
-// Processor Local APIC/SAPIC Affinity Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 ProximityDomain7To0;
- UINT8 ApicId;
- UINT32 Flags;
- UINT8 LocalSapicEid;
- UINT8 ProximityDomain31To8[3];
- UINT8 Reserved[4];
-} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
-
-//
-// Local APIC/SAPIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
-
-//
-// Memory Affinity Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT32 ProximityDomain;
- UINT16 Reserved1;
- UINT32 AddressBaseLow;
- UINT32 AddressBaseHigh;
- UINT32 LengthLow;
- UINT32 LengthHigh;
- UINT32 Reserved2;
- UINT32 Flags;
- UINT64 Reserved3;
-} EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE;
-
-//
-// Memory Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_3_0_MEMORY_ENABLED (1 << 0)
-#define EFI_ACPI_3_0_MEMORY_HOT_PLUGGABLE (1 << 1)
-#define EFI_ACPI_3_0_MEMORY_NONVOLATILE (1 << 2)
-
-//
-// System Locality Distance Information Table (SLIT).
-// The rest of the table is a matrix.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT64 NumberOfSystemLocalities;
-} EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
-
-//
-// SLIT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION 0x01
-
-//
-// Known table signatures
-//
-//
-// "RSD PTR " Root System Description Pointer
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352ULL
-
-//
-// "APIC" Multiple APIC Description Table
-//
-#define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
-
-//
-// "DSDT" Differentiated System Description Table
-//
-#define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
-
-//
-// "ECDT" Embedded Controller Boot Resources Table
-//
-#define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
-
-//
-// "FACP" Fixed ACPI Description Table
-//
-#define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
-
-//
-// "FACS" Firmware ACPI Control Structure
-//
-#define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
-
-//
-// "PSDT" Persistent System Description Table
-//
-#define EFI_ACPI_3_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
-
-//
-// "RSDT" Root System Description Table
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
-
-//
-// "SBST" Smart Battery Specification Table
-//
-#define EFI_ACPI_3_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
-
-//
-// "SLIT" System Locality Information Table
-//
-#define EFI_ACPI_3_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
-
-//
-// "SRAT" System Resource Affinity Table
-//
-#define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
-
-//
-// "SSDT" Secondary System Description Table
-//
-#define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
-
-//
-// "XSDT" Extended System Description Table
-//
-#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
-
-//
-// "BOOT" MS Simple Boot Spec
-//
-#define EFI_ACPI_3_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
-
-//
-// "CPEP" Corrected Platform Error Polling Table
-// See
-//
-#define EFI_ACPI_3_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_SIGNATURE 0x50455043
-
-//
-// "DBGP" MS Debug Port Spec
-//
-#define EFI_ACPI_3_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
-
-//
-// "ETDT" Event Timer Description Table
-//
-#define EFI_ACPI_3_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
-
-//
-// "HPET" IA-PC High Precision Event Timer Table
-//
-#define EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE 0x54455048
-
-//
-// "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
-//
-#define EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE 0x4746434D
-
-//
-// "SPCR" Serial Port Console Redirection Table
-//
-#define EFI_ACPI_3_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
-
-//
-// "SPMI" Server Platform Management Interface Table
-//
-#define EFI_ACPI_3_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE 0x494D5053
-
-//
-// "TCPA" Trusted Computing Platform Alliance Capabilities Table
-//
-#define EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE 0x41504354
-
-//
-// "WDRT" Watchdog Resource Table
-//
-#define EFI_ACPI_3_0_WATCHDOG_RESOURCE_TABLE_SIGNATURE 0x54524457
-
-#pragma pack()
+#include
#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Bluetooth.h b/BaseTools/Source/C/Include/IndustryStandard/Bluetooth.h
deleted file mode 100644
index 82f5e6299e..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/Bluetooth.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- This file contains the Bluetooth definitions that are consumed by drivers.
- These definitions are from Bluetooth Core Specification Version 4.0 June, 2010
-
- Copyright (c) 2017, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _BLUETOOTH_H_
-#define _BLUETOOTH_H_
-
-#pragma pack(1)
-
-///
-/// BLUETOOTH_ADDRESS
-///
-typedef struct {
- ///
- /// 48bit Bluetooth device address.
- ///
- UINT8 Address[6];
-} BLUETOOTH_ADDRESS;
-
-///
-/// BLUETOOTH_CLASS_OF_DEVICE. See Bluetooth specification for detail.
-///
-typedef struct {
- UINT8 FormatType:2;
- UINT8 MinorDeviceClass: 6;
- UINT16 MajorDeviceClass: 5;
- UINT16 MajorServiceClass:11;
-} BLUETOOTH_CLASS_OF_DEVICE;
-
-///
-/// BLUETOOTH_LE_ADDRESS
-///
-typedef struct {
- ///
- /// 48-bit Bluetooth device address
- ///
- UINT8 Address[6];
- ///
- /// 0x00 - Public Device Address
- /// 0x01 - Random Device Address
- ///
- UINT8 Type;
-} BLUETOOTH_LE_ADDRESS;
-
-#pragma pack()
-
-#define BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE 248
-
-#define BLUETOOTH_HCI_LINK_KEY_SIZE 16
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/EfiPci.h b/BaseTools/Source/C/Include/IndustryStandard/EfiPci.h
deleted file mode 100644
index aab27f9bf9..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/EfiPci.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- Support for EFI PCI specification.
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _EFI_PCI_H_
-#define _EFI_PCI_H_
-
-//#include "pci22.h"
-//#include "pci23.h"
-//#include "pci30.h"
-
-#pragma pack(push, 1)
-
-typedef struct {
- UINT8 Register;
- UINT8 Function;
- UINT8 Device;
- UINT8 Bus;
- UINT8 Reserved[4];
-} DEFIO_PCI_ADDR;
-
-#define EFI_ROOT_BRIDGE_LIST 'eprb'
-#define EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE 0x0EF1
-
-typedef struct {
- UINT16 Signature; // 0xaa55
- UINT16 InitializationSize;
- UINT32 EfiSignature; // 0x0EF1
- UINT16 EfiSubsystem;
- UINT16 EfiMachineType;
- UINT16 CompressionType;
- UINT8 Reserved[8];
- UINT16 EfiImageHeaderOffset;
- UINT16 PcirOffset;
-} EFI_PCI_EXPANSION_ROM_HEADER;
-
-typedef union {
- UINT8 *Raw;
- PCI_EXPANSION_ROM_HEADER *Generic;
- EFI_PCI_EXPANSION_ROM_HEADER *Efi;
- EFI_LEGACY_EXPANSION_ROM_HEADER *PcAt;
-} EFI_PCI_ROM_HEADER;
-
-#pragma pack(pop)
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h b/BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
deleted file mode 100644
index 3d435001fc..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- ACPI memory mapped configuration space access table definition, defined at
- in the PCI Firmware Specification, version 3.0 draft version 0.5.
- Specification is available at http://www.pcisig.com.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_H_
-#define _MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_H_
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// Memory Mapped Configuration Space Access Table (MCFG)
-// This table is a basic description table header followed by
-// a number of base address allocation structures.
-//
-typedef struct {
- UINT64 BaseAddress;
- UINT16 PciSegmentGroupNumber;
- UINT8 StartBusNumber;
- UINT8 EndBusNumber;
- UINT32 Reserved;
-} EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE;
-
-//
-// MCFG Revision (defined in spec)
-//
-#define EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION 0x01
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
deleted file mode 100644
index 22161edf44..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
+++ /dev/null
@@ -1,789 +0,0 @@
-/** @file
- EFI image format for PE32+. Please note some data structures are different
- for IA-32 and Itanium-based images, look for UINTN and the #ifdef EFI_IA64
-
- @bug Fix text - doc as defined in MSFT EFI specification.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
- Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.
- Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PE_IMAGE_H__
-#define __PE_IMAGE_H__
-
-//
-// PE32+ Subsystem type for EFI images
-//
-#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
-
-//
-// BugBug: Need to get a real answer for this problem. This is not in the
-// PE specification.
-//
-// A SAL runtime driver does not get fixed up when a transition to
-// virtual mode is made. In all other cases it should be treated
-// like a EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER image
-//
-#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
-
-//
-// PE32+ Machine type for EFI images
-//
-#define IMAGE_FILE_MACHINE_I386 0x014c
-#define IMAGE_FILE_MACHINE_EBC 0x0EBC
-#define IMAGE_FILE_MACHINE_X64 0x8664
-#define IMAGE_FILE_MACHINE_ARM 0x01c0 // Thumb only
-#define IMAGE_FILE_MACHINE_ARMT 0x01c2 // 32bit Mixed ARM and Thumb/Thumb 2 Little Endian
-#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // 64bit ARM Architecture, Little Endian
-#define IMAGE_FILE_MACHINE_RISCV64 0x5064 // 64bit RISC-V ISA
-#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 // 64bit LoongArch Architecture
-
-//
-// Support old names for backward compatible
-//
-#define EFI_IMAGE_MACHINE_IA32 IMAGE_FILE_MACHINE_I386
-#define EFI_IMAGE_MACHINE_EBC IMAGE_FILE_MACHINE_EBC
-#define EFI_IMAGE_MACHINE_X64 IMAGE_FILE_MACHINE_X64
-#define EFI_IMAGE_MACHINE_ARMT IMAGE_FILE_MACHINE_ARMT
-#define EFI_IMAGE_MACHINE_AARCH64 IMAGE_FILE_MACHINE_ARM64
-#define EFI_IMAGE_MACHINE_RISCV64 IMAGE_FILE_MACHINE_RISCV64
-#define EFI_IMAGE_MACHINE_LOONGARCH64 IMAGE_FILE_MACHINE_LOONGARCH64
-
-#define EFI_IMAGE_DOS_SIGNATURE 0x5A4D // MZ
-#define EFI_IMAGE_OS2_SIGNATURE 0x454E // NE
-#define EFI_IMAGE_OS2_SIGNATURE_LE 0x454C // LE
-#define EFI_IMAGE_NT_SIGNATURE 0x00004550 // PE00
-#define EFI_IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
-
-///
-/// PE images can start with an optional DOS header, so if an image is run
-/// under DOS it can print an error message.
-///
-typedef struct {
- UINT16 e_magic; // Magic number
- UINT16 e_cblp; // Bytes on last page of file
- UINT16 e_cp; // Pages in file
- UINT16 e_crlc; // Relocations
- UINT16 e_cparhdr; // Size of header in paragraphs
- UINT16 e_minalloc; // Minimum extra paragraphs needed
- UINT16 e_maxalloc; // Maximum extra paragraphs needed
- UINT16 e_ss; // Initial (relative) SS value
- UINT16 e_sp; // Initial SP value
- UINT16 e_csum; // Checksum
- UINT16 e_ip; // Initial IP value
- UINT16 e_cs; // Initial (relative) CS value
- UINT16 e_lfarlc; // File address of relocation table
- UINT16 e_ovno; // Overlay number
- UINT16 e_res[4]; // Reserved words
- UINT16 e_oemid; // OEM identifier (for e_oeminfo)
- UINT16 e_oeminfo; // OEM information; e_oemid specific
- UINT16 e_res2[10]; // Reserved words
- UINT32 e_lfanew; // File address of new exe header
-} EFI_IMAGE_DOS_HEADER;
-
-///
-/// File header format.
-///
-typedef struct {
- UINT16 Machine;
- UINT16 NumberOfSections;
- UINT32 TimeDateStamp;
- UINT32 PointerToSymbolTable;
- UINT32 NumberOfSymbols;
- UINT16 SizeOfOptionalHeader;
- UINT16 Characteristics;
-} EFI_IMAGE_FILE_HEADER;
-
-#define EFI_IMAGE_SIZEOF_FILE_HEADER 20
-
-#define EFI_IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
-#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
-#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
-#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
-#define EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 // Supports addresses > 2-GB
-#define EFI_IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
-#define EFI_IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
-#define EFI_IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
-#define EFI_IMAGE_FILE_SYSTEM 0x1000 // System File.
-#define EFI_IMAGE_FILE_DLL 0x2000 // File is a DLL.
-#define EFI_IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
-#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0
-#define EFI_IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
-#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 // MIPS* little-endian, 0540 big-endian
-#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 // MIPS* little-endian
-#define EFI_IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP*
-#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM* PowerPC Little-Endian
-#define EFI_IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
-//
-// * Other names and brands may be claimed as the property of others.
-//
-
-///
-/// Directory format.
-///
-typedef struct {
- UINT32 VirtualAddress;
- UINT32 Size;
-} EFI_IMAGE_DATA_DIRECTORY;
-
-#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16
-
-typedef struct {
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- UINT32 BaseOfData;
- UINT32 BaseOfBss;
- UINT32 GprMask;
- UINT32 CprMask[4];
- UINT32 GpValue;
-} EFI_IMAGE_ROM_OPTIONAL_HEADER;
-
-#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
-#define EFI_IMAGE_SIZEOF_ROM_OPTIONAL_HEADER sizeof (EFI_IMAGE_ROM_OPTIONAL_HEADER)
-
-typedef struct {
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
-} EFI_IMAGE_ROM_HEADERS;
-
-///
-/// @attention
-/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
-/// are for use ONLY by tools. All proper EFI code MUST use
-/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
-///
-#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
-
-typedef struct {
- //
- // Standard fields.
- //
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- UINT32 BaseOfData;
- //
- // NT additional fields.
- //
- UINT32 ImageBase;
- UINT32 SectionAlignment;
- UINT32 FileAlignment;
- UINT16 MajorOperatingSystemVersion;
- UINT16 MinorOperatingSystemVersion;
- UINT16 MajorImageVersion;
- UINT16 MinorImageVersion;
- UINT16 MajorSubsystemVersion;
- UINT16 MinorSubsystemVersion;
- UINT32 Win32VersionValue;
- UINT32 SizeOfImage;
- UINT32 SizeOfHeaders;
- UINT32 CheckSum;
- UINT16 Subsystem;
- UINT16 DllCharacteristics;
- UINT32 SizeOfStackReserve;
- UINT32 SizeOfStackCommit;
- UINT32 SizeOfHeapReserve;
- UINT32 SizeOfHeapCommit;
- UINT32 LoaderFlags;
- UINT32 NumberOfRvaAndSizes;
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
-} EFI_IMAGE_OPTIONAL_HEADER32;
-
-///
-/// @attention
-/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
-/// are for use ONLY by tools. All proper EFI code MUST use
-/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
-///
-#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
-
-typedef struct {
- //
- // Standard fields.
- //
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- //
- // NT additional fields.
- //
- UINT64 ImageBase;
- UINT32 SectionAlignment;
- UINT32 FileAlignment;
- UINT16 MajorOperatingSystemVersion;
- UINT16 MinorOperatingSystemVersion;
- UINT16 MajorImageVersion;
- UINT16 MinorImageVersion;
- UINT16 MajorSubsystemVersion;
- UINT16 MinorSubsystemVersion;
- UINT32 Win32VersionValue;
- UINT32 SizeOfImage;
- UINT32 SizeOfHeaders;
- UINT32 CheckSum;
- UINT16 Subsystem;
- UINT16 DllCharacteristics;
- UINT64 SizeOfStackReserve;
- UINT64 SizeOfStackCommit;
- UINT64 SizeOfHeapReserve;
- UINT64 SizeOfHeapCommit;
- UINT32 LoaderFlags;
- UINT32 NumberOfRvaAndSizes;
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
-} EFI_IMAGE_OPTIONAL_HEADER64;
-
-///
-/// @attention
-/// EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY
-/// by tools. All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!!
-///
-typedef struct {
- UINT32 Signature;
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader;
-} EFI_IMAGE_NT_HEADERS32;
-
-#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32)
-
-typedef struct {
- UINT32 Signature;
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader;
-} EFI_IMAGE_NT_HEADERS64;
-
-#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64)
-
-//
-// Subsystem Values
-//
-#define EFI_IMAGE_SUBSYSTEM_UNKNOWN 0
-#define EFI_IMAGE_SUBSYSTEM_NATIVE 1
-#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2
-#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3.
-#define EFI_IMAGE_SUBSYSTEM_OS2_CUI 5
-#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI 7
-
-//
-// Directory Entries
-//
-#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0
-#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1
-#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2
-#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
-#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4
-#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5
-#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6
-#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
-#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
-#define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9
-#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
-
-//
-// Section header format.
-//
-#define EFI_IMAGE_SIZEOF_SHORT_NAME 8
-
-typedef struct {
- UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME];
- union {
- UINT32 PhysicalAddress;
- UINT32 VirtualSize;
- } Misc;
- UINT32 VirtualAddress;
- UINT32 SizeOfRawData;
- UINT32 PointerToRawData;
- UINT32 PointerToRelocations;
- UINT32 PointerToLinenumbers;
- UINT16 NumberOfRelocations;
- UINT16 NumberOfLinenumbers;
- UINT32 Characteristics;
-} EFI_IMAGE_SECTION_HEADER;
-
-#define EFI_IMAGE_SIZEOF_SECTION_HEADER 40
-
-#define EFI_IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
-#define EFI_IMAGE_SCN_CNT_CODE 0x00000020
-#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
-#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
-
-#define EFI_IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
-#define EFI_IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
-#define EFI_IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
-#define EFI_IMAGE_SCN_LNK_COMDAT 0x00001000
-
-#define EFI_IMAGE_SCN_ALIGN_1BYTES 0x00100000
-#define EFI_IMAGE_SCN_ALIGN_2BYTES 0x00200000
-#define EFI_IMAGE_SCN_ALIGN_4BYTES 0x00300000
-#define EFI_IMAGE_SCN_ALIGN_8BYTES 0x00400000
-#define EFI_IMAGE_SCN_ALIGN_16BYTES 0x00500000
-#define EFI_IMAGE_SCN_ALIGN_32BYTES 0x00600000
-#define EFI_IMAGE_SCN_ALIGN_64BYTES 0x00700000
-
-#define EFI_IMAGE_SCN_MEM_DISCARDABLE 0x02000000
-#define EFI_IMAGE_SCN_MEM_NOT_CACHED 0x04000000
-#define EFI_IMAGE_SCN_MEM_NOT_PAGED 0x08000000
-#define EFI_IMAGE_SCN_MEM_SHARED 0x10000000
-#define EFI_IMAGE_SCN_MEM_EXECUTE 0x20000000
-#define EFI_IMAGE_SCN_MEM_READ 0x40000000
-#define EFI_IMAGE_SCN_MEM_WRITE 0x80000000
-
-///
-/// Symbol format.
-///
-#define EFI_IMAGE_SIZEOF_SYMBOL 18
-
-//
-// Section values.
-//
-// Symbols have a section number of the section in which they are
-// defined. Otherwise, section numbers have the following meanings:
-//
-#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 // Symbol is undefined or is common.
-#define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1 // Symbol is an absolute value.
-#define EFI_IMAGE_SYM_DEBUG (UINT16) -2 // Symbol is a special debug item.
-//
-// Type (fundamental) values.
-//
-#define EFI_IMAGE_SYM_TYPE_NULL 0 // no type.
-#define EFI_IMAGE_SYM_TYPE_VOID 1 //
-#define EFI_IMAGE_SYM_TYPE_CHAR 2 // type character.
-#define EFI_IMAGE_SYM_TYPE_SHORT 3 // type short integer.
-#define EFI_IMAGE_SYM_TYPE_INT 4
-#define EFI_IMAGE_SYM_TYPE_LONG 5
-#define EFI_IMAGE_SYM_TYPE_FLOAT 6
-#define EFI_IMAGE_SYM_TYPE_DOUBLE 7
-#define EFI_IMAGE_SYM_TYPE_STRUCT 8
-#define EFI_IMAGE_SYM_TYPE_UNION 9
-#define EFI_IMAGE_SYM_TYPE_ENUM 10 // enumeration.
-#define EFI_IMAGE_SYM_TYPE_MOE 11 // member of enumeration.
-#define EFI_IMAGE_SYM_TYPE_BYTE 12
-#define EFI_IMAGE_SYM_TYPE_WORD 13
-#define EFI_IMAGE_SYM_TYPE_UINT 14
-#define EFI_IMAGE_SYM_TYPE_DWORD 15
-
-//
-// Type (derived) values.
-//
-#define EFI_IMAGE_SYM_DTYPE_NULL 0 // no derived type.
-#define EFI_IMAGE_SYM_DTYPE_POINTER 1
-#define EFI_IMAGE_SYM_DTYPE_FUNCTION 2
-#define EFI_IMAGE_SYM_DTYPE_ARRAY 3
-
-//
-// Storage classes.
-//
-#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION (UINT8) -1
-#define EFI_IMAGE_SYM_CLASS_NULL 0
-#define EFI_IMAGE_SYM_CLASS_AUTOMATIC 1
-#define EFI_IMAGE_SYM_CLASS_EXTERNAL 2
-#define EFI_IMAGE_SYM_CLASS_STATIC 3
-#define EFI_IMAGE_SYM_CLASS_REGISTER 4
-#define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF 5
-#define EFI_IMAGE_SYM_CLASS_LABEL 6
-#define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
-#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
-#define EFI_IMAGE_SYM_CLASS_ARGUMENT 9
-#define EFI_IMAGE_SYM_CLASS_STRUCT_TAG 10
-#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
-#define EFI_IMAGE_SYM_CLASS_UNION_TAG 12
-#define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION 13
-#define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
-#define EFI_IMAGE_SYM_CLASS_ENUM_TAG 15
-#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
-#define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM 17
-#define EFI_IMAGE_SYM_CLASS_BIT_FIELD 18
-#define EFI_IMAGE_SYM_CLASS_BLOCK 100
-#define EFI_IMAGE_SYM_CLASS_FUNCTION 101
-#define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT 102
-#define EFI_IMAGE_SYM_CLASS_FILE 103
-#define EFI_IMAGE_SYM_CLASS_SECTION 104
-#define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
-
-//
-// type packing constants
-//
-#define EFI_IMAGE_N_BTMASK 017
-#define EFI_IMAGE_N_TMASK 060
-#define EFI_IMAGE_N_TMASK1 0300
-#define EFI_IMAGE_N_TMASK2 0360
-#define EFI_IMAGE_N_BTSHFT 4
-#define EFI_IMAGE_N_TSHIFT 2
-
-//
-// Communal selection types.
-//
-#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES 1
-#define EFI_IMAGE_COMDAT_SELECT_ANY 2
-#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE 3
-#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH 4
-#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
-
-#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
-#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
-#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
-
-///
-/// Relocation format.
-///
-typedef struct {
- UINT32 VirtualAddress;
- UINT32 SymbolTableIndex;
- UINT16 Type;
-} EFI_IMAGE_RELOCATION;
-
-#define EFI_IMAGE_SIZEOF_RELOCATION 10
-
-//
-// I386 relocation types.
-//
-#define EFI_IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
-#define EFI_IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included
-#define EFI_IMAGE_REL_I386_SEG12 09 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
-#define EFI_IMAGE_REL_I386_SECTION 010
-#define EFI_IMAGE_REL_I386_SECREL 011
-#define EFI_IMAGE_REL_I386_REL32 020 // PC-relative 32-bit reference to the symbols virtual address
-
-//
-// x64 processor relocation types.
-//
-#define IMAGE_REL_AMD64_ABSOLUTE 0x0000
-#define IMAGE_REL_AMD64_ADDR64 0x0001
-#define IMAGE_REL_AMD64_ADDR32 0x0002
-#define IMAGE_REL_AMD64_ADDR32NB 0x0003
-#define IMAGE_REL_AMD64_REL32 0x0004
-#define IMAGE_REL_AMD64_REL32_1 0x0005
-#define IMAGE_REL_AMD64_REL32_2 0x0006
-#define IMAGE_REL_AMD64_REL32_3 0x0007
-#define IMAGE_REL_AMD64_REL32_4 0x0008
-#define IMAGE_REL_AMD64_REL32_5 0x0009
-#define IMAGE_REL_AMD64_SECTION 0x000A
-#define IMAGE_REL_AMD64_SECREL 0x000B
-#define IMAGE_REL_AMD64_SECREL7 0x000C
-#define IMAGE_REL_AMD64_TOKEN 0x000D
-#define IMAGE_REL_AMD64_SREL32 0x000E
-#define IMAGE_REL_AMD64_PAIR 0x000F
-#define IMAGE_REL_AMD64_SSPAN32 0x0010
-
-///
-/// Based relocation format.
-///
-typedef struct {
- UINT32 VirtualAddress;
- UINT32 SizeOfBlock;
-} EFI_IMAGE_BASE_RELOCATION;
-
-#define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8
-
-//
-// Based relocation types.
-//
-#define EFI_IMAGE_REL_BASED_ABSOLUTE 0
-#define EFI_IMAGE_REL_BASED_HIGH 1
-#define EFI_IMAGE_REL_BASED_LOW 2
-#define EFI_IMAGE_REL_BASED_HIGHLOW 3
-#define EFI_IMAGE_REL_BASED_HIGHADJ 4
-#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5
-#define EFI_IMAGE_REL_BASED_ARM_MOV32A 5
-#define EFI_IMAGE_REL_BASED_RISCV_HI20 5
-#define EFI_IMAGE_REL_BASED_ARM_MOV32T 7
-#define EFI_IMAGE_REL_BASED_RISCV_LOW12I 7
-#define EFI_IMAGE_REL_BASED_RISCV_LOW12S 8
-#define EFI_IMAGE_REL_BASED_LOONGARCH32_MARK_LA 8
-#define EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA 8
-#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
-#define EFI_IMAGE_REL_BASED_DIR64 10
-
-
-///
-/// Line number format.
-///
-typedef struct {
- union {
- UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.
- UINT32 VirtualAddress; // Virtual address of line number.
- } Type;
- UINT16 Linenumber; // Line number.
-} EFI_IMAGE_LINENUMBER;
-
-#define EFI_IMAGE_SIZEOF_LINENUMBER 6
-
-//
-// Archive format.
-//
-#define EFI_IMAGE_ARCHIVE_START_SIZE 8
-#define EFI_IMAGE_ARCHIVE_START "!\n"
-#define EFI_IMAGE_ARCHIVE_END "`\n"
-#define EFI_IMAGE_ARCHIVE_PAD "\n"
-#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER "/ "
-#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
-
-typedef struct {
- UINT8 Name[16]; // File member name - `/' terminated.
- UINT8 Date[12]; // File member date - decimal.
- UINT8 UserID[6]; // File member user id - decimal.
- UINT8 GroupID[6]; // File member group id - decimal.
- UINT8 Mode[8]; // File member mode - octal.
- UINT8 Size[10]; // File member size - decimal.
- UINT8 EndHeader[2]; // String to end header.
-} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
-
-#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
-
-//
-// DLL support.
-//
-
-///
-/// DLL Export Format
-///
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 Name;
- UINT32 Base;
- UINT32 NumberOfFunctions;
- UINT32 NumberOfNames;
- UINT32 AddressOfFunctions;
- UINT32 AddressOfNames;
- UINT32 AddressOfNameOrdinals;
-} EFI_IMAGE_EXPORT_DIRECTORY;
-
-//
-// Based export types.
-//
-#define EFI_IMAGE_EXPORT_ORDINAL_BASE 1
-#define EFI_IMAGE_EXPORT_ADDR_SIZE 4
-#define EFI_IMAGE_EXPORT_ORDINAL_SIZE 2
-
-///
-/// DLL support.
-/// Import Format
-///
-typedef struct {
- UINT16 Hint;
- UINT8 Name[1];
-} EFI_IMAGE_IMPORT_BY_NAME;
-
-typedef struct {
- union {
- UINT32 Function;
- UINT32 Ordinal;
- EFI_IMAGE_IMPORT_BY_NAME *AddressOfData;
- } u1;
-} EFI_IMAGE_THUNK_DATA;
-
-#define EFI_IMAGE_ORDINAL_FLAG 0x80000000
-#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
-#define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
-
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT32 ForwarderChain;
- UINT32 Name;
- EFI_IMAGE_THUNK_DATA *FirstThunk;
-} EFI_IMAGE_IMPORT_DESCRIPTOR;
-
-///
-/// Debug Format
-///
-#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
-#define EFI_IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS 20
-
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 Type;
- UINT32 SizeOfData;
- UINT32 RVA;
- UINT32 FileOffset;
-} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
-
-#define CODEVIEW_SIGNATURE_NB10 0x3031424E // "NB10"
-typedef struct {
- UINT32 Signature; // "NB10"
- UINT32 Unknown;
- UINT32 Unknown2;
- UINT32 Unknown3;
- //
- // Filename of .PDB goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
-
-#define CODEVIEW_SIGNATURE_RSDS 0x53445352 // "RSDS"
-typedef struct {
- UINT32 Signature; // "RSDS"
- UINT32 Unknown;
- UINT32 Unknown2;
- UINT32 Unknown3;
- UINT32 Unknown4;
- UINT32 Unknown5;
- //
- // Filename of .PDB goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
-
-///
-/// Debug Data Structure defined by Apple Mach-O to Coff utility
-///
-#define CODEVIEW_SIGNATURE_MTOC SIGNATURE_32('M', 'T', 'O', 'C')
-typedef struct {
- UINT32 Signature; ///< "MTOC"
- EFI_GUID MachOUuid;
- //
- // Filename of .DLL (Mach-O with debug info) goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
-
-///
-/// Extended DLL Characteristics
-///
-#define EFI_IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT 0x0001
-#define EFI_IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT 0x0040
-
-typedef struct {
- UINT32 DllCharacteristicsEx;
-} EFI_IMAGE_DEBUG_EX_DLLCHARACTERISTICS_ENTRY;
-
-//
-// .pdata entries for X64
-//
-typedef struct {
- UINT32 FunctionStartAddress;
- UINT32 FunctionEndAddress;
- UINT32 UnwindInfoAddress;
-} RUNTIME_FUNCTION;
-
-typedef struct {
- UINT8 Version:3;
- UINT8 Flags:5;
- UINT8 SizeOfProlog;
- UINT8 CountOfUnwindCodes;
- UINT8 FrameRegister:4;
- UINT8 FrameRegisterOffset:4;
-} UNWIND_INFO;
-
-///
-/// Resource format.
-///
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT16 NumberOfNamedEntries;
- UINT16 NumberOfIdEntries;
- //
- // Array of EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY entries goes here.
- //
-} EFI_IMAGE_RESOURCE_DIRECTORY;
-
-///
-/// Resource directory entry format.
-///
-typedef struct {
- union {
- struct {
- UINT32 NameOffset:31;
- UINT32 NameIsString:1;
- } s;
- UINT32 Id;
- } u1;
- union {
- UINT32 OffsetToData;
- struct {
- UINT32 OffsetToDirectory:31;
- UINT32 DataIsDirectory:1;
- } s;
- } u2;
-} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;
-
-///
-/// Resource directory entry for string.
-///
-typedef struct {
- UINT16 Length;
- CHAR16 String[1];
-} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;
-
-///
-/// Resource directory entry for data array.
-///
-typedef struct {
- UINT32 OffsetToData;
- UINT32 Size;
- UINT32 CodePage;
- UINT32 Reserved;
-} EFI_IMAGE_RESOURCE_DATA_ENTRY;
-
-///
-/// Header format for TE images
-///
-typedef struct {
- UINT16 Signature; // signature for TE format = "VZ"
- UINT16 Machine; // from the original file header
- UINT8 NumberOfSections; // from the original file header
- UINT8 Subsystem; // from original optional header
- UINT16 StrippedSize; // how many bytes we removed from the header
- UINT32 AddressOfEntryPoint; // offset to entry point -- from original optional header
- UINT32 BaseOfCode; // from original image -- required for ITP debug
- UINT64 ImageBase; // from original file header
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; // only base relocation and debug directory
-} EFI_TE_IMAGE_HEADER;
-
-#define EFI_TE_IMAGE_HEADER_SIGNATURE 0x5A56 // "VZ"
-
-//
-// Data directory indexes in our TE image header
-//
-#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC 0
-#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG 1
-
-
-//
-// Union of PE32, PE32+, and TE headers
-//
-typedef union {
- EFI_IMAGE_NT_HEADERS32 Pe32;
- EFI_IMAGE_NT_HEADERS64 Pe32Plus;
- EFI_TE_IMAGE_HEADER Te;
-} EFI_IMAGE_OPTIONAL_HEADER_UNION;
-
-typedef union {
- EFI_IMAGE_NT_HEADERS32 *Pe32;
- EFI_IMAGE_NT_HEADERS64 *Pe32Plus;
- EFI_TE_IMAGE_HEADER *Te;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *Union;
-} EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION;
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci22.h b/BaseTools/Source/C/Include/IndustryStandard/pci22.h
deleted file mode 100644
index b43d74885e..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/pci22.h
+++ /dev/null
@@ -1,536 +0,0 @@
-/** @file
- Support for PCI 2.2 standard.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _PCI22_H
-#define _PCI22_H
-
-#define PCI_MAX_SEGMENT 0
-
-#define PCI_MAX_BUS 255
-
-#define PCI_MAX_DEVICE 31
-#define PCI_MAX_FUNC 7
-
-//
-// Command
-//
-#define PCI_VGA_PALETTE_SNOOP_DISABLED 0x20
-
-#pragma pack(push, 1)
-typedef struct {
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 Command;
- UINT16 Status;
- UINT8 RevisionID;
- UINT8 ClassCode[3];
- UINT8 CacheLineSize;
- UINT8 LatencyTimer;
- UINT8 HeaderType;
- UINT8 BIST;
-} PCI_DEVICE_INDEPENDENT_REGION;
-
-typedef struct {
- UINT32 Bar[6];
- UINT32 CISPtr;
- UINT16 SubsystemVendorID;
- UINT16 SubsystemID;
- UINT32 ExpansionRomBar;
- UINT8 CapabilityPtr;
- UINT8 Reserved1[3];
- UINT32 Reserved2;
- UINT8 InterruptLine;
- UINT8 InterruptPin;
- UINT8 MinGnt;
- UINT8 MaxLat;
-} PCI_DEVICE_HEADER_TYPE_REGION;
-
-typedef struct {
- PCI_DEVICE_INDEPENDENT_REGION Hdr;
- PCI_DEVICE_HEADER_TYPE_REGION Device;
-} PCI_TYPE00;
-
-typedef struct {
- UINT32 Bar[2];
- UINT8 PrimaryBus;
- UINT8 SecondaryBus;
- UINT8 SubordinateBus;
- UINT8 SecondaryLatencyTimer;
- UINT8 IoBase;
- UINT8 IoLimit;
- UINT16 SecondaryStatus;
- UINT16 MemoryBase;
- UINT16 MemoryLimit;
- UINT16 PrefetchableMemoryBase;
- UINT16 PrefetchableMemoryLimit;
- UINT32 PrefetchableBaseUpper32;
- UINT32 PrefetchableLimitUpper32;
- UINT16 IoBaseUpper16;
- UINT16 IoLimitUpper16;
- UINT8 CapabilityPtr;
- UINT8 Reserved[3];
- UINT32 ExpansionRomBAR;
- UINT8 InterruptLine;
- UINT8 InterruptPin;
- UINT16 BridgeControl;
-} PCI_BRIDGE_CONTROL_REGISTER;
-
-typedef struct {
- PCI_DEVICE_INDEPENDENT_REGION Hdr;
- PCI_BRIDGE_CONTROL_REGISTER Bridge;
-} PCI_TYPE01;
-
-typedef union {
- PCI_TYPE00 Device;
- PCI_TYPE01 Bridge;
-} PCI_TYPE_GENERIC;
-
-typedef struct {
- UINT32 CardBusSocketReg; // Cardbus Socket/ExCA Base
- // Address Register
- //
- UINT16 Reserved;
- UINT16 SecondaryStatus; // Secondary Status
- UINT8 PciBusNumber; // PCI Bus Number
- UINT8 CardBusBusNumber; // CardBus Bus Number
- UINT8 SubordinateBusNumber; // Subordinate Bus Number
- UINT8 CardBusLatencyTimer; // CardBus Latency Timer
- UINT32 MemoryBase0; // Memory Base Register 0
- UINT32 MemoryLimit0; // Memory Limit Register 0
- UINT32 MemoryBase1;
- UINT32 MemoryLimit1;
- UINT32 IoBase0;
- UINT32 IoLimit0; // I/O Base Register 0
- UINT32 IoBase1; // I/O Limit Register 0
- UINT32 IoLimit1;
- UINT8 InterruptLine; // Interrupt Line
- UINT8 InterruptPin; // Interrupt Pin
- UINT16 BridgeControl; // Bridge Control
-} PCI_CARDBUS_CONTROL_REGISTER;
-
-//
-// Definitions of PCI class bytes and manipulation macros.
-//
-#define PCI_CLASS_OLD 0x00
-#define PCI_CLASS_OLD_OTHER 0x00
-#define PCI_CLASS_OLD_VGA 0x01
-
-#define PCI_CLASS_MASS_STORAGE 0x01
-#define PCI_CLASS_MASS_STORAGE_SCSI 0x00
-#define PCI_CLASS_MASS_STORAGE_IDE 0x01 // obsolete
-#define PCI_CLASS_IDE 0x01
-#define PCI_CLASS_MASS_STORAGE_FLOPPY 0x02
-#define PCI_CLASS_MASS_STORAGE_IPI 0x03
-#define PCI_CLASS_MASS_STORAGE_RAID 0x04
-#define PCI_CLASS_MASS_STORAGE_OTHER 0x80
-
-#define PCI_CLASS_NETWORK 0x02
-#define PCI_CLASS_NETWORK_ETHERNET 0x00
-#define PCI_CLASS_ETHERNET 0x00 // obsolete
-#define PCI_CLASS_NETWORK_TOKENRING 0x01
-#define PCI_CLASS_NETWORK_FDDI 0x02
-#define PCI_CLASS_NETWORK_ATM 0x03
-#define PCI_CLASS_NETWORK_ISDN 0x04
-#define PCI_CLASS_NETWORK_OTHER 0x80
-
-#define PCI_CLASS_DISPLAY 0x03
-#define PCI_CLASS_DISPLAY_CTRL 0x03 // obsolete
-#define PCI_CLASS_DISPLAY_VGA 0x00
-#define PCI_CLASS_VGA 0x00 // obsolete
-#define PCI_CLASS_DISPLAY_XGA 0x01
-#define PCI_CLASS_DISPLAY_3D 0x02
-#define PCI_CLASS_DISPLAY_OTHER 0x80
-#define PCI_CLASS_DISPLAY_GFX 0x80
-#define PCI_CLASS_GFX 0x80 // obsolete
-#define PCI_CLASS_BRIDGE 0x06
-#define PCI_CLASS_BRIDGE_HOST 0x00
-#define PCI_CLASS_BRIDGE_ISA 0x01
-#define PCI_CLASS_ISA 0x01 // obsolete
-#define PCI_CLASS_BRIDGE_EISA 0x02
-#define PCI_CLASS_BRIDGE_MCA 0x03
-#define PCI_CLASS_BRIDGE_P2P 0x04
-#define PCI_CLASS_BRIDGE_PCMCIA 0x05
-#define PCI_CLASS_BRIDGE_NUBUS 0x06
-#define PCI_CLASS_BRIDGE_CARDBUS 0x07
-#define PCI_CLASS_BRIDGE_RACEWAY 0x08
-#define PCI_CLASS_BRIDGE_ISA_PDECODE 0x80
-#define PCI_CLASS_ISA_POSITIVE_DECODE 0x80 // obsolete
-
-#define PCI_CLASS_SCC 0x07 // Simple communications controllers
-#define PCI_SUBCLASS_SERIAL 0x00
-#define PCI_IF_GENERIC_XT 0x00
-#define PCI_IF_16450 0x01
-#define PCI_IF_16550 0x02
-#define PCI_IF_16650 0x03
-#define PCI_IF_16750 0x04
-#define PCI_IF_16850 0x05
-#define PCI_IF_16950 0x06
-#define PCI_SUBCLASS_PARALLEL 0x01
-#define PCI_IF_PARALLEL_PORT 0x00
-#define PCI_IF_BI_DIR_PARALLEL_PORT 0x01
-#define PCI_IF_ECP_PARALLEL_PORT 0x02
-#define PCI_IF_1284_CONTROLLER 0x03
-#define PCI_IF_1284_DEVICE 0xFE
-#define PCI_SUBCLASS_MULTIPORT_SERIAL 0x02
-#define PCI_SUBCLASS_MODEM 0x03
-#define PCI_IF_GENERIC_MODEM 0x00
-#define PCI_IF_16450_MODEM 0x01
-#define PCI_IF_16550_MODEM 0x02
-#define PCI_IF_16650_MODEM 0x03
-#define PCI_IF_16750_MODEM 0x04
-#define PCI_SUBCLASS_OTHER 0x80
-
-#define PCI_CLASS_SYSTEM_PERIPHERAL 0x08
-#define PCI_SUBCLASS_PIC 0x00
-#define PCI_IF_8259_PIC 0x00
-#define PCI_IF_ISA_PIC 0x01
-#define PCI_IF_EISA_PIC 0x02
-#define PCI_IF_APIC_CONTROLLER 0x10 // I/O APIC interrupt controller , 32 byte none-prefetchable memory.
-#define PCI_IF_APIC_CONTROLLER2 0x20
-#define PCI_SUBCLASS_TIMER 0x02
-#define PCI_IF_8254_TIMER 0x00
-#define PCI_IF_ISA_TIMER 0x01
-#define PCI_EISA_TIMER 0x02
-#define PCI_SUBCLASS_RTC 0x03
-#define PCI_IF_GENERIC_RTC 0x00
-#define PCI_IF_ISA_RTC 0x00
-#define PCI_SUBCLASS_PNP_CONTROLLER 0x04 // HotPlug Controller
-
-#define PCI_CLASS_INPUT_DEVICE 0x09
-#define PCI_SUBCLASS_KEYBOARD 0x00
-#define PCI_SUBCLASS_PEN 0x01
-#define PCI_SUBCLASS_MOUSE_CONTROLLER 0x02
-#define PCI_SUBCLASS_SCAN_CONTROLLER 0x03
-#define PCI_SUBCLASS_GAMEPORT 0x04
-
-#define PCI_CLASS_DOCKING_STATION 0x0A
-
-#define PCI_CLASS_PROCESSOR 0x0B
-#define PCI_SUBCLASS_PROC_386 0x00
-#define PCI_SUBCLASS_PROC_486 0x01
-#define PCI_SUBCLASS_PROC_PENTIUM 0x02
-#define PCI_SUBCLASS_PROC_ALPHA 0x10
-#define PCI_SUBCLASS_PROC_POWERPC 0x20
-#define PCI_SUBCLASS_PROC_MIPS 0x30
-#define PCI_SUBCLASS_PROC_CO_PORC 0x40 // Co-Processor
-
-#define PCI_CLASS_SERIAL 0x0C
-#define PCI_CLASS_SERIAL_FIREWIRE 0x00
-#define PCI_CLASS_SERIAL_ACCESS_BUS 0x01
-#define PCI_CLASS_SERIAL_SSA 0x02
-#define PCI_CLASS_SERIAL_USB 0x03
-#define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04
-#define PCI_CLASS_SERIAL_SMB 0x05
-
-#define PCI_CLASS_WIRELESS 0x0D
-#define PCI_SUBCLASS_IRDA 0x00
-#define PCI_SUBCLASS_IR 0x01
-#define PCI_SUBCLASS_RF 0x02
-
-#define PCI_CLASS_INTELLIGENT_IO 0x0E
-
-#define PCI_CLASS_SATELLITE 0x0F
-#define PCI_SUBCLASS_TV 0x01
-#define PCI_SUBCLASS_AUDIO 0x02
-#define PCI_SUBCLASS_VOICE 0x03
-#define PCI_SUBCLASS_DATA 0x04
-
-#define PCI_SECURITY_CONTROLLER 0x10 // Encryption and decryption controller
-#define PCI_SUBCLASS_NET_COMPUT 0x00
-#define PCI_SUBCLASS_ENTERTAINMENT 0x10
-
-#define PCI_CLASS_DPIO 0x11
-
-#define IS_CLASS1(_p, c) ((_p)->Hdr.ClassCode[2] == (c))
-#define IS_CLASS2(_p, c, s) (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s)))
-#define IS_CLASS3(_p, c, s, p) (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p)))
-
-#define IS_PCI_DISPLAY(_p) IS_CLASS1 (_p, PCI_CLASS_DISPLAY)
-#define IS_PCI_VGA(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0)
-#define IS_PCI_8514(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1)
-#define IS_PCI_GFX(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0)
-#define IS_PCI_OLD(_p) IS_CLASS1 (_p, PCI_CLASS_OLD)
-#define IS_PCI_OLD_VGA(_p) IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA)
-#define IS_PCI_IDE(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE)
-#define IS_PCI_SCSI(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0)
-#define IS_PCI_RAID(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0)
-#define IS_PCI_LPC(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0)
-#define IS_PCI_P2P(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0)
-#define IS_PCI_P2P_SUB(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1)
-#define IS_PCI_USB(_p) IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)
-
-#define HEADER_TYPE_DEVICE 0x00
-#define HEADER_TYPE_PCI_TO_PCI_BRIDGE 0x01
-#define HEADER_TYPE_CARDBUS_BRIDGE 0x02
-
-#define HEADER_TYPE_MULTI_FUNCTION 0x80
-#define HEADER_LAYOUT_CODE 0x7f
-
-#define IS_PCI_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))
-#define IS_CARDBUS_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))
-#define IS_PCI_MULTI_FUNC(_p) ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)
-
-#define PCI_DEVICE_ROMBAR 0x30
-#define PCI_BRIDGE_ROMBAR 0x38
-
-#define PCI_MAX_BAR 0x0006
-#define PCI_MAX_CONFIG_OFFSET 0x0100
-
-#define PCI_VENDOR_ID_OFFSET 0x00
-#define PCI_DEVICE_ID_OFFSET 0x02
-#define PCI_COMMAND_OFFSET 0x04
-#define PCI_PRIMARY_STATUS_OFFSET 0x06
-#define PCI_REVISION_ID_OFFSET 0x08
-#define PCI_CLASSCODE_OFFSET 0x09
-#define PCI_CACHELINE_SIZE_OFFSET 0x0C
-#define PCI_LATENCY_TIMER_OFFSET 0x0D
-#define PCI_HEADER_TYPE_OFFSET 0x0E
-#define PCI_BIST_OFFSET 0x0F
-#define PCI_BASE_ADDRESSREG_OFFSET 0x10
-#define PCI_CARDBUS_CIS_OFFSET 0x28
-#define PCI_SVID_OFFSET 0x2C // SubSystem Vendor id
-#define PCI_SUBSYSTEM_VENDOR_ID_OFFSET 0x2C
-#define PCI_SID_OFFSET 0x2E // SubSystem ID
-#define PCI_SUBSYSTEM_ID_OFFSET 0x2E
-#define PCI_EXPANSION_ROM_BASE 0x30
-#define PCI_CAPBILITY_POINTER_OFFSET 0x34
-#define PCI_INT_LINE_OFFSET 0x3C // Interrupt Line Register
-#define PCI_INT_PIN_OFFSET 0x3D // Interrupt Pin Register
-#define PCI_MAXGNT_OFFSET 0x3E // Max Grant Register
-#define PCI_MAXLAT_OFFSET 0x3F // Max Latency Register
-
-#define PCI_BRIDGE_CONTROL_REGISTER_OFFSET 0x3E
-#define PCI_BRIDGE_STATUS_REGISTER_OFFSET 0x1E
-
-#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET 0x18
-#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET 0x19
-#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET 0x1a
-
-typedef union {
- struct {
- UINT32 Reg : 8;
- UINT32 Func : 3;
- UINT32 Dev : 5;
- UINT32 Bus : 8;
- UINT32 Reserved : 7;
- UINT32 Enable : 1;
- } Bits;
- UINT32 Uint32;
-} PCI_CONFIG_ACCESS_CF8;
-
-#pragma pack()
-
-#define PCI_EXPANSION_ROM_HEADER_SIGNATURE 0xaa55
-#define PCI_DATA_STRUCTURE_SIGNATURE SIGNATURE_32 ('P', 'C', 'I', 'R')
-#define PCI_CODE_TYPE_PCAT_IMAGE 0x00
-#define PCI_CODE_TYPE_EFI_IMAGE 0x03
-#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED 0x0001
-
-#define EFI_PCI_COMMAND_IO_SPACE 0x0001
-#define EFI_PCI_COMMAND_MEMORY_SPACE 0x0002
-#define EFI_PCI_COMMAND_BUS_MASTER 0x0004
-#define EFI_PCI_COMMAND_SPECIAL_CYCLE 0x0008
-#define EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE 0x0010
-#define EFI_PCI_COMMAND_VGA_PALETTE_SNOOP 0x0020
-#define EFI_PCI_COMMAND_PARITY_ERROR_RESPOND 0x0040
-#define EFI_PCI_COMMAND_STEPPING_CONTROL 0x0080
-#define EFI_PCI_COMMAND_SERR 0x0100
-#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK 0x0200
-
-#define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE 0x0001
-#define EFI_PCI_BRIDGE_CONTROL_SERR 0x0002
-#define EFI_PCI_BRIDGE_CONTROL_ISA 0x0004
-#define EFI_PCI_BRIDGE_CONTROL_VGA 0x0008
-#define EFI_PCI_BRIDGE_CONTROL_VGA_16 0x0010
-#define EFI_PCI_BRIDGE_CONTROL_MASTER_ABORT 0x0020
-#define EFI_PCI_BRIDGE_CONTROL_RESET_SECONDARY_BUS 0x0040
-#define EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK 0x0080
-#define EFI_PCI_BRIDGE_CONTROL_PRIMARY_DISCARD_TIMER 0x0100
-#define EFI_PCI_BRIDGE_CONTROL_SECONDARY_DISCARD_TIMER 0x0200
-#define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS 0x0400
-#define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR 0x0800
-
-//
-// Following are the PCI-CARDBUS bridge control bit
-//
-#define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE 0x0080
-#define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE 0x0100
-#define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE 0x0200
-#define EFI_PCI_BRIDGE_CONTROL_WRITE_POSTING_ENABLE 0x0400
-
-//
-// Following are the PCI status control bit
-//
-#define EFI_PCI_STATUS_CAPABILITY 0x0010
-#define EFI_PCI_STATUS_66MZ_CAPABLE 0x0020
-#define EFI_PCI_FAST_BACK_TO_BACK_CAPABLE 0x0080
-#define EFI_PCI_MASTER_DATA_PARITY_ERROR 0x0100
-
-#define EFI_PCI_CAPABILITY_PTR 0x34
-#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14
-
-#pragma pack(1)
-typedef struct {
- UINT16 Signature; // 0xaa55
- UINT8 Reserved[0x16];
- UINT16 PcirOffset;
-} PCI_EXPANSION_ROM_HEADER;
-
-typedef struct {
- UINT16 Signature; // 0xaa55
- UINT8 Size512;
- UINT8 InitEntryPoint[3];
- UINT8 Reserved[0x12];
- UINT16 PcirOffset;
-} EFI_LEGACY_EXPANSION_ROM_HEADER;
-
-typedef struct {
- UINT32 Signature; // "PCIR"
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 Reserved0;
- UINT16 Length;
- UINT8 Revision;
- UINT8 ClassCode[3];
- UINT16 ImageLength;
- UINT16 CodeRevision;
- UINT8 CodeType;
- UINT8 Indicator;
- UINT16 Reserved1;
-} PCI_DATA_STRUCTURE;
-
-//
-// PCI Capability List IDs and records
-//
-#define EFI_PCI_CAPABILITY_ID_PMI 0x01
-#define EFI_PCI_CAPABILITY_ID_AGP 0x02
-#define EFI_PCI_CAPABILITY_ID_VPD 0x03
-#define EFI_PCI_CAPABILITY_ID_SLOTID 0x04
-#define EFI_PCI_CAPABILITY_ID_MSI 0x05
-#define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06
-#define EFI_PCI_CAPABILITY_ID_PCIX 0x07
-
-typedef struct {
- UINT8 CapabilityID;
- UINT8 NextItemPtr;
-} EFI_PCI_CAPABILITY_HDR;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_PMI
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 PMC;
- UINT16 PMCSR;
- UINT8 BridgeExtention;
- UINT8 Data;
-} EFI_PCI_CAPABILITY_PMI;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_AGP
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT8 Rev;
- UINT8 Reserved;
- UINT32 Status;
- UINT32 Command;
-} EFI_PCI_CAPABILITY_AGP;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_VPD
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 AddrReg;
- UINT32 DataReg;
-} EFI_PCI_CAPABILITY_VPD;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_SLOTID
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT8 ExpnsSlotReg;
- UINT8 ChassisNo;
-} EFI_PCI_CAPABILITY_SLOTID;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_MSI
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 MsgCtrlReg;
- UINT32 MsgAddrReg;
- UINT16 MsgDataReg;
-} EFI_PCI_CAPABILITY_MSI32;
-
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 MsgCtrlReg;
- UINT32 MsgAddrRegLsdw;
- UINT32 MsgAddrRegMsdw;
- UINT16 MsgDataReg;
-} EFI_PCI_CAPABILITY_MSI64;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- //
- // not finished - fields need to go here
- //
-} EFI_PCI_CAPABILITY_HOTPLUG;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_PCIX
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 CommandReg;
- UINT32 StatusReg;
-} EFI_PCI_CAPABILITY_PCIX;
-
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 SecStatusReg;
- UINT32 StatusReg;
- UINT32 SplitTransCtrlRegUp;
- UINT32 SplitTransCtrlRegDn;
-} EFI_PCI_CAPABILITY_PCIX_BRDG;
-
-#define DEVICE_ID_NOCARE 0xFFFF
-
-#define PCI_ACPI_UNUSED 0
-#define PCI_BAR_NOCHANGE 0
-#define PCI_BAR_OLD_ALIGN 0xFFFFFFFFFFFFFFFFULL
-#define PCI_BAR_EVEN_ALIGN 0xFFFFFFFFFFFFFFFEULL
-#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
-#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
-
-#define PCI_BAR_IDX0 0x00
-#define PCI_BAR_IDX1 0x01
-#define PCI_BAR_IDX2 0x02
-#define PCI_BAR_IDX3 0x03
-#define PCI_BAR_IDX4 0x04
-#define PCI_BAR_IDX5 0x05
-#define PCI_BAR_ALL 0xFF
-
-#pragma pack(pop)
-
-//
-// NOTE: The following header files are included here for
-// compatibility consideration.
-//
-#include "pci23.h"
-#include "pci30.h"
-#include "EfiPci.h"
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci23.h b/BaseTools/Source/C/Include/IndustryStandard/pci23.h
deleted file mode 100644
index 7b8cea3e8f..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/pci23.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/** @file
- Support for PCI 2.3 standard.
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _PCI23_H
-#define _PCI23_H
-
-//#include "pci22.h"
-
-#define PCI_EXP_MAX_CONFIG_OFFSET 0x1000
-#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci30.h b/BaseTools/Source/C/Include/IndustryStandard/pci30.h
deleted file mode 100644
index e39df6da76..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/pci30.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- Support for PCI 3.0 standard.
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _PCI30_H
-#define _PCI30_H
-
-//#include "pci23.h"
-
-#define PCI_CLASS_MASS_STORAGE_SATADPA 0x06
-
-#pragma pack(push, 1)
-
-typedef struct {
- UINT32 Signature; // "PCIR"
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 DeviceListOffset;
- UINT16 Length;
- UINT8 Revision;
- UINT8 ClassCode[3];
- UINT16 ImageLength;
- UINT16 CodeRevision;
- UINT8 CodeType;
- UINT8 Indicator;
- UINT16 MaxRuntimeImageLength;
- UINT16 ConfigUtilityCodeHeaderOffset;
- UINT16 DMTFCLPEntryPointOffset;
-} PCI_3_0_DATA_STRUCTURE;
-
-#pragma pack(pop)
-
-#endif
diff --git a/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h b/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
deleted file mode 100644
index 0267859dee..0000000000
--- a/BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for LoongArch
-
- Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#ifndef PROCESSOR_BIND_H_
-#define PROCESSOR_BIND_H_
-
-//
-// Define the processor type so other code can make processor based choices
-//
-#define MDE_CPU_LOONGARCH64
-
-#define EFIAPI
-
-//
-// Make sure we are using the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-//
-// Use ANSI C 2000 stdint.h integer width declarations
-//
-#include
-typedef uint8_t BOOLEAN;
-typedef int8_t INT8;
-typedef uint8_t UINT8;
-typedef int16_t INT16;
-typedef uint16_t UINT16;
-typedef int32_t INT32;
-typedef uint32_t UINT32;
-typedef int64_t INT64;
-typedef uint64_t UINT64;
-typedef char CHAR8;
-typedef uint16_t CHAR16;
-
-//
-// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
-// 8 bytes on supported 64-bit processor instructions)
-//
-typedef UINT64 UINTN;
-
-//
-// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
-// 8 bytes on supported 64-bit processor instructions)
-//
-typedef INT64 INTN;
-
-//
-// Processor specific defines
-//
-
-//
-// A value of native width with the highest bit set.
-//
-#define MAX_BIT 0x8000000000000000ULL
-//
-// A value of native width with the two highest bits set.
-//
-#define MAX_2_BITS 0xC000000000000000ULL
-
-#if defined (__GNUC__)
-//
-// For GNU assembly code, .global or .globl can declare global symbols.
-// Define this macro to unify the usage.
-//
-#define ASM_GLOBAL .globl
-#endif
-
-//
-// The stack alignment required for LoongArch
-//
-#define CPU_STACK_ALIGNMENT 16
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/DevicePath.h b/BaseTools/Source/C/Include/Protocol/DevicePath.h
deleted file mode 100644
index 27f8135797..0000000000
--- a/BaseTools/Source/C/Include/Protocol/DevicePath.h
+++ /dev/null
@@ -1,1404 +0,0 @@
-/** @file
- The device path protocol as defined in UEFI 2.0.
-
- The device path represents a programmatic path to a device,
- from a software point of view. The path must persist from boot to boot, so
- it can not contain things like PCI bus numbers that change from boot to boot.
-
-Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __EFI_DEVICE_PATH_H__
-#define __EFI_DEVICE_PATH_H__
-
-#include
-#include
-#include
-
-///
-/// Device Path protocol.
-///
-#define EFI_DEVICE_PATH_PROTOCOL_GUID \
- { \
- 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
- }
-
-///
-/// Device Path guid definition for backward-compatible with EFI1.1.
-///
-#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
-
-#pragma pack(1)
-
-#if defined(_MSC_EXTENSIONS)
-//
-// Disable warning when last field of data structure is a zero sized array.
-//
-#pragma warning ( disable : 4200 )
-#endif
-
-/**
- This protocol can be used on any device handle to obtain generic path/location
- information concerning the physical device or logical device. If the handle does
- not logically map to a physical device, the handle may not necessarily support
- the device path protocol. The device path describes the location of the device
- the handle is for. The size of the Device Path can be determined from the structures
- that make up the Device Path.
-**/
-typedef struct {
- UINT8 Type; ///< 0x01 Hardware Device Path.
- ///< 0x02 ACPI Device Path.
- ///< 0x03 Messaging Device Path.
- ///< 0x04 Media Device Path.
- ///< 0x05 BIOS Boot Specification Device Path.
- ///< 0x7F End of Hardware Device Path.
-
- UINT8 SubType; ///< Varies by Type
- ///< 0xFF End Entire Device Path, or
- ///< 0x01 End This Instance of a Device Path and start a new
- ///< Device Path.
-
- UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
- ///< type of data. Size of data is included in Length.
-
-} EFI_DEVICE_PATH_PROTOCOL;
-
-///
-/// Device Path protocol definition for backward-compatible with EFI1.1.
-///
-typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
-
-///
-/// Hardware Device Paths.
-///
-#define HARDWARE_DEVICE_PATH 0x01
-
-///
-/// PCI Device Path SubType.
-///
-#define HW_PCI_DP 0x01
-
-///
-/// PCI Device Path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// PCI Function Number.
- ///
- UINT8 Function;
- ///
- /// PCI Device Number.
- ///
- UINT8 Device;
-} PCI_DEVICE_PATH;
-
-///
-/// PCCARD Device Path SubType.
-///
-#define HW_PCCARD_DP 0x02
-
-///
-/// PCCARD Device Path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Function Number (0 = First Function).
- ///
- UINT8 FunctionNumber;
-} PCCARD_DEVICE_PATH;
-
-///
-/// Memory Mapped Device Path SubType.
-///
-#define HW_MEMMAP_DP 0x03
-
-///
-/// Memory Mapped Device Path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// EFI_MEMORY_TYPE
- ///
- UINT32 MemoryType;
- ///
- /// Starting Memory Address.
- ///
- EFI_PHYSICAL_ADDRESS StartingAddress;
- ///
- /// Ending Memory Address.
- ///
- EFI_PHYSICAL_ADDRESS EndingAddress;
-} MEMMAP_DEVICE_PATH;
-
-///
-/// Hardware Vendor Device Path SubType.
-///
-#define HW_VENDOR_DP 0x04
-
-///
-/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
-/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
-/// contents on the n bytes that follow in the Vendor Device Path node.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Vendor-assigned GUID that defines the data that follows.
- ///
- EFI_GUID Guid;
- ///
- /// Vendor-defined variable size data.
- ///
-} VENDOR_DEVICE_PATH;
-
-///
-/// Controller Device Path SubType.
-///
-#define HW_CONTROLLER_DP 0x05
-
-///
-/// Controller Device Path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Controller number.
- ///
- UINT32 ControllerNumber;
-} CONTROLLER_DEVICE_PATH;
-
-///
-/// BMC Device Path SubType.
-///
-#define HW_BMC_DP 0x06
-
-///
-/// BMC Device Path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Interface Type.
- ///
- UINT8 InterfaceType;
- ///
- /// Base Address.
- ///
- UINT8 BaseAddress[8];
-} BMC_DEVICE_PATH;
-
-///
-/// ACPI Device Paths.
-///
-#define ACPI_DEVICE_PATH 0x02
-
-///
-/// ACPI Device Path SubType.
-///
-#define ACPI_DP 0x01
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Device's PnP hardware ID stored in a numeric 32-bit
- /// compressed EISA-type ID. This value must match the
- /// corresponding _HID in the ACPI name space.
- ///
- UINT32 HID;
- ///
- /// Unique ID that is required by ACPI if two devices have the
- /// same _HID. This value must also match the corresponding
- /// _UID/_HID pair in the ACPI name space. Only the 32-bit
- /// numeric value type of _UID is supported. Thus, strings must
- /// not be used for the _UID in the ACPI name space.
- ///
- UINT32 UID;
-} ACPI_HID_DEVICE_PATH;
-
-///
-/// Expanded ACPI Device Path SubType.
-///
-#define ACPI_EXTENDED_DP 0x02
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Device's PnP hardware ID stored in a numeric 32-bit
- /// compressed EISA-type ID. This value must match the
- /// corresponding _HID in the ACPI name space.
- ///
- UINT32 HID;
- ///
- /// Unique ID that is required by ACPI if two devices have the
- /// same _HID. This value must also match the corresponding
- /// _UID/_HID pair in the ACPI name space.
- ///
- UINT32 UID;
- ///
- /// Device's compatible PnP hardware ID stored in a numeric
- /// 32-bit compressed EISA-type ID. This value must match at
- /// least one of the compatible device IDs returned by the
- /// corresponding _CID in the ACPI name space.
- ///
- UINT32 CID;
- ///
- /// Optional variable length _HIDSTR.
- /// Optional variable length _UIDSTR.
- /// Optional variable length _CIDSTR.
- ///
-} ACPI_EXTENDED_HID_DEVICE_PATH;
-
-//
-// EISA ID Macro
-// EISA ID Definition 32-bits
-// bits[15:0] - three character compressed ASCII EISA ID.
-// bits[31:16] - binary number
-// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
-//
-#define PNP_EISA_ID_CONST 0x41d0
-#define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))
-#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
-#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
-
-#define PNP_EISA_ID_MASK 0xffff
-#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
-
-///
-/// ACPI _ADR Device Path SubType.
-///
-#define ACPI_ADR_DP 0x03
-
-///
-/// The _ADR device path is used to contain video output device attributes to support the Graphics
-/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
-/// devices are displaying the same output.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// _ADR value. For video output devices the value of this
- /// field comes from Table B-2 of the ACPI 3.0 specification. At
- /// least one _ADR value is required.
- ///
- UINT32 ADR;
- //
- // This device path may optionally contain more than one _ADR entry.
- //
-} ACPI_ADR_DEVICE_PATH;
-
-#define ACPI_ADR_DISPLAY_TYPE_OTHER 0
-#define ACPI_ADR_DISPLAY_TYPE_VGA 1
-#define ACPI_ADR_DISPLAY_TYPE_TV 2
-#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3
-#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4
-
-#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
- ((UINT32)( ((UINT32)((_DeviceIdScheme) & 0x1) << 31) | \
- (((_HeadId) & 0x7) << 18) | \
- (((_NonVgaOutput) & 0x1) << 17) | \
- (((_BiosCanDetect) & 0x1) << 16) | \
- (((_VendorInfo) & 0xf) << 12) | \
- (((_Type) & 0xf) << 8) | \
- (((_Port) & 0xf) << 4) | \
- ((_Index) & 0xf) ))
-
-///
-/// Messaging Device Paths.
-/// This Device Path is used to describe the connection of devices outside the resource domain of the
-/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
-/// information like networking protocol IP addresses.
-///
-#define MESSAGING_DEVICE_PATH 0x03
-
-///
-/// ATAPI Device Path SubType
-///
-#define MSG_ATAPI_DP 0x01
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Set to zero for primary, or one for secondary.
- ///
- UINT8 PrimarySecondary;
- ///
- /// Set to zero for master, or one for slave mode.
- ///
- UINT8 SlaveMaster;
- ///
- /// Logical Unit Number.
- ///
- UINT16 Lun;
-} ATAPI_DEVICE_PATH;
-
-///
-/// SCSI Device Path SubType.
-///
-#define MSG_SCSI_DP 0x02
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Target ID on the SCSI bus (PUN).
- ///
- UINT16 Pun;
- ///
- /// Logical Unit Number (LUN).
- ///
- UINT16 Lun;
-} SCSI_DEVICE_PATH;
-
-///
-/// Fibre Channel SubType.
-///
-#define MSG_FIBRECHANNEL_DP 0x03
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Reserved for the future.
- ///
- UINT32 Reserved;
- ///
- /// Fibre Channel World Wide Number.
- ///
- UINT64 WWN;
- ///
- /// Fibre Channel Logical Unit Number.
- ///
- UINT64 Lun;
-} FIBRECHANNEL_DEVICE_PATH;
-
-///
-/// Fibre Channel Ex SubType.
-///
-#define MSG_FIBRECHANNELEX_DP 0x15
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Reserved for the future.
- ///
- UINT32 Reserved;
- ///
- /// 8 byte array containing Fibre Channel End Device Port Name.
- ///
- UINT8 WWN[8];
- ///
- /// 8 byte array containing Fibre Channel Logical Unit Number.
- ///
- UINT8 Lun[8];
-} FIBRECHANNELEX_DEVICE_PATH;
-
-///
-/// 1394 Device Path SubType
-///
-#define MSG_1394_DP 0x04
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Reserved for the future.
- ///
- UINT32 Reserved;
- ///
- /// 1394 Global Unique ID (GUID).
- ///
- UINT64 Guid;
-} F1394_DEVICE_PATH;
-
-///
-/// USB Device Path SubType.
-///
-#define MSG_USB_DP 0x05
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// USB Parent Port Number.
- ///
- UINT8 ParentPortNumber;
- ///
- /// USB Interface Number.
- ///
- UINT8 InterfaceNumber;
-} USB_DEVICE_PATH;
-
-///
-/// USB Class Device Path SubType.
-///
-#define MSG_USB_CLASS_DP 0x0f
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
- /// match any Vendor ID.
- ///
- UINT16 VendorId;
- ///
- /// Product ID assigned by USB-IF. A value of 0xFFFF will
- /// match any Product ID.
- ///
- UINT16 ProductId;
- ///
- /// The class code assigned by the USB-IF. A value of 0xFF
- /// will match any class code.
- ///
- UINT8 DeviceClass;
- ///
- /// The subclass code assigned by the USB-IF. A value of
- /// 0xFF will match any subclass code.
- ///
- UINT8 DeviceSubClass;
- ///
- /// The protocol code assigned by the USB-IF. A value of
- /// 0xFF will match any protocol code.
- ///
- UINT8 DeviceProtocol;
-} USB_CLASS_DEVICE_PATH;
-
-///
-/// USB WWID Device Path SubType.
-///
-#define MSG_USB_WWID_DP 0x10
-
-///
-/// This device path describes a USB device using its serial number.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// USB interface number.
- ///
- UINT16 InterfaceNumber;
- ///
- /// USB vendor id of the device.
- ///
- UINT16 VendorId;
- ///
- /// USB product id of the device.
- ///
- UINT16 ProductId;
- ///
- /// Last 64-or-fewer UTF-16 characters of the USB
- /// serial number. The length of the string is
- /// determined by the Length field less the offset of the
- /// Serial Number field (10)
- ///
- /// CHAR16 SerialNumber[...];
-} USB_WWID_DEVICE_PATH;
-
-///
-/// Device Logical Unit SubType.
-///
-#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Logical Unit Number for the interface.
- ///
- UINT8 Lun;
-} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
-
-///
-/// SATA Device Path SubType.
-///
-#define MSG_SATA_DP 0x12
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// The HBA port number that facilitates the connection to the
- /// device or a port multiplier. The value 0xFFFF is reserved.
- ///
- UINT16 HBAPortNumber;
- ///
- /// The Port multiplier port number that facilitates the connection
- /// to the device. Must be set to 0xFFFF if the device is directly
- /// connected to the HBA.
- ///
- UINT16 PortMultiplierPortNumber;
- ///
- /// Logical Unit Number.
- ///
- UINT16 Lun;
-} SATA_DEVICE_PATH;
-
-///
-/// Flag for if the device is directly connected to the HBA.
-///
-#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
-
-///
-/// I2O Device Path SubType.
-///
-#define MSG_I2O_DP 0x06
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Target ID (TID) for a device.
- ///
- UINT32 Tid;
-} I2O_DEVICE_PATH;
-
-///
-/// MAC Address Device Path SubType.
-///
-#define MSG_MAC_ADDR_DP 0x0b
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// The MAC address for a network interface padded with 0s.
- ///
- EFI_MAC_ADDRESS MacAddress;
- ///
- /// Network interface type(i.e. 802.3, FDDI).
- ///
- UINT8 IfType;
-} MAC_ADDR_DEVICE_PATH;
-
-///
-/// IPv4 Device Path SubType
-///
-#define MSG_IPv4_DP 0x0c
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// The local IPv4 address.
- ///
- EFI_IPv4_ADDRESS LocalIpAddress;
- ///
- /// The remote IPv4 address.
- ///
- EFI_IPv4_ADDRESS RemoteIpAddress;
- ///
- /// The local port number.
- ///
- UINT16 LocalPort;
- ///
- /// The remote port number.
- ///
- UINT16 RemotePort;
- ///
- /// The network protocol(i.e. UDP, TCP).
- ///
- UINT16 Protocol;
- ///
- /// 0x00 - The Source IP Address was assigned though DHCP.
- /// 0x01 - The Source IP Address is statically bound.
- ///
- BOOLEAN StaticIpAddress;
- ///
- /// The gateway IP address
- ///
- EFI_IPv4_ADDRESS GatewayIpAddress;
- ///
- /// The subnet mask
- ///
- EFI_IPv4_ADDRESS SubnetMask;
-} IPv4_DEVICE_PATH;
-
-///
-/// IPv6 Device Path SubType.
-///
-#define MSG_IPv6_DP 0x0d
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// The local IPv6 address.
- ///
- EFI_IPv6_ADDRESS LocalIpAddress;
- ///
- /// The remote IPv6 address.
- ///
- EFI_IPv6_ADDRESS RemoteIpAddress;
- ///
- /// The local port number.
- ///
- UINT16 LocalPort;
- ///
- /// The remote port number.
- ///
- UINT16 RemotePort;
- ///
- /// The network protocol(i.e. UDP, TCP).
- ///
- UINT16 Protocol;
- ///
- /// 0x00 - The Local IP Address was manually configured.
- /// 0x01 - The Local IP Address is assigned through IPv6
- /// stateless auto-configuration.
- /// 0x02 - The Local IP Address is assigned through IPv6
- /// stateful configuration.
- ///
- UINT8 IpAddressOrigin;
- ///
- /// The prefix length
- ///
- UINT8 PrefixLength;
- ///
- /// The gateway IP address
- ///
- EFI_IPv6_ADDRESS GatewayIpAddress;
-} IPv6_DEVICE_PATH;
-
-///
-/// InfiniBand Device Path SubType.
-///
-#define MSG_INFINIBAND_DP 0x09
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Flags to help identify/manage InfiniBand device path elements:
- /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
- /// Bit 1 - Extend Boot Environment.
- /// Bit 2 - Console Protocol.
- /// Bit 3 - Storage Protocol.
- /// Bit 4 - Network Protocol.
- /// All other bits are reserved.
- ///
- UINT32 ResourceFlags;
- ///
- /// 128-bit Global Identifier for remote fabric port.
- ///
- UINT8 PortGid[16];
- ///
- /// 64-bit unique identifier to remote IOC or server process.
- /// Interpretation of field specified by Resource Flags (bit 0).
- ///
- UINT64 ServiceId;
- ///
- /// 64-bit persistent ID of remote IOC port.
- ///
- UINT64 TargetPortId;
- ///
- /// 64-bit persistent ID of remote device.
- ///
- UINT64 DeviceId;
-} INFINIBAND_DEVICE_PATH;
-
-#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
-#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
-#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
-#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
-#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
-
-///
-/// UART Device Path SubType.
-///
-#define MSG_UART_DP 0x0e
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Reserved.
- ///
- UINT32 Reserved;
- ///
- /// The baud rate setting for the UART style device. A value of 0
- /// means that the device's default baud rate will be used.
- ///
- UINT64 BaudRate;
- ///
- /// The number of data bits for the UART style device. A value
- /// of 0 means that the device's default number of data bits will be used.
- ///
- UINT8 DataBits;
- ///
- /// The parity setting for the UART style device.
- /// Parity 0x00 - Default Parity.
- /// Parity 0x01 - No Parity.
- /// Parity 0x02 - Even Parity.
- /// Parity 0x03 - Odd Parity.
- /// Parity 0x04 - Mark Parity.
- /// Parity 0x05 - Space Parity.
- ///
- UINT8 Parity;
- ///
- /// The number of stop bits for the UART style device.
- /// Stop Bits 0x00 - Default Stop Bits.
- /// Stop Bits 0x01 - 1 Stop Bit.
- /// Stop Bits 0x02 - 1.5 Stop Bits.
- /// Stop Bits 0x03 - 2 Stop Bits.
- ///
- UINT8 StopBits;
-} UART_DEVICE_PATH;
-
-///
-/// NVDIMM Namespace Device Path SubType.
-///
-#define NVDIMM_NAMESPACE_DP 0x20
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Namespace unique label identifier UUID.
- ///
- EFI_GUID Uuid;
-} NVDIMM_NAMESPACE_DEVICE_PATH;
-
-//
-// Use VENDOR_DEVICE_PATH struct
-//
-#define MSG_VENDOR_DP 0x0a
-typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;
-
-#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID
-#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID
-#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
-#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID
-
-///
-/// A new device path node is defined to declare flow control characteristics.
-/// UART Flow Control Messaging Device Path
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
- ///
- EFI_GUID Guid;
- ///
- /// Bitmap of supported flow control types.
- /// Bit 0 set indicates hardware flow control.
- /// Bit 1 set indicates Xon/Xoff flow control.
- /// All other bits are reserved and are clear.
- ///
- UINT32 FlowControlMap;
-} UART_FLOW_CONTROL_DEVICE_PATH;
-
-#define UART_FLOW_CONTROL_HARDWARE 0x00000001
-#define UART_FLOW_CONTROL_XON_XOFF 0x00000010
-
-#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID
-///
-/// Serial Attached SCSI (SAS) Device Path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// DEVICE_PATH_MESSAGING_SAS GUID.
- ///
- EFI_GUID Guid;
- ///
- /// Reserved for future use.
- ///
- UINT32 Reserved;
- ///
- /// SAS Address for Serial Attached SCSI Target.
- ///
- UINT64 SasAddress;
- ///
- /// SAS Logical Unit Number.
- ///
- UINT64 Lun;
- ///
- /// More Information about the device and its interconnect.
- ///
- UINT16 DeviceTopology;
- ///
- /// Relative Target Port (RTP).
- ///
- UINT16 RelativeTargetPort;
-} SAS_DEVICE_PATH;
-
-///
-/// Serial Attached SCSI (SAS) Ex Device Path SubType
-///
-#define MSG_SASEX_DP 0x16
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
- ///
- UINT8 SasAddress[8];
- ///
- /// 8-byte array of the SAS Logical Unit Number.
- ///
- UINT8 Lun[8];
- ///
- /// More Information about the device and its interconnect.
- ///
- UINT16 DeviceTopology;
- ///
- /// Relative Target Port (RTP).
- ///
- UINT16 RelativeTargetPort;
-} SASEX_DEVICE_PATH;
-
-///
-/// NvmExpress Namespace Device Path SubType.
-///
-#define MSG_NVME_NAMESPACE_DP 0x17
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- UINT32 NamespaceId;
- UINT64 NamespaceUuid;
-} NVME_NAMESPACE_DEVICE_PATH;
-
-///
-/// DNS Device Path SubType
-///
-#define MSG_DNS_DP 0x1F
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Indicates the DNS server address is IPv4 or IPv6 address.
- ///
- UINT8 IsIPv6;
- ///
- /// Instance of the DNS server address.
- ///
- EFI_IP_ADDRESS DnsServerIp[];
-} DNS_DEVICE_PATH;
-
-///
-/// Uniform Resource Identifiers (URI) Device Path SubType
-///
-#define MSG_URI_DP 0x18
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Instance of the URI pursuant to RFC 3986.
- ///
- CHAR8 Uri[];
-} URI_DEVICE_PATH;
-
-///
-/// Universal Flash Storage (UFS) Device Path SubType.
-///
-#define MSG_UFS_DP 0x19
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Target ID on the UFS bus (PUN).
- ///
- UINT8 Pun;
- ///
- /// Logical Unit Number (LUN).
- ///
- UINT8 Lun;
-} UFS_DEVICE_PATH;
-
-///
-/// SD (Secure Digital) Device Path SubType.
-///
-#define MSG_SD_DP 0x1A
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- UINT8 SlotNumber;
-} SD_DEVICE_PATH;
-
-///
-/// EMMC (Embedded MMC) Device Path SubType.
-///
-#define MSG_EMMC_DP 0x1D
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- UINT8 SlotNumber;
-} EMMC_DEVICE_PATH;
-
-///
-/// iSCSI Device Path SubType
-///
-#define MSG_ISCSI_DP 0x13
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Network Protocol (0 = TCP, 1+ = reserved).
- ///
- UINT16 NetworkProtocol;
- ///
- /// iSCSI Login Options.
- ///
- UINT16 LoginOption;
- ///
- /// iSCSI Logical Unit Number.
- ///
- UINT64 Lun;
- ///
- /// iSCSI Target Portal group tag the initiator intends
- /// to establish a session with.
- ///
- UINT16 TargetPortalGroupTag;
- ///
- /// iSCSI NodeTarget Name. The length of the name
- /// is determined by subtracting the offset of this field from Length.
- ///
- /// CHAR8 iSCSI Target Name.
-} ISCSI_DEVICE_PATH;
-
-#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
-#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
-#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
-#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
-#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
-#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
-#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
-#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
-
-///
-/// VLAN Device Path SubType.
-///
-#define MSG_VLAN_DP 0x14
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// VLAN identifier (0-4094).
- ///
- UINT16 VlanId;
-} VLAN_DEVICE_PATH;
-
-///
-/// Bluetooth Device Path SubType.
-///
-#define MSG_BLUETOOTH_DP 0x1b
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// 48bit Bluetooth device address.
- ///
- BLUETOOTH_ADDRESS BD_ADDR;
-} BLUETOOTH_DEVICE_PATH;
-
-///
-/// Wi-Fi Device Path SubType.
-///
-#define MSG_WIFI_DP 0x1C
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Service set identifier. A 32-byte octets string.
- ///
- UINT8 SSId[32];
-} WIFI_DEVICE_PATH;
-
-///
-/// Bluetooth LE Device Path SubType.
-///
-#define MSG_BLUETOOTH_LE_DP 0x1E
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- BLUETOOTH_LE_ADDRESS Address;
-} BLUETOOTH_LE_DEVICE_PATH;
-
-//
-// Media Device Path
-//
-#define MEDIA_DEVICE_PATH 0x04
-
-///
-/// Hard Drive Media Device Path SubType.
-///
-#define MEDIA_HARDDRIVE_DP 0x01
-
-///
-/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Describes the entry in a partition table, starting with entry 1.
- /// Partition number zero represents the entire device. Valid
- /// partition numbers for a MBR partition are [1, 4]. Valid
- /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
- ///
- UINT32 PartitionNumber;
- ///
- /// Starting LBA of the partition on the hard drive.
- ///
- UINT64 PartitionStart;
- ///
- /// Size of the partition in units of Logical Blocks.
- ///
- UINT64 PartitionSize;
- ///
- /// Signature unique to this partition:
- /// If SignatureType is 0, this field has to be initialized with 16 zeros.
- /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
- /// The other 12 bytes are initialized with zeros.
- /// If SignatureType is 2, this field contains a 16 byte signature.
- ///
- UINT8 Signature[16];
- ///
- /// Partition Format: (Unused values reserved).
- /// 0x01 - PC-AT compatible legacy MBR.
- /// 0x02 - GUID Partition Table.
- ///
- UINT8 MBRType;
- ///
- /// Type of Disk Signature: (Unused values reserved).
- /// 0x00 - No Disk Signature.
- /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
- /// 0x02 - GUID signature.
- ///
- UINT8 SignatureType;
-} HARDDRIVE_DEVICE_PATH;
-
-#define MBR_TYPE_PCAT 0x01
-#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
-
-#define NO_DISK_SIGNATURE 0x00
-#define SIGNATURE_TYPE_MBR 0x01
-#define SIGNATURE_TYPE_GUID 0x02
-
-///
-/// CD-ROM Media Device Path SubType.
-///
-#define MEDIA_CDROM_DP 0x02
-
-///
-/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
- ///
- UINT32 BootEntry;
- ///
- /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
- ///
- UINT64 PartitionStart;
- ///
- /// Size of the partition in units of Blocks, also called Sectors.
- ///
- UINT64 PartitionSize;
-} CDROM_DEVICE_PATH;
-
-//
-// Use VENDOR_DEVICE_PATH struct
-//
-#define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype.
-
-///
-/// File Path Media Device Path SubType
-///
-#define MEDIA_FILEPATH_DP 0x04
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// A NULL-terminated Path string including directory and file names.
- ///
- CHAR16 PathName[1];
-} FILEPATH_DEVICE_PATH;
-
-#define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
-
-///
-/// Media Protocol Device Path SubType.
-///
-#define MEDIA_PROTOCOL_DP 0x05
-
-///
-/// The Media Protocol Device Path is used to denote the protocol that is being
-/// used in a device path at the location of the path specified.
-/// Many protocols are inherent to the style of device path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// The ID of the protocol.
- ///
- EFI_GUID Protocol;
-} MEDIA_PROTOCOL_DEVICE_PATH;
-
-///
-/// PIWG Firmware File SubType.
-///
-#define MEDIA_PIWG_FW_FILE_DP 0x06
-
-///
-/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Firmware file name
- ///
- EFI_GUID FvFileName;
-} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
-
-///
-/// PIWG Firmware Volume Device Path SubType.
-///
-#define MEDIA_PIWG_FW_VOL_DP 0x07
-
-///
-/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Firmware volume name.
- ///
- EFI_GUID FvName;
-} MEDIA_FW_VOL_DEVICE_PATH;
-
-///
-/// Media relative offset range device path.
-///
-#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
-
-///
-/// Used to describe the offset range of media relative.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- UINT32 Reserved;
- UINT64 StartingOffset;
- UINT64 EndingOffset;
-} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
-
-///
-/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.
-///
-#define EFI_VIRTUAL_DISK_GUID \
- { \
- 0x77AB535A, 0x45FC, 0x624B, {0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E } \
- }
-
-extern EFI_GUID gEfiVirtualDiskGuid;
-
-///
-/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.
-///
-#define EFI_VIRTUAL_CD_GUID \
- { \
- 0x3D5ABD30, 0x4175, 0x87CE, {0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB } \
- }
-extern EFI_GUID gEfiVirtualCdGuid;
-
-///
-/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.
-///
-#define EFI_PERSISTENT_VIRTUAL_DISK_GUID \
- { \
- 0x5CEA02C9, 0x4D07, 0x69D3, {0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 } \
- }
-
-extern EFI_GUID gEfiPersistentVirtualDiskGuid;
-
-///
-/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.
-///
-#define EFI_PERSISTENT_VIRTUAL_CD_GUID \
- { \
- 0x08018188, 0x42CD, 0xBB48, {0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D } \
- }
-
-extern EFI_GUID gEfiPersistentVirtualCdGuid;
-
-///
-/// Media ram disk device path.
-///
-#define MEDIA_RAM_DISK_DP 0x09
-
-///
-/// Used to describe the ram disk device path.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Starting Memory Address.
- ///
- UINT32 StartingAddr[2];
- ///
- /// Ending Memory Address.
- ///
- UINT32 EndingAddr[2];
- ///
- /// GUID that defines the type of the RAM Disk.
- ///
- EFI_GUID TypeGuid;
- ///
- /// RAM Diskinstance number, if supported. The default value is zero.
- ///
- UINT16 Instance;
-} MEDIA_RAM_DISK_DEVICE_PATH;
-
-///
-/// BIOS Boot Specification Device Path.
-///
-#define BBS_DEVICE_PATH 0x05
-
-///
-/// BIOS Boot Specification Device Path SubType.
-///
-#define BBS_BBS_DP 0x01
-
-///
-/// This Device Path is used to describe the booting of non-EFI-aware operating systems.
-///
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- ///
- /// Device Type as defined by the BIOS Boot Specification.
- ///
- UINT16 DeviceType;
- ///
- /// Status Flags as defined by the BIOS Boot Specification.
- ///
- UINT16 StatusFlag;
- ///
- /// Null-terminated ASCII string that describes the boot device to a user.
- ///
- CHAR8 String[1];
-} BBS_BBS_DEVICE_PATH;
-
-//
-// DeviceType definitions - from BBS specification
-//
-#define BBS_TYPE_FLOPPY 0x01
-#define BBS_TYPE_HARDDRIVE 0x02
-#define BBS_TYPE_CDROM 0x03
-#define BBS_TYPE_PCMCIA 0x04
-#define BBS_TYPE_USB 0x05
-#define BBS_TYPE_EMBEDDED_NETWORK 0x06
-#define BBS_TYPE_BEV 0x80
-#define BBS_TYPE_UNKNOWN 0xFF
-
-
-///
-/// Union of all possible Device Paths and pointers to Device Paths.
-///
-typedef union {
- EFI_DEVICE_PATH_PROTOCOL DevPath;
- PCI_DEVICE_PATH Pci;
- PCCARD_DEVICE_PATH PcCard;
- MEMMAP_DEVICE_PATH MemMap;
- VENDOR_DEVICE_PATH Vendor;
-
- CONTROLLER_DEVICE_PATH Controller;
- BMC_DEVICE_PATH Bmc;
- ACPI_HID_DEVICE_PATH Acpi;
- ACPI_EXTENDED_HID_DEVICE_PATH ExtendedAcpi;
- ACPI_ADR_DEVICE_PATH AcpiAdr;
-
- ATAPI_DEVICE_PATH Atapi;
- SCSI_DEVICE_PATH Scsi;
- ISCSI_DEVICE_PATH Iscsi;
- FIBRECHANNEL_DEVICE_PATH FibreChannel;
- FIBRECHANNELEX_DEVICE_PATH FibreChannelEx;
-
- F1394_DEVICE_PATH F1394;
- USB_DEVICE_PATH Usb;
- SATA_DEVICE_PATH Sata;
- USB_CLASS_DEVICE_PATH UsbClass;
- USB_WWID_DEVICE_PATH UsbWwid;
- DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit;
- I2O_DEVICE_PATH I2O;
- MAC_ADDR_DEVICE_PATH MacAddr;
- IPv4_DEVICE_PATH Ipv4;
- IPv6_DEVICE_PATH Ipv6;
- VLAN_DEVICE_PATH Vlan;
- INFINIBAND_DEVICE_PATH InfiniBand;
- UART_DEVICE_PATH Uart;
- UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
- SAS_DEVICE_PATH Sas;
- SASEX_DEVICE_PATH SasEx;
- NVME_NAMESPACE_DEVICE_PATH NvmeNamespace;
- DNS_DEVICE_PATH Dns;
- URI_DEVICE_PATH Uri;
- BLUETOOTH_DEVICE_PATH Bluetooth;
- WIFI_DEVICE_PATH WiFi;
- UFS_DEVICE_PATH Ufs;
- SD_DEVICE_PATH Sd;
- EMMC_DEVICE_PATH Emmc;
- HARDDRIVE_DEVICE_PATH HardDrive;
- CDROM_DEVICE_PATH CD;
-
- FILEPATH_DEVICE_PATH FilePath;
- MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
-
- MEDIA_FW_VOL_DEVICE_PATH FirmwareVolume;
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FirmwareFile;
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset;
- MEDIA_RAM_DISK_DEVICE_PATH RamDisk;
- BBS_BBS_DEVICE_PATH Bbs;
-} EFI_DEV_PATH;
-
-
-
-typedef union {
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- PCI_DEVICE_PATH *Pci;
- PCCARD_DEVICE_PATH *PcCard;
- MEMMAP_DEVICE_PATH *MemMap;
- VENDOR_DEVICE_PATH *Vendor;
-
- CONTROLLER_DEVICE_PATH *Controller;
- BMC_DEVICE_PATH *Bmc;
- ACPI_HID_DEVICE_PATH *Acpi;
- ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
- ACPI_ADR_DEVICE_PATH *AcpiAdr;
-
- ATAPI_DEVICE_PATH *Atapi;
- SCSI_DEVICE_PATH *Scsi;
- ISCSI_DEVICE_PATH *Iscsi;
- FIBRECHANNEL_DEVICE_PATH *FibreChannel;
- FIBRECHANNELEX_DEVICE_PATH *FibreChannelEx;
-
- F1394_DEVICE_PATH *F1394;
- USB_DEVICE_PATH *Usb;
- SATA_DEVICE_PATH *Sata;
- USB_CLASS_DEVICE_PATH *UsbClass;
- USB_WWID_DEVICE_PATH *UsbWwid;
- DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit;
- I2O_DEVICE_PATH *I2O;
- MAC_ADDR_DEVICE_PATH *MacAddr;
- IPv4_DEVICE_PATH *Ipv4;
- IPv6_DEVICE_PATH *Ipv6;
- VLAN_DEVICE_PATH *Vlan;
- INFINIBAND_DEVICE_PATH *InfiniBand;
- UART_DEVICE_PATH *Uart;
- UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
- SAS_DEVICE_PATH *Sas;
- SASEX_DEVICE_PATH *SasEx;
- NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace;
- DNS_DEVICE_PATH *Dns;
- URI_DEVICE_PATH *Uri;
- BLUETOOTH_DEVICE_PATH *Bluetooth;
- WIFI_DEVICE_PATH *WiFi;
- UFS_DEVICE_PATH *Ufs;
- SD_DEVICE_PATH *Sd;
- EMMC_DEVICE_PATH *Emmc;
- HARDDRIVE_DEVICE_PATH *HardDrive;
- CDROM_DEVICE_PATH *CD;
-
- FILEPATH_DEVICE_PATH *FilePath;
- MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
-
- MEDIA_FW_VOL_DEVICE_PATH *FirmwareVolume;
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FirmwareFile;
- MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
- MEDIA_RAM_DISK_DEVICE_PATH *RamDisk;
- BBS_BBS_DEVICE_PATH *Bbs;
- UINT8 *Raw;
-} EFI_DEV_PATH_PTR;
-
-#define EFI_DEBUGPORT_PROTOCOL_GUID \
- { \
- 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
- }
-//
-// DEBUGPORT variable definitions...
-//
-#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
-#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
-extern EFI_GUID gEfiDebugPortVariableGuid;
-
-//
-// DebugPort device path definitions...
-//
-#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
-extern EFI_GUID gEfiDebugPortProtocolGuid;
-
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- EFI_GUID Guid;
-} DEBUGPORT_DEVICE_PATH;
-
-#pragma pack()
-
-#define END_DEVICE_PATH_TYPE 0x7f
-#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
-#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
-
-extern EFI_GUID gEfiDevicePathProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/DevicePathUtilities.h b/BaseTools/Source/C/Include/Protocol/DevicePathUtilities.h
deleted file mode 100644
index b2fd6b2837..0000000000
--- a/BaseTools/Source/C/Include/Protocol/DevicePathUtilities.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/** @file
- EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0.
- Use to create and manipulate device paths and device nodes.
-
- Copyright (c) 2017, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __DEVICE_PATH_UTILITIES_H__
-#define __DEVICE_PATH_UTILITIES_H__
-
-///
-/// Device Path Utilities protocol
-///
-#define EFI_DEVICE_PATH_UTILITIES_GUID \
- { \
- 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \
- }
-
-/**
- Returns the size of the device path, in bytes.
-
- @param DevicePath Points to the start of the EFI device path.
-
- @return Size Size of the specified device path, in bytes, including the end-of-path tag.
- @retval 0 DevicePath is NULL
-
-**/
-typedef
-UINTN
-( *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE)(
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-
-/**
- Create a duplicate of the specified path.
-
- @param DevicePath Points to the source EFI device path.
-
- @retval Pointer A pointer to the duplicate device path.
- @retval NULL insufficient memory or DevicePath is NULL
-
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-( *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)(
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Create a new path by appending the second device path to the first.
- If Src1 is NULL and Src2 is non-NULL, then a duplicate of Src2 is returned.
- If Src1 is non-NULL and Src2 is NULL, then a duplicate of Src1 is returned.
- If Src1 and Src2 are both NULL, then a copy of an end-of-device-path is returned.
-
- @param Src1 Points to the first device path.
- @param Src2 Points to the second device path.
-
- @retval Pointer A pointer to the newly created device path.
- @retval NULL Memory could not be allocated
-
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-( *EFI_DEVICE_PATH_UTILS_APPEND_PATH)(
- CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
- CONST EFI_DEVICE_PATH_PROTOCOL *Src2
- );
-
-/**
- Creates a new path by appending the device node to the device path.
- If DeviceNode is NULL then a copy of DevicePath is returned.
- If DevicePath is NULL then a copy of DeviceNode, followed by an end-of-device path device node is returned.
- If both DeviceNode and DevicePath are NULL then a copy of an end-of-device-path device node is returned.
-
- @param DevicePath Points to the device path.
- @param DeviceNode Points to the device node.
-
- @retval Pointer A pointer to the allocated device node.
- @retval NULL There was insufficient memory.
-
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-( *EFI_DEVICE_PATH_UTILS_APPEND_NODE)(
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
- );
-
-/**
- Creates a new path by appending the specified device path instance to the specified device path.
-
- @param DevicePath Points to the device path. If NULL, then ignored.
- @param DevicePathInstance Points to the device path instance.
-
- @retval Pointer A pointer to the newly created device path
- @retval NULL Memory could not be allocated or DevicePathInstance is NULL.
-
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-( *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)(
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
- );
-
-/**
- Creates a copy of the current device path instance and returns a pointer to the next device path
- instance.
-
- @param DevicePathInstance On input, this holds the pointer to the current device path
- instance. On output, this holds the pointer to the next
- device path instance or NULL if there are no more device
- path instances in the device path.
- @param DevicePathInstanceSize On output, this holds the size of the device path instance,
- in bytes or zero, if DevicePathInstance is NULL.
- If NULL, then the instance size is not output.
-
- @retval Pointer A pointer to the copy of the current device path instance.
- @retval NULL DevicePathInstance was NULL on entry or there was insufficient memory.
-
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-( *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)(
- EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
- UINTN *DevicePathInstanceSize
- );
-
-/**
- Creates a device node
-
- @param NodeType NodeType is the device node type (EFI_DEVICE_PATH.Type) for
- the new device node.
- @param NodeSubType NodeSubType is the device node sub-type
- EFI_DEVICE_PATH.SubType) for the new device node.
- @param NodeLength NodeLength is the length of the device node
- (EFI_DEVICE_PATH.Length) for the new device node.
-
- @retval Pointer A pointer to the newly created device node.
- @retval NULL NodeLength is less than
- the size of the header or there was insufficient memory.
-
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-( *EFI_DEVICE_PATH_UTILS_CREATE_NODE)(
- UINT8 NodeType,
- UINT8 NodeSubType,
- UINT16 NodeLength
-);
-
-/**
- Returns whether a device path is multi-instance.
-
- @param DevicePath Points to the device path. If NULL, then ignored.
-
- @retval TRUE The device path has more than one instance
- @retval FALSE The device path is empty or contains only a single instance.
-
-**/
-typedef
-BOOLEAN
-( *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE)(
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-///
-/// This protocol is used to creates and manipulates device paths and device nodes.
-///
-typedef struct {
- EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
- EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;
- EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;
- EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;
- EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;
- EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;
- EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;
- EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode;
-} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
-
-extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
-
-VOID
-SetDevicePathEndNode (
- VOID *Node
- );
-
-BOOLEAN
-IsDevicePathValid (
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- UINTN MaxSize
- );
-
-UINT8
-DevicePathType (
- CONST VOID *Node
- );
-
-UINT8
-DevicePathSubType (
- CONST VOID *Node
- );
-
-UINTN
-DevicePathNodeLength (
- CONST VOID *Node
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-NextDevicePathNode (
- CONST VOID *Node
- );
-
-BOOLEAN
-IsDevicePathEndType (
- CONST VOID *Node
- );
-
-BOOLEAN
-IsDevicePathEnd (
- CONST VOID *Node
- );
-BOOLEAN
-IsDevicePathEndInstance (
- CONST VOID *Node
- );
-
-UINT16
-SetDevicePathNodeLength (
- VOID *Node,
- UINTN Length
- );
-
-VOID
-SetDevicePathEndNode (
- VOID *Node
- );
-
-UINTN
-UefiDevicePathLibGetDevicePathSize (
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-UefiDevicePathLibDuplicateDevicePath (
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-UefiDevicePathLibAppendDevicePath (
- CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
- CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-UefiDevicePathLibAppendDevicePathNode (
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-UefiDevicePathLibAppendDevicePathInstance (
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-UefiDevicePathLibGetNextDevicePathInstance (
- EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- UINTN *Size
- );
-
-EFI_DEVICE_PATH_PROTOCOL *
-UefiDevicePathLibCreateDeviceNode (
- UINT8 NodeType,
- UINT8 NodeSubType,
- UINT16 NodeLength
- );
-
-BOOLEAN
-UefiDevicePathLibIsDevicePathMultiInstance (
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/GraphicsOutput.h b/BaseTools/Source/C/Include/Protocol/GraphicsOutput.h
deleted file mode 100644
index 5a10ac72a4..0000000000
--- a/BaseTools/Source/C/Include/Protocol/GraphicsOutput.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/** @file
- Graphics Output Protocol from the UEFI 2.0 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __GRAPHICS_OUTPUT_H__
-#define __GRAPHICS_OUTPUT_H__
-
-#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
- { \
- 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
- }
-
-typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
-
-typedef struct {
- UINT32 RedMask;
- UINT32 GreenMask;
- UINT32 BlueMask;
- UINT32 ReservedMask;
-} EFI_PIXEL_BITMASK;
-
-typedef enum {
- PixelRedGreenBlueReserved8BitPerColor,
- PixelBlueGreenRedReserved8BitPerColor,
- PixelBitMask,
- PixelBltOnly,
- PixelFormatMax
-} EFI_GRAPHICS_PIXEL_FORMAT;
-
-typedef struct {
- UINT32 Version;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
- EFI_PIXEL_BITMASK PixelInformation;
- UINT32 PixelsPerScanLine;
-} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param ModeNumber The mode number to return information on.
- @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
- @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
- @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber,
- OUT UINTN *SizeOfInfo,
- OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
- )
-;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param ModeNumber The mode number to be set.
-
- @retval EFI_SUCCESS Graphics mode was changed.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
- @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber
- )
-;
-
-typedef struct {
- UINT8 Blue;
- UINT8 Green;
- UINT8 Red;
- UINT8 Reserved;
-} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
-
-typedef union {
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
- UINT32 Raw;
-} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
-
-typedef enum {
- EfiBltVideoFill,
- EfiBltVideoToBltBuffer,
- EfiBltBufferToVideo,
- EfiBltVideoToVideo,
- EfiGraphicsOutputBltOperationMax
-} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
-
-/**
- The following table defines actions for BltOperations:
-
- EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
- EfiBltVideoToBltBuffer - Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
-
- EfiBltBufferToVideo - Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
-
- EfiBltVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
- (SourceX + Width, SourceY + Height) .to the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
- @param This Protocol instance pointer.
- @param BltBuffer Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- @param BltOperation Operation to perform on BlitBuffer and video memory
- @param SourceX X coordinate of source for the BltBuffer.
- @param SourceY Y coordinate of source for the BltBuffer.
- @param DestinationX X coordinate of destination for the BltBuffer.
- @param DestinationY Y coordinate of destination for the BltBuffer.
- @param Width Width of rectangle in BltBuffer in pixels.
- @param Height Height of rectangle in BltBuffer in pixels.
- @param Delta OPTIONAL
-
- @retval EFI_SUCCESS The Blt operation completed.
- @retval EFI_INVALID_PARAMETER BltOperation is not valid.
- @retval EFI_DEVICE_ERROR A hardware error occurred writing to the video buffer.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-typedef struct {
- UINT32 MaxMode;
- UINT32 Mode;
- EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
- UINTN SizeOfInfo;
- EFI_PHYSICAL_ADDRESS FrameBufferBase;
- UINTN FrameBufferSize;
-} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
-
-struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
- EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
-};
-
-extern EFI_GUID gEfiGraphicsOutputProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h b/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h
deleted file mode 100644
index f629546252..0000000000
--- a/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/** @file
- This file declares GUIDed section extraction protocol.
-
- This interface provides a means of decoding a GUID defined encapsulation
- section. There may be multiple different GUIDs associated with the GUIDed
- section extraction protocol. That is, all instances of the GUIDed section
- extraction protocol must have the same interface structure.
-
- @par Revision Reference: PI
- Version 1.00.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
-#define __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
-
-//
-// Forward reference for pure ANSI compatibility
-
-typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
-
-
-/**
- The ExtractSection() function processes the input section and
- allocates a buffer from the pool in which it returns the section
- contents. If the section being extracted contains
- authentication information (the section's
- GuidedSectionHeader.Attributes field has the
- EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
- returned in AuthenticationStatus must reflect the results of
- the authentication operation. Depending on the algorithm and
- size of the encapsulated data, the time that is required to do
- a full authentication may be prohibitively long for some
- classes of systems. To indicate this, use
- EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
- the security policy driver (see the Platform Initialization
- Driver Execution Environment Core Interface Specification for
- more details and the GUID definition). If the
- EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
- database, then, if possible, full authentication should be
- skipped and the section contents simply returned in the
- OutputBuffer. In this case, the
- EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
- must be set on return. ExtractSection() is callable only from
- TPL_NOTIFY and below. Behavior of ExtractSection() at any
- EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
- defined in RaiseTPL() in the UEFI 2.0 specification.
-
-
- @param This Indicates the
- EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
-
- @param InputSection Buffer containing the input GUIDed section
- to be processed. OutputBuffer OutputBuffer
- is allocated from boot services pool
- memory and contains the new section
- stream. The caller is responsible for
- freeing this buffer.
-
- @param OutputSize A pointer to a caller-allocated UINTN in
- which the size of OutputBuffer allocation
- is stored. If the function returns
- anything other than EFI_SUCCESS, the value
- of OutputSize is undefined.
-
- @param AuthenticationStatus A pointer to a caller-allocated
- UINT32 that indicates the
- authentication status of the
- output buffer. If the input
- section's
- GuidedSectionHeader.Attributes
- field has the
- EFI_GUIDED_SECTION_AUTH_STATUS_VAL
- bit as clear, AuthenticationStatus
- must return zero. Both local bits
- (19:16) and aggregate bits (3:0)
- in AuthenticationStatus are
- returned by ExtractSection().
- These bits reflect the status of
- the extraction operation. The bit
- pattern in both regions must be
- the same, as the local and
- aggregate authentication statuses
- have equivalent meaning at this
- level. If the function returns
- anything other than EFI_SUCCESS,
- the value of AuthenticationStatus
- is undefined.
-
-
- @retval EFI_SUCCESS The InputSection was successfully
- processed and the section contents were
- returned.
-
- @retval EFI_OUT_OF_RESOURCES The system has insufficient
- resources to process the
- request.
-
- @retval EFI_INVALID_PARAMETER The GUID in InputSection does
- not match this instance of the
- GUIDed Section Extraction
- Protocol.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
- IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
- IN CONST VOID *InputSection,
- OUT VOID **OutputBuffer,
- OUT UINTN *OutputSize,
- OUT UINT32 *AuthenticationStatus
-);
-
-
-/**
-
- Takes the GUIDed section as input and produces the section
- stream data. See the ExtractSection() function description.
-
-**/
-struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
- EFI_EXTRACT_GUIDED_SECTION ExtractSection;
-};
-
-//
-// Protocol GUID definition. Each GUIDed section extraction protocol has the
-// same interface but with different GUID. All the GUIDs is defined here.
-// May add multiple GUIDs here.
-//
-#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
- { \
- 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
- }
-
-//
-// may add other GUID here
-//
-extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
deleted file mode 100644
index 448350967b..0000000000
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ /dev/null
@@ -1,944 +0,0 @@
-/** @file
- This file defines the Human Interface Infrastructure protocol which will
- be used by resources which want to publish IFR/Font/String data and have it
- collected by the Configuration engine.
-
- @par Revision Reference:
- This protocol is defined in HII spec 0.92.
-
- Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef _FRAMEWORK_HII_H_
-#define _FRAMEWORK_HII_H_
-
-//#include
-
-//
-// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,
-// is defined in MdePkg/Protocol/GraphicsOutput.h
-//
-#include
-
-#define EFI_HII_PROTOCOL_GUID \
- { \
- 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
- }
-
-// BugBug:
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-// UINT8 Blue;
-// UINT8 Green;
-// UINT8 Red;
-// UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//
-
-typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
-
-//
-// Global definition
-//
-#define NARROW_CHAR 0xFFF0
-#define WIDE_CHAR 0xFFF1
-#define NON_BREAKING_CHAR 0xFFF2
-#define GLYPH_WIDTH 8
-#define GLYPH_HEIGHT 19
-
-#define EFI_HII_FONT 1
-#define EFI_HII_STRING 2
-#define EFI_HII_IFR 3
-#define EFI_HII_KEYBOARD 4
-#define EFI_HII_HANDLES 5
-#define EFI_HII_VARIABLE 6
-#define EFI_HII_DEVICE_PATH 7
-
-
-// References to string tokens must use this macro to enable scanning for
-// token usages.
-//
-#define STRING_TOKEN(t) t
-
-//
-// The following types are currently defined:
-// EFI_FROM_ID has been defined in UEFI spec.
-//
-typedef UINT16 EFI_FORM_LABEL;
-
-#pragma pack(1)
-
-typedef struct {
- UINT32 Length;
- UINT16 Type;
-} EFI_HII_PACK_HEADER;
-
-//
-// A form list consists of a large variety of structure
-// possibilities so to represent the binary blob of data
-// associated with a package of forms, we will assume a
-// pointer to a self-describing data buffer.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
-} EFI_HII_IFR_PACK;
-
-typedef struct {
- EFI_HII_PACK_HEADER Header; // Must be filled in
- EFI_HANDLE ImageHandle; // Must be filled in
- EFI_HANDLE DeviceHandle; // Optional
- EFI_HANDLE ControllerHandle; // Optional
- EFI_HANDLE CallbackHandle; // Optional
- EFI_HANDLE COBExportHandle; // Optional
-} EFI_HII_HANDLE_PACK;
-
-//
-// ********************************************************
-// EFI_VARIABLE_CONTENTS
-// ********************************************************
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- EFI_GUID VariableGuid;
- UINT32 VariableNameLength;
- UINT16 VariableId;
- //
- // CHAR16 VariableName[]; //Null-terminated
- //
-} EFI_HII_VARIABLE_PACK;
-
-//
-// ********************************************************
-// EFI_DEVICE_PATH_PACK
-// ********************************************************
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- //
- // EFI_DEVICE_PATH DevicePath[];
- //
-} EFI_HII_DEVICE_PATH_PACK;
-
-//
-// ********************************************************
-// EFI_HII_DATA_TABLE
-// ********************************************************
-//
-typedef struct {
- EFI_HII_HANDLE HiiHandle;
- EFI_GUID PackageGuid;
- UINT32 DataTableSize;
- UINT32 IfrDataOffset;
- UINT32 StringDataOffset;
- UINT32 VariableDataOffset;
- UINT32 DevicePathOffset;
- UINT32 NumberOfVariableData;
- UINT32 NumberOfLanguages;
- //
- // EFI_HII_DEVICE_PATH_PACK DevicePath[];
- // EFI_HII_VARIABLE_PACK VariableData[];
- // EFI_HII_IFR_PACK IfrData;
- // EFI_HII_STRING_PACK StringData[];
- //
-} EFI_HII_DATA_TABLE;
-
-//
-// ********************************************************
-// EFI_HII_EXPORT_TABLE
-// ********************************************************
-//
-typedef struct {
- UINT32 NumberOfHiiDataTables;
- EFI_GUID Revision;
- //
- // EFI_HII_DATA_TABLE HiiDataTable[];
- //
-} EFI_HII_EXPORT_TABLE;
-
-typedef struct {
- BOOLEAN FormSetUpdate; // If TRUE, next variable is significant
- EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info
- BOOLEAN FormUpdate; // If TRUE, next variable is significant
- UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.
- STRING_REF FormTitle; // If not 0, will update Form with this info
- UINT16 DataCount; // The number of Data entries in this structure
- UINT8 *Data; // An array of 1+ op-codes, specified by DataCount
-} EFI_HII_UPDATE_DATA;
-
-//
-// String attributes
-//
-#define LANG_RIGHT_TO_LEFT 0x00000001
-
-//
-// A string package is used to localize strings to a particular
-// language. The package is associated with a particular driver
-// or set of drivers. Tools are used to associate tokens with
-// string references in forms and in programs. These tokens are
-// language agnostic. When paired with a language pack (directly
-// or indirectly), the string token resolves into an actual
-// UNICODE string. The NumStringPointers determines how many
-// StringPointers (offset values) there are as well as the total
-// number of Strings that are defined.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- RELOFST LanguageNameString;
- RELOFST PrintableLanguageName;
- UINT32 NumStringPointers;
- UINT32 Attributes;
- //
- // RELOFST StringPointers[];
- // EFI_STRING Strings[];
- //
-} EFI_HII_STRING_PACK;
-
-//
-// Glyph Attributes
-//
-#define EFI_GLYPH_NON_SPACING 1
-#define EFI_GLYPH_WIDE 2
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[GLYPH_HEIGHT];
-} EFI_NARROW_GLYPH;
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[GLYPH_HEIGHT];
- UINT8 GlyphCol2[GLYPH_HEIGHT];
- UINT8 Pad[3];
-} EFI_WIDE_GLYPH;
-
-//
-// A font list consists of a font header followed by a series
-// of glyph structures. Note that fonts are not language specific.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- UINT16 NumberOfNarrowGlyphs;
- UINT16 NumberOfWideGlyphs;
-} EFI_HII_FONT_PACK;
-
-//
-// The IfrData in the EFI_HII_IFR_PACK structure definition
-// is variable length, and not really part of the header. To
-// simplify from code the size of the header, define an
-// identical structure that does not include the IfrData field.
-// Then use sizeof() this new structure to determine the
-// actual size of the header.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
-} EFI_HII_IFR_PACK_HEADER;
-
-//
-// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;
-//
-typedef enum {
- EfiKeyLCtrl,
- EfiKeyA0,
- EfiKeyLAlt,
- EfiKeySpaceBar,
- EfiKeyA2,
- EfiKeyA3,
- EfiKeyA4,
- EfiKeyRCtrl,
- EfiKeyLeftArrow,
- EfiKeyDownArrow,
- EfiKeyRightArrow,
- EfiKeyZero,
- EfiKeyPeriod,
- EfiKeyEnter,
- EfiKeyLShift,
- EfiKeyB0,
- EfiKeyB1,
- EfiKeyB2,
- EfiKeyB3,
- EfiKeyB4,
- EfiKeyB5,
- EfiKeyB6,
- EfiKeyB7,
- EfiKeyB8,
- EfiKeyB9,
- EfiKeyB10,
- EfiKeyRshift,
- EfiKeyUpArrow,
- EfiKeyOne,
- EfiKeyTwo,
- EfiKeyThree,
- EfiKeyCapsLock,
- EfiKeyC1,
- EfiKeyC2,
- EfiKeyC3,
- EfiKeyC4,
- EfiKeyC5,
- EfiKeyC6,
- EfiKeyC7,
- EfiKeyC8,
- EfiKeyC9,
- EfiKeyC10,
- EfiKeyC11,
- EfiKeyC12,
- EfiKeyFour,
- EfiKeyFive,
- EfiKeySix,
- EfiKeyPlus,
- EfiKeyTab,
- EfiKeyD1,
- EfiKeyD2,
- EfiKeyD3,
- EfiKeyD4,
- EfiKeyD5,
- EfiKeyD6,
- EfiKeyD7,
- EfiKeyD8,
- EfiKeyD9,
- EfiKeyD10,
- EfiKeyD11,
- EfiKeyD12,
- EfiKeyD13,
- EfiKeyDel,
- EfiKeyEnd,
- EfiKeyPgDn,
- EfiKeySeven,
- EfiKeyEight,
- EfiKeyNine,
- EfiKeyE0,
- EfiKeyE1,
- EfiKeyE2,
- EfiKeyE3,
- EfiKeyE4,
- EfiKeyE5,
- EfiKeyE6,
- EfiKeyE7,
- EfiKeyE8,
- EfiKeyE9,
- EfiKeyE10,
- EfiKeyE11,
- EfiKeyE12,
- EfiKeyBackSpace,
- EfiKeyIns,
- EfiKeyHome,
- EfiKeyPgUp,
- EfiKeyNLck,
- EfiKeySlash,
- EfiKeyAsterisk,
- EfiKeyMinus,
- EfiKeyEsc,
- EfiKeyF1,
- EfiKeyF2,
- EfiKeyF3,
- EfiKeyF4,
- EfiKeyF5,
- EfiKeyF6,
- EfiKeyF7,
- EfiKeyF8,
- EfiKeyF9,
- EfiKeyF10,
- EfiKeyF11,
- EfiKeyF12,
- EfiKeyPrint,
- EfiKeySLck,
- EfiKeyPause
-} EFI_KEY;
-
-typedef struct {
- EFI_KEY Key;
- CHAR16 Unicode;
- CHAR16 ShiftedUnicode;
- CHAR16 AltGrUnicode;
- CHAR16 ShiftedAltGrUnicode;
- UINT16 Modifier;
-} EFI_KEY_DESCRIPTOR;
-
-//
-// This structure allows a sparse set of keys to be redefined
-// or a complete redefinition of the keyboard layout. Most
-// keyboards have a lot of commonality in their layouts, therefore
-// only defining those keys that need to change from the default
-// minimizes the passed in information.
-//
-// Additionally, when an update occurs, the active keyboard layout
-// will be switched to the newly updated keyboard layout. This
-// allows for situations that when a keyboard layout driver is
-// loaded as part of system initialization, the system will default
-// the keyboard behavior to the new layout.
-//
-// Each call to update the keyboard mapping should contain the
-// complete set of key descriptors to be updated, since every
-// call to the HII which contains an EFI_HII_KEYBOARD_PACK will
-// wipe the previous set of overrides. A call to
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- EFI_KEY_DESCRIPTOR *Descriptor;
- UINT8 DescriptorCount;
-} EFI_HII_KEYBOARD_PACK;
-
-//
-// The EFI_HII_PACKAGES can contain different types of packages just
-// after the structure as inline data.
-//
-typedef struct {
- UINTN NumberOfPackages;
- EFI_GUID *GuidId;
- //
- // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
- // EFI_HII_IFR_PACK *IfrPack; // Only one pack.
- // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
- // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
- // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
- //
-} EFI_HII_PACKAGES;
-
-typedef struct _EFI_HII_VARIABLE_PACK_LIST {
- struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
- EFI_HII_VARIABLE_PACK *VariablePack;
-} EFI_HII_VARIABLE_PACK_LIST;
-
-
-#pragma pack()
-
-/**
- Registers the various packs that are passed in via the Packages parameter.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Packages A pointer to an EFI_HII_PACKAGES package instance.
- @param Handle A pointer to the EFI_HII_HANDLE instance.
-
- @retval EFI_SUCCESS Data was extracted from Packages, the database
- was updated with the data, and Handle returned successfully.
- @retval EFI_INVALID_PARAMETER The content of Packages was invalid.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_NEW_PACK) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_PACKAGES *Packages,
- OUT EFI_HII_HANDLE *Handle
- );
-
-/**
- Removes a package from the HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle that was registered to the data that is requested
- for removal.
-
- @retval EFI_SUCCESS The data associated with the Handle was removed
- from the HII database.
- @retval EFI_INVALID_PARAMETER The Handle was not valid.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_REMOVE_PACK) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle
- );
-
-/**
- Determines the handles that are currently active in the database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param HandleBufferLength On input, a pointer to the length of the handle
- buffer. On output, the length of the handle buffer that is required
- for the handles found.
- @param Handle An array of EFI_HII_HANDLE instances returned.
-
- @retval EFI_SUCCESS Handle was updated successfully.
- @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
- that Handle is too small to support the number of handles.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_FIND_HANDLES) (
- IN EFI_HII_PROTOCOL *This,
- IN OUT UINT16 *HandleBufferLength,
- OUT EFI_HII_HANDLE *Handle
- );
-
-/**
- Exports the contents of the database into a buffer.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle An EFI_HII_HANDLE that corresponds to the desired
- handle to export. If the value is 0, the entire database will be exported.
- In either case, the data will be exported in a format described by the
- structure definition of EFI_HII_EXPORT_TABLE.
- @param BufferSize
- On input, a pointer to the length of the buffer. On output, the length
- of the buffer that is required for the export data.
- @param Buffer A pointer to a buffer that will contain the results of the export function.
-
- @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
- @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_EXPORT) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- );
-
-/**
- Remove any new strings that were added after the initial string export
- for this handle.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the string resides.
-
- @retval EFI_SUCCESS Remove strings from the handle successfully.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_RESET_STRINGS) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle
- );
-
-/**
- Tests if all of the characters in a string have corresponding font characters.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param StringToTest A pointer to a Unicode string.
- @param FirstMissing A pointer to an index into the string. On input,
- the index of the first character in the StringToTest to examine. On exit,
- the index of the first character encountered for which a glyph is unavailable.
- If all glyphs in the string are available, the index is the index of the
- terminator of the string.
- @param GlyphBufferSize A pointer to a value. On output, if the function
- returns EFI_SUCCESS, it contains the amount of memory that is required to
- store the string's glyph equivalent.
-
- @retval EFI_SUCCESS All glyphs are available. Note that an empty string
- always returns this value.
- @retval EFI_NOT_FOUND A glyph was not found for a character.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_TEST_STRING) (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *StringToTest,
- IN OUT UINT32 *FirstMissing,
- OUT UINT32 *GlyphBufferSize
- );
-
-/**
- Translates a Unicode character into the corresponding font glyph.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Source A pointer to a Unicode string.
- @param Index On input, the offset into the string from which to fetch
- the character.On successful completion, the index is updated to the first
- character past the character(s) making up the just extracted glyph.
- @param GlyphBuffer Pointer to an array where the glyphs corresponding
- to the characters in the source may be stored. GlyphBuffer is assumed
- to be wide enough to accept a wide glyph character.
- @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by
- this value is filled with the length of the glyph in pixels. It is unchanged
- if the call was unsuccessful.
- @param InternalStatus The cell pointed to by this parameter must be
- initialized to zero prior to invoking the call the first time for any string.
-
- @retval EFI_SUCCESS It worked.
- @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_GLYPH) (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *Source,
- IN OUT UINT16 *Index,
- OUT UINT8 **GlyphBuffer,
- OUT UINT16 *BitWidth,
- IN OUT UINT32 *InternalStatus
- );
-
-/**
- Translates a glyph into the format required for input to the Universal
- Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param GlyphBuffer A pointer to the buffer that contains glyph data.
- @param Foreground The foreground setting requested to be used for the
- generated BltBuffer data.
- @param Background The background setting requested to be used for the
- generated BltBuffer data.
- @param Count The entry in the BltBuffer upon which to act.
- @param Width The width in bits of the glyph being converted.
- @param Height The height in bits of the glyph being converted
- @param BltBuffer A pointer to the buffer that contains the data that is
- ready to be used by the UGA BLT routines.
-
- @retval EFI_SUCCESS It worked.
- @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
- IN EFI_HII_PROTOCOL *This,
- IN UINT8 *GlyphBuffer,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
- IN UINTN Count,
- IN UINTN Width,
- IN UINTN Height,
- IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
- );
-
-/**
- Allows a new string to be added to an already existing string package.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Pointer to a NULL-terminated string containing a single ISO 639-2
- language identifier, indicating the language in which the string is translated.
- @param Handle The handle of the language pack to which the string is to be added.
- @param Reference The identifier of the string to be added. If the reference
- value is zero, then the string will be assigned a new identifier on that
- handle for the language specified. Otherwise, the string will be updated
- with the NewString Value.
- @param NewString The string to be added.
-
- @retval EFI_SUCCESS The string was effectively registered.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_NEW_STRING) (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *Language,
- IN EFI_HII_HANDLE Handle,
- IN OUT STRING_REF *Reference,
- IN CHAR16 *NewString
- );
-
-/**
- Allows a program to determine the primary languages that are supported
- on a given handle.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the strings reside.
- @param LanguageString A string allocated by GetPrimaryLanguages() that
- contains a list of all primary languages registered on the handle.
-
- @retval EFI_SUCCESS LanguageString was correctly returned.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- OUT EFI_STRING *LanguageString
- );
-
-/**
- Allows a program to determine which secondary languages are supported
- on a given handle for a given primary language.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the strings reside.
- @param PrimaryLanguage Pointer to a NULL-terminated string containing a single
- ISO 639-2 language identifier, indicating the primary language.
- @param LanguageString A string allocated by GetSecondaryLanguages()
- containing a list of all secondary languages registered on the handle.
-
- @retval EFI_SUCCESS LanguageString was correctly returned.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN CHAR16 *PrimaryLanguage,
- OUT EFI_STRING *LanguageString
- );
-
-/**
- Extracts a string from a package already registered with the EFI HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the string resides.
- @param Token The string token assigned to the string.
- @param Raw If TRUE, the string is returned unedited in the internal
- storage format described above. If false, the string returned is edited
- by replacing with and by removing special characters such
- as the prefix.
- @param LanguageString Pointer to a NULL-terminated string containing a
- single ISO 639-2 language identifier, indicating the language to print.
- If the LanguageString is empty (starts with a NULL), the default system
- language will be used to determine the language.
- @param BufferLength Length of the StringBuffer.
- @param StringBuffer The buffer designed to receive the characters in the string.
-
- @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
- @retval EFI_INVALID_PARAMETER The handle or string token is unknown.
- @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
- allow the entire string to be stored.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_STRING) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN STRING_REF Token,
- IN BOOLEAN Raw,
- IN CHAR16 *LanguageString,
- IN OUT UINTN *BufferLength,
- OUT EFI_STRING StringBuffer
- );
-
-/**
- Allows a program to extract a part of a string of not more than a given width.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the string resides.
- @param Token The string token assigned to the string.
- @param Index On input, the offset into the string where the line is to start.
- On output, the index is updated to point to beyond the last character returned
- in the call.
- @param LineWidth The maximum width of the line in units of narrow glyphs.
- @param LanguageString Pointer to a NULL-terminated string containing a
- single ISO 639-2 language identifier, indicating the language to print.
- @param BufferLength Pointer to the length of the StringBuffer.
- @param StringBuffer The buffer designed to receive the characters in the string.
-
- @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
- @retval EFI_NOT_FOUND The font glyph for at least one of the characters in
- the string is not in the font database.
- @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
- to allow the entire string to be stored.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_LINE) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN STRING_REF Token,
- IN OUT UINT16 *Index,
- IN UINT16 LineWidth,
- IN CHAR16 *LanguageString,
- IN OUT UINT16 *BufferLength,
- OUT EFI_STRING StringBuffer
- );
-
-/**
- Allows a program to extract a form or form package that has previously
- been registered with the HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle Handle on which the form resides.
- @param FormId The ID of the form to return. If the ID is zero,
- the entire form package is returned.
- @param BufferLength On input, the length of the Buffer. On output,
- the length of the returned buffer,
- @param Buffer The buffer designed to receive the form(s).
-
- @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
- was updated.
- @retval EFI_INVALID_PARAMETER The handle is unknown.
- @retval EFI_NOT_FOUND A form on the requested handle cannot be found with
- the requested FormId.
- @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
- to allow the form to be stored.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_FORMS) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN EFI_FORM_ID FormId,
- IN OUT UINTN *BufferLength,
- OUT UINT8 *Buffer
- );
-
-/**
- Extracts the defaults that are associated with a given handle in the HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The HII handle from which will have default data retrieved.
- @param DefaultMask The mask used to specify some type of default override when extracting
- the default image data.
- @param VariablePackList A indirect pointer to the first entry of a link list with
- type EFI_HII_VARIABLE_PACK_LIST.
-
- @retval EFI_SUCCESS The VariablePackList was populated with the appropriate
- default setting data.
- @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
- @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
- contain invalid data.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN UINTN DefaultMask,
- OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
- );
-
-/**
- Allows the caller to update a form or form package that has previously been
- registered with the EFI HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle Handle of the package where the form to be updated resides.
- @param Label The label inside the form package where the update is to take place.
- @param AddData If TRUE, adding data at a given Label; otherwise,
- if FALSE, removing data at a given Label.
- @param Data The buffer containing the new tags to insert after the Label
-
- @retval EFI_SUCCESS The form was updated with the new tags.
- @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
- contain an integral number of tags.
- @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_UPDATE_FORM) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN EFI_FORM_LABEL Label,
- IN BOOLEAN AddData,
- IN EFI_HII_UPDATE_DATA *Data
- );
-
-/**
- Retrieves the current keyboard layout.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param DescriptorCount A pointer to the number of Descriptor entries being
- described in the keyboard layout being retrieved.
- @param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR
- entries. Each entry will reflect the definition of a specific physical key.
-
- @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (
- IN EFI_HII_PROTOCOL *This,
- OUT UINT16 *DescriptorCount,
- OUT EFI_KEY_DESCRIPTOR *Descriptor
- );
-
-/**
- @par Protocol Description:
- The HII Protocol manages the HII database, which is a repository for data
- having to do with fonts, strings, forms, keyboards, and other future human
- interface items.
-
- @param NewPack
- Extracts the various packs from a package list.
-
- @param RemovePack
- Removes a package from the HII database.
-
- @param FindHandles
- Determines the handles that are currently active in the database.
-
- @param ExportDatabase
- Export the entire contents of the database to a buffer.
-
- @param TestString
- Tests if all of the characters in a string have corresponding font characters.
-
- @param GetGlyph
- Translates a Unicode character into the corresponding font glyph.
-
- @param GlyphToBlt
- Converts a glyph value into a format that is ready for a UGA BLT command.
-
- @param NewString
- Allows a new string to be added to an already existing string package.
-
- @param GetPrimaryLanguages
- Allows a program to determine the primary languages that are supported
- on a given handle.
-
- @param GetSecondaryLanguages
- Allows a program to determine which secondary languages are supported
- on a given handle for a given primary language.
-
- @param GetString
- Extracts a string from a package that is already registered with the
- EFI HII database.
-
- @param ResetString
- Remove any new strings that were added after the initial string export
- for this handle.
-
- @param GetLine
- Allows a program to extract a part of a string of not more than a given width.
-
- @param GetForms
- Allows a program to extract a form or form package that has been previously registered.
-
- @param GetDefaultImage
- Allows a program to extract the nonvolatile image that represents the default storage image.
-
- @param UpdateForm
- Allows a program to update a previously registered form.
-
- @param GetKeyboardLayout
- Allows a program to extract the current keyboard layout.
-
-**/
-struct _EFI_HII_PROTOCOL {
- EFI_HII_NEW_PACK NewPack;
- EFI_HII_REMOVE_PACK RemovePack;
- EFI_HII_FIND_HANDLES FindHandles;
- EFI_HII_EXPORT ExportDatabase;
-
- EFI_HII_TEST_STRING TestString;
- EFI_HII_GET_GLYPH GetGlyph;
- EFI_HII_GLYPH_TO_BLT GlyphToBlt;
-
- EFI_HII_NEW_STRING NewString;
- EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
- EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
- EFI_HII_GET_STRING GetString;
- EFI_HII_RESET_STRINGS ResetStrings;
- EFI_HII_GET_LINE GetLine;
- EFI_HII_GET_FORMS GetForms;
- EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
- EFI_HII_UPDATE_FORM UpdateForm;
-
- EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
-};
-
-extern EFI_GUID gEfiHiiProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 412b000aeb..0000000000
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
- UGA Draw protocol from the EFI 1.1 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
- { \
- 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
- }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param HorizontalResolution Current video horizontal resolution in pixels
- @param VerticalResolution Current video vertical resolution in pixels
- @param ColorDepth Current video color depth in bits per pixel
- @param RefreshRate Current video refresh rate in Hz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- OUT UINT32 *HorizontalResolution,
- OUT UINT32 *VerticalResolution,
- OUT UINT32 *ColorDepth,
- OUT UINT32 *RefreshRate
- )
-;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param HorizontalResolution Current video horizontal resolution in pixels
- @param VerticalResolution Current video vertical resolution in pixels
- @param ColorDepth Current video color depth in bits per pixel
- @param RefreshRate Current video refresh rate in Hz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- )
-;
-
-typedef struct {
- UINT8 Blue;
- UINT8 Green;
- UINT8 Red;
- UINT8 Reserved;
-} EFI_UGA_PIXEL;
-
-typedef union {
- EFI_UGA_PIXEL Pixel;
- UINT32 Raw;
-} EFI_UGA_PIXEL_UNION;
-
-typedef enum {
- EfiUgaVideoFill,
- EfiUgaVideoToBltBuffer,
- EfiUgaBltBufferToVideo,
- EfiUgaVideoToVideo,
- EfiUgaBltMax
-} EFI_UGA_BLT_OPERATION;
-
-/**
- Type specifying a pointer to a function to perform an UGA Blt operation.
-
- The following table defines actions for BltOperations:
-
- EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
- EfiUgaVideoToBltBuffer - Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
-
- EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
-
- EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
- (SourceX + Width, SourceY + Height) .to the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
-
- @param[in] This - Protocol instance pointer.
- @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
- @param[in] SourceX - X coordinate of source for the BltBuffer.
- @param[in] SourceY - Y coordinate of source for the BltBuffer.
- @param[in] DestinationX - X coordinate of destination for the BltBuffer.
- @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
- @param[in] Width - Width of rectangle in BltBuffer in pixels.
- @param[in] Height - Height of rectangle in BltBuffer in pixels.
- @param[in] Delta - OPTIONAL
-
- @retval EFI_SUCCESS - The Blt operation completed.
- @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
- @retval EFI_DEVICE_ERROR - A hardware error occurred writing to the video buffer.
-
---*/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
- IN EFI_UGA_DRAW_PROTOCOL * This,
- IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-struct _EFI_UGA_DRAW_PROTOCOL {
- EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
- EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
- EFI_UGA_DRAW_PROTOCOL_BLT Blt;
-};
-
-extern EFI_GUID gEfiUgaDrawProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/RiscV64/ProcessorBind.h b/BaseTools/Source/C/Include/RiscV64/ProcessorBind.h
deleted file mode 100644
index 1612d6ea7f..0000000000
--- a/BaseTools/Source/C/Include/RiscV64/ProcessorBind.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for RISC-V.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-//
-// Define the processor type so other code can make processor based choices
-//
-#define MDE_CPU_RISCV64
-
-//
-// Make sure we are using the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-//
-// Use ANSI C 2000 stdint.h integer width declarations
-//
-#include
-typedef uint8_t BOOLEAN;
-typedef int8_t INT8;
-typedef uint8_t UINT8;
-typedef int16_t INT16;
-typedef uint16_t UINT16;
-typedef int32_t INT32;
-typedef uint32_t UINT32;
-typedef int64_t INT64;
-typedef uint64_t UINT64;
-typedef char CHAR8;
-typedef uint16_t CHAR16;
-
-//
-// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
-// 8 bytes on supported 64-bit processor instructions)
-//
-typedef UINT64 UINTN;
-
-//
-// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
-// 8 bytes on supported 64-bit processor instructions)
-//
-typedef INT64 INTN;
-
-//
-// Processor specific defines
-//
-
-//
-// A value of native width with the highest bit set.
-//
-#define MAX_BIT 0x8000000000000000
-
-//
-// A value of native width with the two highest bits set.
-//
-#define MAX_2_BITS 0xC000000000000000
-
-//
-// The stack alignment required for RISC-V
-//
-#define CPU_STACK_ALIGNMENT 16
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#define EFIAPI
-
-#if defined(__GNUC__)
- //
- // For GNU assembly code, .global or .globl can declare global symbols.
- // Define this macro to unify the usage.
- //
- #define ASM_GLOBAL .globl
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/Include/X64/ProcessorBind.h b/BaseTools/Source/C/Include/X64/ProcessorBind.h
deleted file mode 100644
index fce179fe7e..0000000000
--- a/BaseTools/Source/C/Include/X64/ProcessorBind.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64).
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-//
-// Define the processor type so other code can make processor based choices
-//
-#define MDE_CPU_X64
-
-
-//
-// Make sure we are useing the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-
-#if _MSC_EXTENSIONS
-
-//
-// Disable warning that make it impossible to compile at /W4
-// This only works for Microsoft* tools
-//
-
-//
-// Disabling bitfield type checking warnings.
-//
-#pragma warning ( disable : 4214 )
-
-//
-// Disabling the unreferenced formal parameter warnings.
-//
-#pragma warning ( disable : 4100 )
-
-//
-// Disable slightly different base types warning as CHAR8 * can not be set
-// to a constant string.
-//
-#pragma warning ( disable : 4057 )
-
-//
-// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
-//
-#pragma warning ( disable : 4127 )
-
-
-#endif
-
-
-#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
- //
- // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
- //
-
- #if _MSC_EXTENSIONS
-
-
- //
- // use Microsoft C compiler dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #else
- #ifdef _EFI_P64
- //
- // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints
- // are 32-bits
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short CHAR16;
- typedef unsigned short UINT16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #else
- //
- // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.
- //
- typedef unsigned long UINT64;
- typedef long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #endif
- #endif
-
- #define UINT8_MAX 0xff
-
-#else
- //
- // Use ANSI C 2000 stdint.h integer width declarations
- //
- #include
- typedef uint8_t BOOLEAN;
- typedef int8_t INT8;
- typedef uint8_t UINT8;
- typedef int16_t INT16;
- typedef uint16_t UINT16;
- typedef int32_t INT32;
- typedef uint32_t UINT32;
- typedef int64_t INT64;
- typedef uint64_t UINT64;
- typedef char CHAR8;
- typedef uint16_t CHAR16;
-
-#endif
-
-typedef UINT64 UINTN;
-typedef INT64 INTN;
-
-
-//
-// Processor specific defines
-//
-#define MAX_BIT 0x8000000000000000ULL
-#define MAX_2_BITS 0xC000000000000000ULL
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#if _MSC_EXTENSIONS
- ///
- /// Define the standard calling convention regardless of optimization level.
- /// __cdecl is Microsoft* specific C extension.
- ///
- #define EFIAPI __cdecl
-#elif __GNUC__
- ///
- /// Define the standard calling convention regardless of optimization level.
- /// efidecl is an extension to GCC that supports the differnece between x64
- /// GCC ABI and x64 Microsoft* ABI. EFI is closer to the Microsoft* ABI and
- /// EFIAPI makes sure the right ABI is used for public interfaces.
- /// eficecl is a work in progress and we do not yet have the compiler
- ///
- #define EFIAPI
-#else
- #define EFIAPI
-#endif
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if _MSC_EXTENSIONS
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#endif
-
diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
index bf4706ee23..f9613a7d6d 100644
--- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
+++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
@@ -12,6 +12,8 @@
#define _CRT_SECURE_NO_WARNINGS
+#include "WinNtInclude.h"
+
#include
#include
#include
diff --git a/BaseTools/Source/C/Makefiles/footer.makefile b/BaseTools/Source/C/Makefiles/footer.makefile
index 7546da8cf5..e914749169 100644
--- a/BaseTools/Source/C/Makefiles/footer.makefile
+++ b/BaseTools/Source/C/Makefiles/footer.makefile
@@ -17,6 +17,10 @@ install: $(MAKEROOT)/libs-$(HOST_ARCH) $(LIBRARY)
$(LIBRARY): $(OBJECTS)
$(AR) crs $@ $^
+$(EDK2_OBJPATH)/%.o : $(EDK2_PATH)/%.c
+ @mkdir -p $(@D)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(EDK2_INCLUDE) $< -o $@
+
%.o : %.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
@@ -26,5 +30,6 @@ $(LIBRARY): $(OBJECTS)
.PHONY: clean
clean:
@rm -f $(OBJECTS) $(LIBRARY) $(DEPFILES)
+ @rm -rf $(EDK2_OBJPATH)
-include $(DEPFILES)
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 1bf003523b..7fdb757b25 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -8,6 +8,9 @@
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
+EDK2_PATH ?= $(MAKEROOT)/../../..
+EDK2_OBJPATH ?= $(MAKEROOT)/obj/edk2
+
ifndef HOST_ARCH
#
# If HOST_ARCH is not defined, then we use 'uname -m' to attempt
@@ -61,27 +64,38 @@ endif
LINKER ?= $(CC)
ifeq ($(HOST_ARCH), IA32)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
+ARCH_INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/Ia32/
else ifeq ($(HOST_ARCH), X64)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
+ARCH_INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/X64/
else ifeq ($(HOST_ARCH), ARM)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
+ARCH_INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/Arm/
else ifeq ($(HOST_ARCH), AARCH64)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/
+ARCH_INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/AArch64/
else ifeq ($(HOST_ARCH), RISCV64)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/RiscV64/
+ARCH_INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/RiscV64/
else ifeq ($(HOST_ARCH), LOONGARCH64)
ARCH_INCLUDE = -I $(MAKEROOT)/Include/LoongArch64/
+ARCH_INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/LoongArch64/
else
$(error Bad HOST_ARCH)
endif
INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
+
+INCLUDE += -I $(EDK2_PATH)/MdePkg/Include/ -I $(EDK2_PATH)/MdeModulePkg/Include/
+
+EDK2_INCLUDE = -include $(MAKEROOT)/Include/Common/AutoGen.h
+
CPPFLAGS = $(INCLUDE)
# keep EXTRA_OPTFLAGS last
@@ -111,6 +125,12 @@ else
LDFLAGS =
CXXFLAGS = -Wno-unused-result
endif
+
+CPPFLAGS += -fshort-wchar -flto -DUSING_LTO
+ifeq ($(HOST_ARCH), X64)
+ CPPFLAGS += "-DEFIAPI=__attribute__((ms_abi))"
+endif
+
ifeq ($(HOST_ARCH), IA32)
#
# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/Makefiles/ms.common
index 8391f10d5d..ac6802e721 100644
--- a/BaseTools/Source/C/Makefiles/ms.common
+++ b/BaseTools/Source/C/Makefiles/ms.common
@@ -17,6 +17,10 @@
HOST_ARCH = IA32
!ENDIF
+!IFNDEF EDK2_PATH
+EDK2_PATH = ..\..\..\..
+!ENDIF
+
MAKE = nmake -nologo
# DOS del command doesn't support ":\\" in the file path, such as j:\\BaseTools. Convert ":\\" to ":\"
@@ -26,21 +30,26 @@ EDK_TOOLS_PATH = $(EDK_TOOLS_PATH::\\=:\)
SOURCE_PATH = $(BASE_TOOLS_PATH)\Source\C
BIN_PATH = $(BASE_TOOLS_PATH)\Bin
LIB_PATH = $(BASE_TOOLS_PATH)\Lib
+EDK2_OBJPATH = ..\obj\edk2
SYS_BIN_PATH=$(EDK_TOOLS_PATH)\Bin
SYS_LIB_PATH=$(EDK_TOOLS_PATH)\Lib
!IF "$(HOST_ARCH)"=="IA32"
ARCH_INCLUDE = $(SOURCE_PATH)\Include\Ia32
+ARCH_INCLUDE = $(ARCH_INCLUDE) -I $(EDK2_PATH)\MdePkg\Include\Ia32
BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win32
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win32
+EDK2_OBJPATH = ..\obj\Win32\edk2
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
!ELSEIF "$(HOST_ARCH)"=="X64"
ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
+ARCH_INCLUDE = $(ARCH_INCLUDE) -I $(EDK2_PATH)\MdePkg\Include\X64
BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win64
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win64
+EDK2_OBJPATH = ..\obj\Win64\edk2
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
@@ -57,5 +66,9 @@ LINKER = $(LD)
INC = $(INC) -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I $(SOURCE_PATH)\Common
+INC = $(INC) -I $(EDK2_PATH)\MdePkg\Include -I $(EDK2_PATH)\MdeModulePkg\Include
+
+EDK2_INC = $(INC) /FI..\Include\Common\AutoGen.h
+
CFLAGS = $(CFLAGS) /nologo /Z7 /c /O2 /MT /W4 /WX /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /Z7 /c /O2 /MT /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
diff --git a/BaseTools/Source/C/Makefiles/ms.rule b/BaseTools/Source/C/Makefiles/ms.rule
index 7d53316c43..a7ea626592 100644
--- a/BaseTools/Source/C/Makefiles/ms.rule
+++ b/BaseTools/Source/C/Makefiles/ms.rule
@@ -7,6 +7,26 @@
#DEPFILES = $(OBJECTS:%.o=%.d)
+{$(EDK2_PATH)\MdePkg\Library\BaseDebugPrintErrorLevelLib\}.c{$(EDK2_OBJPATH)\MdePkg\Library\BaseDebugPrintErrorLevelLib\}.obj :
+ -@if not exist $(@D)\ mkdir $(@D)
+ $(CC) -c $(CFLAGS) $(EDK2_INC) $< -Fo$@
+
+{$(EDK2_PATH)\MdePkg\Library\BaseLib\}.c{$(EDK2_OBJPATH)\MdePkg\Library\BaseLib\}.obj :
+ -@if not exist $(@D)\ mkdir $(@D)
+ $(CC) -c $(CFLAGS) $(EDK2_INC) $< -Fo$@
+
+{$(EDK2_PATH)\MdePkg\Library\BaseMemoryLib\}.c{$(EDK2_OBJPATH)\MdePkg\Library\BaseMemoryLib\}.obj :
+ -@if not exist $(@D)\ mkdir $(@D)
+ $(CC) -c $(CFLAGS) $(EDK2_INC) $< -Fo$@
+
+{$(EDK2_PATH)\MdePkg\Library\BasePrintLib\}.c{$(EDK2_OBJPATH)\MdePkg\Library\BasePrintLib\}.obj :
+ -@if not exist $(@D)\ mkdir $(@D)
+ $(CC) -c $(CFLAGS) $(EDK2_INC) $< -Fo$@
+
+{$(EDK2_PATH)\MdePkg\Library\UefiDevicePathLib\}.c{$(EDK2_OBJPATH)\MdePkg\Library\UefiDevicePathLib\}.obj :
+ -@if not exist $(@D)\ mkdir $(@D)
+ $(CC) -c $(CFLAGS) $(EDK2_INC) $< -Fo$@
+
.c.obj :
$(CC) -c $(CFLAGS) $(INC) $< -Fo$@
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index 428011ca04..be8e30dbde 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -23,9 +23,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include "Compress.h"
#include "Decompress.h"
@@ -1395,7 +1395,7 @@ Returns:
break;
}
- if (!CompareGuid (
+ if (!BtCompareGuid (
&FileHeader->Name,
&gPeiAprioriFileNameGuid
))
@@ -1404,7 +1404,7 @@ Returns:
printf("PEI APRIORI FILE:\n");
return PrintAprioriFile (FileHeader);
}
- if (!CompareGuid (
+ if (!BtCompareGuid (
&FileHeader->Name,
&gAprioriGuid
))
@@ -1418,6 +1418,7 @@ Returns:
}
EFI_STATUS
+EFIAPI
RebaseImageRead (
IN VOID *FileHandle,
IN UINTN FileOffset,
@@ -2082,7 +2083,7 @@ Returns:
);
free (ExtractionTool);
- if (!CompareGuid (
+ if (!BtCompareGuid (
EfiGuid,
&gEfiCrc32GuidedSectionExtractionProtocolGuid
)
@@ -2128,7 +2129,7 @@ Returns:
//
// Check for CRC32 sections which we can handle internally if needed.
//
- } else if (!CompareGuid (
+ } else if (!BtCompareGuid (
EfiGuid,
&gEfiCrc32GuidedSectionExtractionProtocolGuid
)