summaryrefslogtreecommitdiff
path: root/Core/MdePkg/Include/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Core/MdePkg/Include/Library')
-rw-r--r--Core/MdePkg/Include/Library/BaseLib.h8910
-rw-r--r--Core/MdePkg/Include/Library/BaseMemoryLib.h489
-rw-r--r--Core/MdePkg/Include/Library/CacheMaintenanceLib.h212
-rw-r--r--Core/MdePkg/Include/Library/CpuLib.h51
-rw-r--r--Core/MdePkg/Include/Library/DebugLib.h529
-rw-r--r--Core/MdePkg/Include/Library/DebugPrintErrorLevelLib.h43
-rw-r--r--Core/MdePkg/Include/Library/DevicePathLib.h566
-rw-r--r--Core/MdePkg/Include/Library/DxeCoreEntryPoint.h99
-rw-r--r--Core/MdePkg/Include/Library/DxeServicesLib.h309
-rw-r--r--Core/MdePkg/Include/Library/DxeServicesTableLib.h34
-rw-r--r--Core/MdePkg/Include/Library/ExtendedSalLib.h494
-rw-r--r--Core/MdePkg/Include/Library/ExtractGuidedSectionLib.h284
-rw-r--r--Core/MdePkg/Include/Library/FileHandleLib.h507
-rw-r--r--Core/MdePkg/Include/Library/HobLib.h534
-rw-r--r--Core/MdePkg/Include/Library/HstiLib.h158
-rw-r--r--Core/MdePkg/Include/Library/IoLib.h2815
-rw-r--r--Core/MdePkg/Include/Library/MemoryAllocationLib.h493
-rw-r--r--Core/MdePkg/Include/Library/OrderedCollectionLib.h425
-rw-r--r--Core/MdePkg/Include/Library/PalLib.h63
-rw-r--r--Core/MdePkg/Include/Library/PcdLib.h2260
-rw-r--r--Core/MdePkg/Include/Library/PciCf8Lib.h1094
-rw-r--r--Core/MdePkg/Include/Library/PciExpressLib.h1061
-rw-r--r--Core/MdePkg/Include/Library/PciLib.h1062
-rw-r--r--Core/MdePkg/Include/Library/PciSegmentLib.h1045
-rw-r--r--Core/MdePkg/Include/Library/PeCoffExtraActionLib.h53
-rw-r--r--Core/MdePkg/Include/Library/PeCoffGetEntryPointLib.h122
-rw-r--r--Core/MdePkg/Include/Library/PeCoffLib.h392
-rw-r--r--Core/MdePkg/Include/Library/PeiCoreEntryPoint.h138
-rw-r--r--Core/MdePkg/Include/Library/PeiServicesLib.h524
-rw-r--r--Core/MdePkg/Include/Library/PeiServicesTablePointerLib.h74
-rw-r--r--Core/MdePkg/Include/Library/PeimEntryPoint.h109
-rw-r--r--Core/MdePkg/Include/Library/PerformanceLib.h366
-rw-r--r--Core/MdePkg/Include/Library/PostCodeLib.h150
-rw-r--r--Core/MdePkg/Include/Library/PrintLib.h1051
-rw-r--r--Core/MdePkg/Include/Library/ReportStatusCodeLib.h492
-rw-r--r--Core/MdePkg/Include/Library/ResourcePublicationLib.h42
-rw-r--r--Core/MdePkg/Include/Library/RngLib.h86
-rw-r--r--Core/MdePkg/Include/Library/S3BootScriptLib.h602
-rw-r--r--Core/MdePkg/Include/Library/S3IoLib.h2677
-rw-r--r--Core/MdePkg/Include/Library/S3PciLib.h1052
-rw-r--r--Core/MdePkg/Include/Library/S3SmbusLib.h455
-rw-r--r--Core/MdePkg/Include/Library/S3StallLib.h39
-rw-r--r--Core/MdePkg/Include/Library/SalLib.h59
-rw-r--r--Core/MdePkg/Include/Library/SerialPortLib.h180
-rw-r--r--Core/MdePkg/Include/Library/SmbusLib.h497
-rw-r--r--Core/MdePkg/Include/Library/SmiHandlerProfileLib.h87
-rw-r--r--Core/MdePkg/Include/Library/SmmIoLib.h42
-rw-r--r--Core/MdePkg/Include/Library/SmmLib.h89
-rw-r--r--Core/MdePkg/Include/Library/SmmMemLib.h138
-rw-r--r--Core/MdePkg/Include/Library/SmmPeriodicSmiLib.h184
-rw-r--r--Core/MdePkg/Include/Library/SmmServicesTableLib.h43
-rw-r--r--Core/MdePkg/Include/Library/SynchronizationLib.h295
-rw-r--r--Core/MdePkg/Include/Library/TimerLib.h114
-rw-r--r--Core/MdePkg/Include/Library/UefiApplicationEntryPoint.h154
-rw-r--r--Core/MdePkg/Include/Library/UefiBootServicesTableLib.h34
-rw-r--r--Core/MdePkg/Include/Library/UefiDecompressLib.h108
-rw-r--r--Core/MdePkg/Include/Library/UefiDriverEntryPoint.h195
-rw-r--r--Core/MdePkg/Include/Library/UefiLib.h1493
-rw-r--r--Core/MdePkg/Include/Library/UefiRuntimeLib.h588
-rw-r--r--Core/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h32
-rw-r--r--Core/MdePkg/Include/Library/UefiScsiLib.h1181
-rw-r--r--Core/MdePkg/Include/Library/UefiUsbLib.h563
62 files changed, 0 insertions, 38037 deletions
diff --git a/Core/MdePkg/Include/Library/BaseLib.h b/Core/MdePkg/Include/Library/BaseLib.h
deleted file mode 100644
index 791849b804..0000000000
--- a/Core/MdePkg/Include/Library/BaseLib.h
+++ /dev/null
@@ -1,8910 +0,0 @@
-/** @file
- Provides string functions, linked list functions, math functions, synchronization
- functions, file path functions, and CPU architecture-specific functions.
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __BASE_LIB__
-#define __BASE_LIB__
-
-//
-// Definitions for architecture-specific types
-//
-#if defined (MDE_CPU_IA32)
-///
-/// The IA-32 architecture context buffer used by SetJump() and LongJump().
-///
-typedef struct {
- UINT32 Ebx;
- UINT32 Esi;
- UINT32 Edi;
- UINT32 Ebp;
- UINT32 Esp;
- UINT32 Eip;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
-
-#endif // defined (MDE_CPU_IA32)
-
-#if defined (MDE_CPU_IPF)
-
-///
-/// The Itanium architecture context buffer used by SetJump() and LongJump().
-///
-typedef struct {
- UINT64 F2[2];
- UINT64 F3[2];
- UINT64 F4[2];
- UINT64 F5[2];
- UINT64 F16[2];
- UINT64 F17[2];
- UINT64 F18[2];
- UINT64 F19[2];
- UINT64 F20[2];
- UINT64 F21[2];
- UINT64 F22[2];
- UINT64 F23[2];
- UINT64 F24[2];
- UINT64 F25[2];
- UINT64 F26[2];
- UINT64 F27[2];
- UINT64 F28[2];
- UINT64 F29[2];
- UINT64 F30[2];
- UINT64 F31[2];
- UINT64 R4;
- UINT64 R5;
- UINT64 R6;
- UINT64 R7;
- UINT64 SP;
- UINT64 BR0;
- UINT64 BR1;
- UINT64 BR2;
- UINT64 BR3;
- UINT64 BR4;
- UINT64 BR5;
- UINT64 InitialUNAT;
- UINT64 AfterSpillUNAT;
- UINT64 PFS;
- UINT64 BSP;
- UINT64 Predicates;
- UINT64 LoopCount;
- UINT64 FPSR;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 0x10
-
-#endif // defined (MDE_CPU_IPF)
-
-#if defined (MDE_CPU_X64)
-///
-/// The x64 architecture context buffer used by SetJump() and LongJump().
-///
-typedef struct {
- UINT64 Rbx;
- UINT64 Rsp;
- UINT64 Rbp;
- UINT64 Rdi;
- UINT64 Rsi;
- UINT64 R12;
- UINT64 R13;
- UINT64 R14;
- UINT64 R15;
- UINT64 Rip;
- UINT64 MxCsr;
- UINT8 XmmBuffer[160]; ///< XMM6-XMM15.
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
-
-#endif // defined (MDE_CPU_X64)
-
-#if defined (MDE_CPU_EBC)
-///
-/// The EBC context buffer used by SetJump() and LongJump().
-///
-typedef struct {
- UINT64 R0;
- UINT64 R1;
- UINT64 R2;
- UINT64 R3;
- UINT64 IP;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
-
-#endif // defined (MDE_CPU_EBC)
-
-#if defined (MDE_CPU_ARM)
-
-typedef struct {
- UINT32 R3; ///< A copy of R13.
- UINT32 R4;
- UINT32 R5;
- UINT32 R6;
- UINT32 R7;
- UINT32 R8;
- UINT32 R9;
- UINT32 R10;
- UINT32 R11;
- UINT32 R12;
- UINT32 R14;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
-
-#endif // defined (MDE_CPU_ARM)
-
-#if defined (MDE_CPU_AARCH64)
-typedef struct {
- // GP regs
- UINT64 X19;
- UINT64 X20;
- UINT64 X21;
- UINT64 X22;
- UINT64 X23;
- UINT64 X24;
- UINT64 X25;
- UINT64 X26;
- UINT64 X27;
- UINT64 X28;
- UINT64 FP;
- UINT64 LR;
- UINT64 IP0;
-
- // FP regs
- UINT64 D8;
- UINT64 D9;
- UINT64 D10;
- UINT64 D11;
- UINT64 D12;
- UINT64 D13;
- UINT64 D14;
- UINT64 D15;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
-
-#endif // defined (MDE_CPU_AARCH64)
-
-
-//
-// String Services
-//
-
-
-/**
- Returns the length of a Null-terminated Unicode string.
-
- This function is similar as strlen_s defined in C11.
-
- If String is not aligned on a 16-bit boundary, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
- @param MaxSize The maximum number of Destination Unicode
- char, including terminating null char.
-
- @retval 0 If String is NULL.
- @retval MaxSize If there is no null character in the first MaxSize characters of String.
- @return The number of characters that percede the terminating null character.
-
-**/
-UINTN
-EFIAPI
-StrnLenS (
- IN CONST CHAR16 *String,
- IN UINTN MaxSize
- );
-
-/**
- Returns the size of a Null-terminated Unicode string in bytes, including the
- Null terminator.
-
- This function returns the size of the Null-terminated Unicode string
- specified by String in bytes, including the Null terminator.
-
- If String is not aligned on a 16-bit boundary, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
- @param MaxSize The maximum number of Destination Unicode
- char, including the Null terminator.
-
- @retval 0 If String is NULL.
- @retval (sizeof (CHAR16) * (MaxSize + 1))
- If there is no Null terminator in the first MaxSize characters of
- String.
- @return The size of the Null-terminated Unicode string in bytes, including
- the Null terminator.
-
-**/
-UINTN
-EFIAPI
-StrnSizeS (
- IN CONST CHAR16 *String,
- IN UINTN MaxSize
- );
-
-/**
- Copies the string pointed to by Source (including the terminating null char)
- to the array pointed to by Destination.
-
- This function is similar as strcpy_s defined in C11.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrCpyS (
- OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source
- );
-
-/**
- Copies not more than Length successive char from the string pointed to by
- Source to the array pointed to by Destination. If no null char is copied from
- Source, then Destination[Length] is always set to null.
-
- This function is similar as strncpy_s defined in C11.
-
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to copy.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrnCpyS (
- OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- );
-
-/**
- Appends a copy of the string pointed to by Source (including the terminating
- null char) to the end of the string pointed to by Destination.
-
- This function is similar as strcat_s defined in C11.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrCatS (
- IN OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source
- );
-
-/**
- Appends not more than Length successive char from the string pointed to by
- Source to the end of the string pointed to by Destination. If no null char is
- copied from Source, then Destination[StrLen(Destination) + Length] is always
- set to null.
-
- This function is similar as strncat_s defined in C11.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to copy.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrnCatS (
- IN OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- );
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of type UINTN.
-
- This function outputs a value of type UINTN 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 UINTN, then
- MAX_UINTN 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 UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrDecimalToUintnS (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINTN *Data
- );
-
-/**
- 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
-EFIAPI
-StrDecimalToUint64S (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- );
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type
- UINTN.
-
- This function outputs a value of type UINTN 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 UINTN, then
- MAX_UINTN 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 UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrHexToUintnS (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINTN *Data
- );
-
-/**
- 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
-EFIAPI
-StrHexToUint64S (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- );
-
-/**
- Returns the length of a Null-terminated Ascii string.
-
- This function is similar as strlen_s defined in C11.
-
- @param String A pointer to a Null-terminated Ascii string.
- @param MaxSize The maximum number of Destination Ascii
- char, including terminating null char.
-
- @retval 0 If String is NULL.
- @retval MaxSize If there is no null character in the first MaxSize characters of String.
- @return The number of characters that percede the terminating null character.
-
-**/
-UINTN
-EFIAPI
-AsciiStrnLenS (
- IN CONST CHAR8 *String,
- IN UINTN MaxSize
- );
-
-/**
- Returns the size of a Null-terminated Ascii string in bytes, including the
- Null terminator.
-
- This function returns the size of the Null-terminated Ascii string specified
- by String in bytes, including the Null terminator.
-
- @param String A pointer to a Null-terminated Ascii string.
- @param MaxSize The maximum number of Destination Ascii
- char, including the Null terminator.
-
- @retval 0 If String is NULL.
- @retval (sizeof (CHAR8) * (MaxSize + 1))
- If there is no Null terminator in the first MaxSize characters of
- String.
- @return The size of the Null-terminated Ascii string in bytes, including the
- Null terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiStrnSizeS (
- IN CONST CHAR8 *String,
- IN UINTN MaxSize
- );
-
-/**
- Copies the string pointed to by Source (including the terminating null char)
- to the array pointed to by Destination.
-
- This function is similar as strcpy_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrCpyS (
- OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source
- );
-
-/**
- Copies not more than Length successive char from the string pointed to by
- Source to the array pointed to by Destination. If no null char is copied from
- Source, then Destination[Length] is always set to null.
-
- This function is similar as strncpy_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
- @param Length The maximum number of Ascii characters to copy.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrnCpyS (
- OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- );
-
-/**
- Appends a copy of the string pointed to by Source (including the terminating
- null char) to the end of the string pointed to by Destination.
-
- This function is similar as strcat_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrCatS (
- IN OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source
- );
-
-/**
- Appends not more than Length successive char from the string pointed to by
- Source to the end of the string pointed to by Destination. If no null char is
- copied from Source, then Destination[StrLen(Destination) + Length] is always
- set to null.
-
- This function is similar as strncat_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
- @param Length The maximum number of Ascii characters to copy.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrnCatS (
- IN OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- );
-
-/**
- Convert a Null-terminated Ascii decimal string to a value of type UINTN.
-
- This function outputs a value of type UINTN by interpreting the contents of
- the Ascii string specified by String as a decimal number. The format of the
- input Ascii 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 PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii 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 UINTN, then
- MAX_UINTN 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 Ascii 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 PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrDecimalToUintnS (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINTN *Data
- );
-
-/**
- Convert a Null-terminated Ascii decimal string to a value of type UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Ascii string specified by String as a decimal number. The format of the
- input Ascii 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 PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii 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 Ascii 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 PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrDecimalToUint64S (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- );
-
-/**
- Convert a Null-terminated Ascii hexadecimal string to a value of type UINTN.
-
- This function outputs a value of type UINTN by interpreting the contents of
- the Ascii string specified by String as a hexadecimal number. The format of
- the input Ascii 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 digits]. The running zero before [x] or
- [hexadecimal digits] 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-terminator,
- whichever on comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii 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 UINTN, then
- MAX_UINTN 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 Ascii 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 PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrHexToUintnS (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINTN *Data
- );
-
-/**
- Convert a Null-terminated Ascii hexadecimal string to a value of type UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Ascii string specified by String as a hexadecimal number. The format of
- the input Ascii 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 digits]. The running zero before [x] or
- [hexadecimal digits] 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-terminator,
- whichever on comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii 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 Ascii 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 PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrHexToUint64S (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- );
-
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Copies one Null-terminated Unicode string to another Null-terminated Unicode
- string and returns the new Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Destination The pointer to a Null-terminated Unicode string.
- @param Source The pointer to a Null-terminated Unicode string.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- );
-
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Copies up to a specified length from one Null-terminated Unicode string to
- another Null-terminated Unicode string and returns the new Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. At most, Length Unicode
- characters are copied from Source to Destination. If Length is 0, then
- Destination is returned unmodified. If Length is greater that the number of
- Unicode characters in Source, then Destination is padded with Null Unicode
- characters. If Source and Destination overlap, then the results are
- undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination The pointer to a Null-terminated Unicode string.
- @param Source The pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to copy.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrnCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- );
-#endif
-
-/**
- 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 Pointer to a Null-terminated Unicode string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-StrLen (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Returns the size of a Null-terminated Unicode string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of 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 The pointer to a Null-terminated Unicode string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-StrSize (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Compares 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. 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 FirstString is NULL, then ASSERT().
- If FirstString is not aligned on a 16-bit boundary, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If SecondString is not aligned on a 16-bit boundary, 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 The pointer to a Null-terminated Unicode string.
- @param SecondString The pointer to a Null-terminated Unicode string.
-
- @retval 0 FirstString is identical to SecondString.
- @return others FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-StrCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString
- );
-
-
-/**
- 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 The pointer to a Null-terminated Unicode string.
- @param SecondString The 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
-EFIAPI
-StrnCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString,
- IN UINTN Length
- );
-
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Concatenates one Null-terminated Unicode string to another Null-terminated
- Unicode string, and returns the concatenated Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination. The Null-terminated concatenated
- Unicode String is returned. If Source and Destination overlap, then the
- results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param Destination The pointer to a Null-terminated Unicode string.
- @param Source The pointer to a Null-terminated Unicode string.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- );
-
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Concatenates up to a specified length one Null-terminated Unicode to the end
- of another Null-terminated Unicode string, and returns the concatenated
- Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination, and Destination is returned. At
- most, Length Unicode characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength
- Unicode characters, not including the Null-terminator, then ASSERT().
-
- @param Destination The pointer to a Null-terminated Unicode string.
- @param Source The pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to concatenate from
- Source.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrnCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- );
-#endif
-
-/**
- Returns the first occurrence of a Null-terminated Unicode sub-string
- in a Null-terminated Unicode string.
-
- This function scans the contents of the Null-terminated Unicode string
- specified by String and returns the first occurrence of SearchString.
- If SearchString is not found in String, then NULL is returned. If
- the length of SearchString is zero, then String is returned.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If SearchString is NULL, then ASSERT().
- If SearchString is not aligned on a 16-bit boundary, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and SearchString
- or String contains more than PcdMaximumUnicodeStringLength Unicode
- characters, not including the Null-terminator, then ASSERT().
-
- @param String The pointer to a Null-terminated Unicode string.
- @param SearchString The pointer to a Null-terminated Unicode string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @return others If there is a match.
-
-**/
-CHAR16 *
-EFIAPI
-StrStr (
- IN CONST CHAR16 *String,
- IN CONST CHAR16 *SearchString
- );
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINTN.
-
- This function returns a value of type UINTN 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 String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINTN, then MAX_UINTN is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- @param String The pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-StrDecimalToUintn (
- IN CONST CHAR16 *String
- );
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINT64.
-
- This function returns 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 String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINT64, then MAX_UINT64 is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- @param String The pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-StrDecimalToUint64 (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN 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 String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then MAX_UINTN is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
- then ASSERT().
-
- @param String The pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-StrHexToUintn (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
-
- This function returns 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 String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then MAX_UINT64 is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
- then ASSERT().
-
- @param String The pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-StrHexToUint64 (
- IN CONST CHAR16 *String
- );
-
-/**
- Convert a Null-terminated Unicode string to IPv6 address and prefix length.
-
- This function outputs a value of type IPv6_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the Unicode string specified
- by String. The format of the input Unicode string String is as follows:
-
- X:X:X:X:X:X:X:X[/P]
-
- X contains one to four hexadecimal digit characters in the range [0-9], [a-f] and
- [A-F]. X is converted to a value of type UINT16, whose low byte is stored in low
- memory address and high byte is stored in high memory address. P contains decimal
- digit characters in the range [0-9]. The running zero in the beginning of P will
- be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid hexadecimal digit character after eight X's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- "::" can be used to compress one or more groups of X when X contains only 0.
- The "::" can only appear once in the String.
-
- If String is NULL, then ASSERT().
-
- If Address 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 EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan 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 Address Pointer to the converted IPv6 address.
- @param PrefixLength Pointer to the converted IPv6 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If X contains more than four hexadecimal
- digit characters.
- If String contains "::" and number of X
- is not less than 8.
- If P starts with character that is not a
- valid decimal digit character.
- If the decimal number converted from P
- exceeds 128.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrToIpv6Address (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT IPv6_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- );
-
-/**
- Convert a Null-terminated Unicode string to IPv4 address and prefix length.
-
- This function outputs a value of type IPv4_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the Unicode string specified
- by String. The format of the input Unicode string String is as follows:
-
- D.D.D.D[/P]
-
- D and P are decimal digit characters in the range [0-9]. The running zero in
- the beginning of D and P will be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid decimal digit character after four D's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- If String is NULL, then ASSERT().
-
- If Address 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 EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan 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 Address Pointer to the converted IPv4 address.
- @param PrefixLength Pointer to the converted IPv4 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not in the correct format.
- If any decimal number converted from D
- exceeds 255.
- If the decimal number converted from P
- exceeds 32.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrToIpv4Address (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT IPv4_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- );
-
-#define GUID_STRING_LENGTH 36
-
-/**
- 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
-EFIAPI
-StrToGuid (
- IN CONST CHAR16 *String,
- OUT GUID *Guid
- );
-
-/**
- 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
-EFIAPI
-StrHexToBytes (
- IN CONST CHAR16 *String,
- IN UINTN Length,
- OUT UINT8 *Buffer,
- IN UINTN MaxBufferSize
- );
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Convert a Null-terminated Unicode string to a Null-terminated
- ASCII string and returns the ASCII string.
-
- This function converts the content of the Unicode string Source
- to the ASCII string Destination by copying the lower 8 bits of
- each Unicode character. It returns Destination.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
-
- If any Unicode characters in Source contain non-zero value in
- the upper 8 bits, then ASSERT().
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and Source contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and Source contains more
- than PcdMaximumAsciiStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Source The pointer to a Null-terminated Unicode string.
- @param Destination The pointer to a Null-terminated ASCII string.
-
- @return Destination.
-
-**/
-CHAR8 *
-EFIAPI
-UnicodeStrToAsciiStr (
- IN CONST CHAR16 *Source,
- OUT CHAR8 *Destination
- );
-
-#endif
-
-/**
- Convert a Null-terminated Unicode string to a Null-terminated
- ASCII string.
-
- This function is similar to AsciiStrCpyS.
-
- This function converts the content of the Unicode string Source
- to the ASCII string Destination by copying the lower 8 bits of
- each Unicode character. The function terminates the ASCII string
- Destination by appending a Null-terminator character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
-
- If any Unicode characters in Source contain non-zero value in
- the upper 8 bits, then ASSERT().
-
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Source The pointer to a Null-terminated Unicode string.
- @param Destination The pointer to a Null-terminated ASCII string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-UnicodeStrToAsciiStrS (
- IN CONST CHAR16 *Source,
- OUT CHAR8 *Destination,
- IN UINTN DestMax
- );
-
-/**
- Convert not more than Length successive characters from a Null-terminated
- Unicode string to a Null-terminated Ascii string. If no null char is copied
- from Source, then Destination[Length] is always set to null.
-
- This function converts not more than Length successive characters from the
- Unicode string Source to the Ascii string Destination by copying the lower 8
- bits of each Unicode character. The function terminates the Ascii string
- Destination by appending a Null-terminator character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
-
- If any Unicode characters in Source contain non-zero value in the upper 8
- bits, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Source The pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to
- convert.
- @param Destination The pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param DestinationLength The number of Unicode characters converted.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If DestinationLength is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and Length or DestMax is greater than
- PcdMaximumAsciiStringLength.
- If PcdMaximumUnicodeStringLength is not
- zero, and Length or DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(StrLen(Source), Length).
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-UnicodeStrnToAsciiStrS (
- IN CONST CHAR16 *Source,
- IN UINTN Length,
- OUT CHAR8 *Destination,
- IN UINTN DestMax,
- OUT UINTN *DestinationLength
- );
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Copies one Null-terminated ASCII string to another Null-terminated ASCII
- string and returns the new ASCII string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param Destination The pointer to a Null-terminated ASCII string.
- @param Source The pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- );
-
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Copies up to a specified length one Null-terminated ASCII string to another
- Null-terminated ASCII string and returns the new ASCII string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. At most, Length ASCII characters
- are copied from Source to Destination. If Length is 0, then Destination is
- returned unmodified. If Length is greater that the number of ASCII characters
- in Source, then Destination is padded with Null ASCII characters. If Source
- and Destination overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination The pointer to a Null-terminated ASCII string.
- @param Source The pointer to a Null-terminated ASCII string.
- @param Length The maximum number of ASCII characters to copy.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- );
-#endif
-
-/**
- Returns the length of a Null-terminated ASCII string.
-
- This function returns the number of ASCII characters in the Null-terminated
- ASCII string specified by String.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrLen (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Returns the size of a Null-terminated ASCII string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated ASCII string
- specified by String.
-
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrSize (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Compares two Null-terminated ASCII strings, and returns the difference
- between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched ASCII character in SecondString subtracted from the first
- mismatched ASCII character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString The pointer to a Null-terminated ASCII string.
- @param SecondString The pointer to a Null-terminated ASCII string.
-
- @retval ==0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- );
-
-
-/**
- Performs a case insensitive comparison of two Null-terminated ASCII strings,
- and returns the difference between the first mismatched ASCII characters.
-
- This function performs a case insensitive comparison of the Null-terminated
- ASCII string FirstString to the Null-terminated ASCII string SecondString. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched lower case ASCII character in
- SecondString subtracted from the first mismatched lower case ASCII character
- in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString The pointer to a Null-terminated ASCII string.
- @param SecondString The pointer to a Null-terminated ASCII string.
-
- @retval ==0 FirstString is identical to SecondString using case insensitive
- comparisons.
- @retval !=0 FirstString is not identical to SecondString using case
- insensitive comparisons.
-
-**/
-INTN
-EFIAPI
-AsciiStriCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- );
-
-
-/**
- Compares two Null-terminated ASCII strings with maximum lengths, and returns
- the difference between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. At most, Length ASCII 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 ASCII character in SecondString subtracted from the
- first mismatched ASCII character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString The pointer to a Null-terminated ASCII string.
- @param SecondString The pointer to a Null-terminated ASCII string.
- @param Length The maximum number of ASCII characters for compare.
-
- @retval ==0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrnCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString,
- IN UINTN Length
- );
-
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Concatenates one Null-terminated ASCII string to another Null-terminated
- ASCII string, and returns the concatenated ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents of
- Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination. The Null-terminated concatenated ASCII
- String is returned.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, then ASSERT().
-
- @param Destination The pointer to a Null-terminated ASCII string.
- @param Source The pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- );
-
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Concatenates up to a specified length one Null-terminated ASCII string to
- the end of another Null-terminated ASCII string, and returns the
- concatenated ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents
- of Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination, and Destination is returned. At most,
- Length ASCII characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, not including the Null-terminator, then ASSERT().
-
- @param Destination The pointer to a Null-terminated ASCII string.
- @param Source The pointer to a Null-terminated ASCII string.
- @param Length The maximum number of ASCII characters to concatenate from
- Source.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- );
-#endif
-
-/**
- Returns the first occurrence of a Null-terminated ASCII sub-string
- in a Null-terminated ASCII string.
-
- This function scans the contents of the ASCII string specified by String
- and returns the first occurrence of SearchString. If SearchString is not
- found in String, then NULL is returned. If the length of SearchString is zero,
- then String is returned.
-
- If String is NULL, then ASSERT().
- If SearchString is NULL, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and SearchString or
- String contains more than PcdMaximumAsciiStringLength Unicode characters
- not including the Null-terminator, then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
- @param SearchString The pointer to a Null-terminated ASCII string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @retval others If there is a match return the first occurrence of SearchingString.
- If the length of SearchString is zero,return String.
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrStr (
- IN CONST CHAR8 *String,
- IN CONST CHAR8 *SearchString
- );
-
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII 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 the 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
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then MAX_UINTN is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
-
- @retval The value translated from String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrDecimalToUintn (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII 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 the 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
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then MAX_UINT64 is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-AsciiStrDecimalToUint64 (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- 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 digits]. The running zero before [x] or [hexadecimal digits]
- 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-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINTN,
- then MAX_UINTN is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrHexToUintn (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- 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 digits]. The running zero before [x] or [hexadecimal digits]
- 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-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINT64,
- then MAX_UINT64 is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String The pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-AsciiStrHexToUint64 (
- IN CONST CHAR8 *String
- );
-
-/**
- Convert a Null-terminated ASCII string to IPv6 address and prefix length.
-
- This function outputs a value of type IPv6_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the ASCII string specified
- by String. The format of the input ASCII string String is as follows:
-
- X:X:X:X:X:X:X:X[/P]
-
- X contains one to four hexadecimal digit characters in the range [0-9], [a-f] and
- [A-F]. X is converted to a value of type UINT16, whose low byte is stored in low
- memory address and high byte is stored in high memory address. P contains decimal
- digit characters in the range [0-9]. The running zero in the beginning of P will
- be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid hexadecimal digit character after eight X's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- "::" can be used to compress one or more groups of X when X contains only 0.
- The "::" can only appear once in the String.
-
- If String is NULL, then ASSERT().
-
- If Address is NULL, then ASSERT().
-
- If EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan is stored at the location pointed to
- by EndPointer.
-
- @param String Pointer to a Null-terminated ASCII string.
- @param EndPointer Pointer to character that stops scan.
- @param Address Pointer to the converted IPv6 address.
- @param PrefixLength Pointer to the converted IPv6 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If X contains more than four hexadecimal
- digit characters.
- If String contains "::" and number of X
- is not less than 8.
- If P starts with character that is not a
- valid decimal digit character.
- If the decimal number converted from P
- exceeds 128.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToIpv6Address (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT IPv6_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- );
-
-/**
- Convert a Null-terminated ASCII string to IPv4 address and prefix length.
-
- This function outputs a value of type IPv4_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the ASCII string specified
- by String. The format of the input ASCII string String is as follows:
-
- D.D.D.D[/P]
-
- D and P are decimal digit characters in the range [0-9]. The running zero in
- the beginning of D and P will be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid decimal digit character after four D's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- If String is NULL, then ASSERT().
-
- If Address is NULL, then ASSERT().
-
- If EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan is stored at the location pointed to
- by EndPointer.
-
- @param String Pointer to a Null-terminated ASCII string.
- @param EndPointer Pointer to character that stops scan.
- @param Address Pointer to the converted IPv4 address.
- @param PrefixLength Pointer to the converted IPv4 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not in the correct format.
- If any decimal number converted from D
- exceeds 255.
- If the decimal number converted from P
- exceeds 32.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToIpv4Address (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT IPv4_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- );
-
-/**
- Convert a Null-terminated ASCII GUID string to a value of type
- EFI_GUID.
-
- This function outputs a GUID value by interpreting the contents of
- the ASCII string specified by String. The format of the input
- ASCII 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().
-
- @param String Pointer to a Null-terminated ASCII 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
-EFIAPI
-AsciiStrToGuid (
- IN CONST CHAR8 *String,
- OUT GUID *Guid
- );
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a byte array.
-
- This function outputs a byte array by interpreting the contents of
- the ASCII string specified by String in hexadecimal format. The format of
- the input ASCII 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 NULL, then ASSERT().
-
- If Buffer is NULL, then ASSERT().
-
- If Length is not multiple of 2, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
-
- If MaxBufferSize is less than (Length / 2), then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
- @param Length The number of ASCII 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 PcdMaximumAsciiStringLength is not zero,
- and Length is greater than
- PcdMaximumAsciiStringLength.
- @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
-EFIAPI
-AsciiStrHexToBytes (
- IN CONST CHAR8 *String,
- IN UINTN Length,
- OUT UINT8 *Buffer,
- IN UINTN MaxBufferSize
- );
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Convert one Null-terminated ASCII string to a Null-terminated
- Unicode string and returns the Unicode string.
-
- This function converts the contents of the ASCII string Source to the Unicode
- string Destination, and returns Destination. The function terminates the
- Unicode string Destination by appending a Null-terminator character at the end.
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param Source The pointer to a Null-terminated ASCII string.
- @param Destination The pointer to a Null-terminated Unicode string.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-AsciiStrToUnicodeStr (
- IN CONST CHAR8 *Source,
- OUT CHAR16 *Destination
- );
-
-#endif
-
-/**
- Convert one Null-terminated ASCII string to a Null-terminated
- Unicode string.
-
- This function is similar to StrCpyS.
-
- This function converts the contents of the ASCII string Source to the Unicode
- string Destination. The function terminates the Unicode string Destination by
- appending a Null-terminator character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Source The pointer to a Null-terminated ASCII string.
- @param Destination The pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToUnicodeStrS (
- IN CONST CHAR8 *Source,
- OUT CHAR16 *Destination,
- IN UINTN DestMax
- );
-
-/**
- Convert not more than Length successive characters from a Null-terminated
- Ascii string to a Null-terminated Unicode string. If no null char is copied
- from Source, then Destination[Length] is always set to null.
-
- This function converts not more than Length successive characters from the
- Ascii string Source to the Unicode string Destination. The function
- terminates the Unicode string Destination by appending a Null-terminator
- character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with
- size not smaller than
- ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then Destination and DestinationLength are
- unmodified.
-
- @param Source The pointer to a Null-terminated Ascii string.
- @param Length The maximum number of Ascii characters to convert.
- @param Destination The pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode char,
- including terminating null char.
- @param DestinationLength The number of Ascii characters converted.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If DestinationLength is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and Length or DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If PcdMaximumAsciiStringLength is not zero,
- and Length or DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(AsciiStrLen(Source), Length).
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrnToUnicodeStrS (
- IN CONST CHAR8 *Source,
- IN UINTN Length,
- OUT CHAR16 *Destination,
- IN UINTN DestMax,
- OUT UINTN *DestinationLength
- );
-
-/**
- Converts an 8-bit value to an 8-bit BCD value.
-
- Converts the 8-bit value specified by Value to BCD. The BCD value is
- returned.
-
- If Value >= 100, then ASSERT().
-
- @param Value The 8-bit value to convert to BCD. Range 0..99.
-
- @return The BCD value.
-
-**/
-UINT8
-EFIAPI
-DecimalToBcd8 (
- IN UINT8 Value
- );
-
-
-/**
- Converts an 8-bit BCD value to an 8-bit value.
-
- Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit
- value is returned.
-
- If Value >= 0xA0, then ASSERT().
- If (Value & 0x0F) >= 0x0A, then ASSERT().
-
- @param Value The 8-bit BCD value to convert to an 8-bit value.
-
- @return The 8-bit value is returned.
-
-**/
-UINT8
-EFIAPI
-BcdToDecimal8 (
- IN UINT8 Value
- );
-
-//
-// File Path Manipulation Functions
-//
-
-/**
- Removes the last directory or file entry in a path.
-
- @param[in, out] Path The pointer to the path to modify.
-
- @retval FALSE Nothing was found to remove.
- @retval TRUE A directory or file was removed.
-**/
-BOOLEAN
-EFIAPI
-PathRemoveLastItem(
- IN OUT CHAR16 *Path
- );
-
-/**
- Function to clean up paths.
- - Single periods in the path are removed.
- - Double periods in the path are removed along with a single parent directory.
- - Forward slashes L'/' are converted to backward slashes L'\'.
-
- This will be done inline and the existing buffer may be larger than required
- upon completion.
-
- @param[in] Path The pointer to the string containing the path.
-
- @return Returns Path, otherwise returns NULL to indicate that an error has occurred.
-**/
-CHAR16*
-EFIAPI
-PathCleanUpDirectories(
- IN CHAR16 *Path
- );
-
-//
-// Linked List Functions and Macros
-//
-
-/**
- Initializes the head node of a doubly linked list that is declared as a
- global variable in a module.
-
- Initializes the forward and backward links of a new linked list. After
- initializing a linked list with this macro, the other linked list functions
- may be used to add and remove nodes from the linked list. This macro results
- in smaller executables by initializing the linked list in the data section,
- instead if calling the InitializeListHead() function to perform the
- equivalent operation.
-
- @param ListHead The head note of a list to initialize.
-
-**/
-#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)}
-
-
-/**
- Initializes the head node of a doubly linked list, and returns the pointer to
- the head node of the doubly linked list.
-
- Initializes the forward and backward links of a new linked list. After
- initializing a linked list with this function, the other linked list
- functions may be used to add and remove nodes from the linked list. It is up
- to the caller of this function to allocate the memory for ListHead.
-
- If ListHead is NULL, then ASSERT().
-
- @param ListHead A pointer to the head node of a new doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-InitializeListHead (
- IN OUT LIST_ENTRY *ListHead
- );
-
-
-/**
- Adds a node to the beginning of a doubly linked list, and returns the pointer
- to the head node of the doubly linked list.
-
- Adds the node Entry at the beginning of the doubly linked list denoted by
- ListHead, and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
- @param Entry A pointer to a node that is to be inserted at the beginning
- of a doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-InsertHeadList (
- IN OUT LIST_ENTRY *ListHead,
- IN OUT LIST_ENTRY *Entry
- );
-
-
-/**
- Adds a node to the end of a doubly linked list, and returns the pointer to
- the head node of the doubly linked list.
-
- Adds the node Entry to the end of the doubly linked list denoted by ListHead,
- and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
- @param Entry A pointer to a node that is to be added at the end of the
- doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-InsertTailList (
- IN OUT LIST_ENTRY *ListHead,
- IN OUT LIST_ENTRY *Entry
- );
-
-
-/**
- Retrieves the first node of a doubly linked list.
-
- Returns the first node of a doubly linked list. List must have been
- initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
- If List is empty, then List is returned.
-
- If List is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
-
- @return The first node of a doubly linked list.
- @retval List The list is empty.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GetFirstNode (
- IN CONST LIST_ENTRY *List
- );
-
-
-/**
- Retrieves the next node of a doubly linked list.
-
- Returns the node of a doubly linked list that follows Node.
- List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()
- or InitializeListHead(). If List is empty, then List is returned.
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @return The pointer to the next node if one exists. Otherwise List is returned.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GetNextNode (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Retrieves the previous node of a doubly linked list.
-
- Returns the node of a doubly linked list that precedes Node.
- List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()
- or InitializeListHead(). If List is empty, then List is returned.
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @return The pointer to the previous node if one exists. Otherwise List is returned.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GetPreviousNode (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Checks to see if a doubly linked list is empty or not.
-
- Checks to see if the doubly linked list is empty. If the linked list contains
- zero nodes, this function returns TRUE. Otherwise, it returns FALSE.
-
- If ListHead is NULL, then ASSERT().
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
-
- @retval TRUE The linked list is empty.
- @retval FALSE The linked list is not empty.
-
-**/
-BOOLEAN
-EFIAPI
-IsListEmpty (
- IN CONST LIST_ENTRY *ListHead
- );
-
-
-/**
- Determines if a node in a doubly linked list is the head node of a the same
- doubly linked list. This function is typically used to terminate a loop that
- traverses all the nodes in a doubly linked list starting with the head node.
-
- Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the
- nodes in the doubly linked list specified by List. List must have been
- initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(),
- then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List the and Node is not equal
- to List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @retval TRUE Node is the head of the doubly-linked list pointed by List.
- @retval FALSE Node is not the head of the doubly-linked list pointed by List.
-
-**/
-BOOLEAN
-EFIAPI
-IsNull (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Determines if a node the last node in a doubly linked list.
-
- Returns TRUE if Node is the last node in the doubly linked list specified by
- List. Otherwise, FALSE is returned. List must have been initialized with
- INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @retval TRUE Node is the last node in the linked list.
- @retval FALSE Node is not the last node in the linked list.
-
-**/
-BOOLEAN
-EFIAPI
-IsNodeAtEnd (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Swaps the location of two nodes in a doubly linked list, and returns the
- first node after the swap.
-
- If FirstEntry is identical to SecondEntry, then SecondEntry is returned.
- Otherwise, the location of the FirstEntry node is swapped with the location
- of the SecondEntry node in a doubly linked list. SecondEntry must be in the
- same double linked list as FirstEntry and that double linked list must have
- been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
- SecondEntry is returned after the nodes are swapped.
-
- If FirstEntry is NULL, then ASSERT().
- If SecondEntry is NULL, then ASSERT().
- If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the
- same linked list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing the FirstEntry and SecondEntry nodes, including
- the FirstEntry and SecondEntry nodes, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param FirstEntry A pointer to a node in a linked list.
- @param SecondEntry A pointer to another node in the same linked list.
-
- @return SecondEntry.
-
-**/
-LIST_ENTRY *
-EFIAPI
-SwapListEntries (
- IN OUT LIST_ENTRY *FirstEntry,
- IN OUT LIST_ENTRY *SecondEntry
- );
-
-
-/**
- Removes a node from a doubly linked list, and returns the node that follows
- the removed node.
-
- Removes the node Entry from a doubly linked list. It is up to the caller of
- this function to release the memory used by this node if that is required. On
- exit, the node following Entry in the doubly linked list is returned. If
- Entry is the only node in the linked list, then the head node of the linked
- list is returned.
-
- If Entry is NULL, then ASSERT().
- If Entry is the head node of an empty list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing Entry, including the Entry node, is greater than
- or equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param Entry A pointer to a node in a linked list.
-
- @return Entry.
-
-**/
-LIST_ENTRY *
-EFIAPI
-RemoveEntryList (
- IN CONST LIST_ENTRY *Entry
- );
-
-//
-// Math Services
-//
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
- with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count.
-
-**/
-UINT64
-EFIAPI
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
- filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
- with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-ARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 32-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand << Count
-
-**/
-UINT32
-EFIAPI
-LRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
- with the low bits that were rotated.
-
- This function rotates the 32-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >> Count
-
-**/
-UINT32
-EFIAPI
-RRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-LRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
- with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-RRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Returns the bit position of the lowest bit set in a 32-bit value.
-
- This function computes the bit position of the lowest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @retval 0..31 The lowest bit set in Operand was found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-LowBitSet32 (
- IN UINT32 Operand
- );
-
-
-/**
- Returns the bit position of the lowest bit set in a 64-bit value.
-
- This function computes the bit position of the lowest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @retval 0..63 The lowest bit set in Operand was found.
- @retval -1 Operand is zero.
-
-
-**/
-INTN
-EFIAPI
-LowBitSet64 (
- IN UINT64 Operand
- );
-
-
-/**
- Returns the bit position of the highest bit set in a 32-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @retval 0..31 Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet32 (
- IN UINT32 Operand
- );
-
-
-/**
- Returns the bit position of the highest bit set in a 64-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @retval 0..63 Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet64 (
- IN UINT64 Operand
- );
-
-
-/**
- Returns the value of the highest bit set in a 32-bit value. Equivalent to
- 1 << log2(x).
-
- This function computes the value of the highest bit set in the 32-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return 1 << HighBitSet32(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT32
-EFIAPI
-GetPowerOfTwo32 (
- IN UINT32 Operand
- );
-
-
-/**
- Returns the value of the highest bit set in a 64-bit value. Equivalent to
- 1 << log2(x).
-
- This function computes the value of the highest bit set in the 64-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return 1 << HighBitSet64(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT64
-EFIAPI
-GetPowerOfTwo64 (
- IN UINT64 Operand
- );
-
-
-/**
- Switches the endianness of a 16-bit integer.
-
- This function swaps the bytes in a 16-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Value A 16-bit unsigned value.
-
- @return The byte swapped Value.
-
-**/
-UINT16
-EFIAPI
-SwapBytes16 (
- IN UINT16 Value
- );
-
-
-/**
- Switches the endianness of a 32-bit integer.
-
- This function swaps the bytes in a 32-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Value A 32-bit unsigned value.
-
- @return The byte swapped Value.
-
-**/
-UINT32
-EFIAPI
-SwapBytes32 (
- IN UINT32 Value
- );
-
-
-/**
- Switches the endianness of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Value A 64-bit unsigned value.
-
- @return The byte swapped Value.
-
-**/
-UINT64
-EFIAPI
-SwapBytes64 (
- IN UINT64 Value
- );
-
-
-/**
- Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- );
-
-
-/**
- Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier.
-
-**/
-UINT64
-EFIAPI
-MultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- );
-
-
-/**
- Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result.
-
- This function multiples the 64-bit signed value Multiplicand by the 64-bit
- signed value Multiplier and generates a 64-bit signed result. This 64-bit
- signed result is returned.
-
- @param Multiplicand A 64-bit signed value.
- @param Multiplier A 64-bit signed value.
-
- @return Multiplicand * Multiplier
-
-**/
-INT64
-EFIAPI
-MultS64x64 (
- IN INT64 Multiplicand,
- IN INT64 Multiplier
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor.
-
-**/
-UINT64
-EFIAPI
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor.
-
-**/
-UINT32
-EFIAPI
-ModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor.
-
-**/
-UINT64
-EFIAPI
-DivU64x32Remainder (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor.
-
-**/
-UINT64
-EFIAPI
-DivU64x64Remainder (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- );
-
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit signed
- value Divisor and generates a 64-bit signed quotient. If Remainder is not
- NULL, then the 64-bit signed remainder is returned in Remainder. This
- function returns the 64-bit signed quotient.
-
- It is the caller's responsibility to not call this function with a Divisor of 0.
- If Divisor is 0, then the quotient and remainder should be assumed to be
- the largest negative integer.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor.
-
-**/
-INT64
-EFIAPI
-DivS64x64Remainder (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- );
-
-
-/**
- Reads a 16-bit value from memory that may be unaligned.
-
- This function returns the 16-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 16-bit value that may be unaligned.
-
- @return The 16-bit value read from Buffer.
-
-**/
-UINT16
-EFIAPI
-ReadUnaligned16 (
- IN CONST UINT16 *Buffer
- );
-
-
-/**
- Writes a 16-bit value to memory that may be unaligned.
-
- This function writes the 16-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 16-bit value that may be unaligned.
- @param Value 16-bit value to write to Buffer.
-
- @return The 16-bit value to write to Buffer.
-
-**/
-UINT16
-EFIAPI
-WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
- );
-
-
-/**
- Reads a 24-bit value from memory that may be unaligned.
-
- This function returns the 24-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 24-bit value that may be unaligned.
-
- @return The 24-bit value read from Buffer.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned24 (
- IN CONST UINT32 *Buffer
- );
-
-
-/**
- Writes a 24-bit value to memory that may be unaligned.
-
- This function writes the 24-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 24-bit value that may be unaligned.
- @param Value 24-bit value to write to Buffer.
-
- @return The 24-bit value to write to Buffer.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- );
-
-
-/**
- Reads a 32-bit value from memory that may be unaligned.
-
- This function returns the 32-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 32-bit value that may be unaligned.
-
- @return The 32-bit value read from Buffer.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned32 (
- IN CONST UINT32 *Buffer
- );
-
-
-/**
- Writes a 32-bit value to memory that may be unaligned.
-
- This function writes the 32-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 32-bit value that may be unaligned.
- @param Value 32-bit value to write to Buffer.
-
- @return The 32-bit value to write to Buffer.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- );
-
-
-/**
- Reads a 64-bit value from memory that may be unaligned.
-
- This function returns the 64-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 64-bit value that may be unaligned.
-
- @return The 64-bit value read from Buffer.
-
-**/
-UINT64
-EFIAPI
-ReadUnaligned64 (
- IN CONST UINT64 *Buffer
- );
-
-
-/**
- Writes a 64-bit value to memory that may be unaligned.
-
- This function writes the 64-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 64-bit value that may be unaligned.
- @param Value 64-bit value to write to Buffer.
-
- @return The 64-bit value to write to Buffer.
-
-**/
-UINT64
-EFIAPI
-WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
- );
-
-
-//
-// Bit Field Functions
-//
-
-/**
- Returns a bit field from an 8-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The bit field read.
-
-**/
-UINT8
-EFIAPI
-BitFieldRead8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to an 8-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 8-bit value is
- returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldWrite8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the value
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAnd8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAndThenOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-
-/**
- Returns a bit field from a 16-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The bit field read.
-
-**/
-UINT16
-EFIAPI
-BitFieldRead16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to a 16-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 16-bit value is
- returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldWrite16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the value
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAnd16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAndThenOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-
-/**
- Returns a bit field from a 32-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read.
-
-**/
-UINT32
-EFIAPI
-BitFieldRead32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to a 32-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 32-bit value is
- returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldWrite32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the value.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAnd32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAndThenOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-
-/**
- Returns a bit field from a 64-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The bit field read.
-
-**/
-UINT64
-EFIAPI
-BitFieldRead64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to a 64-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 64-bit value is
- returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldWrite64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAnd64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAndThenOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-//
-// Base Library Checksum Functions
-//
-
-/**
- Returns the sum of all elements in a buffer in unit of UINT8.
- During calculation, the carry bits are dropped.
-
- This function calculates the sum of all elements in a buffer
- in unit of UINT8. The carry bits in result of addition are dropped.
- The result is returned as UINT8. If Length is Zero, then Zero is
- returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT8
-EFIAPI
-CalculateSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer
- of 8-bit values.
-
- This function first calculates the sum of the 8-bit values in the
- buffer specified by Buffer and Length. The carry bits in the result
- of addition are dropped. Then, the two's complement of the sum is
- returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The two's complement checksum of Buffer.
-
-**/
-UINT8
-EFIAPI
-CalculateCheckSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the sum of all elements in a buffer of 16-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 16-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT16
-EFIAPI
-CalculateSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 16-bit values.
-
- This function first calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The two's complement checksum of Buffer.
-
-**/
-UINT16
-EFIAPI
-CalculateCheckSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the sum of all elements in a buffer of 32-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 32-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT32
-EFIAPI
-CalculateSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 32-bit values.
-
- This function first calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The two's complement checksum of Buffer.
-
-**/
-UINT32
-EFIAPI
-CalculateCheckSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the sum of all elements in a buffer of 64-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 64-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT64
-EFIAPI
-CalculateSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 64-bit values.
-
- This function first calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The two's complement checksum of Buffer.
-
-**/
-UINT64
-EFIAPI
-CalculateCheckSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- );
-
-
-//
-// Base Library CPU Functions
-//
-
-/**
- Function entry point used when a stack switch is requested with SwitchStack()
-
- @param Context1 Context1 parameter passed into SwitchStack().
- @param Context2 Context2 parameter passed into SwitchStack().
-
-**/
-typedef
-VOID
-(EFIAPI *SWITCH_STACK_ENTRY_POINT)(
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2 OPTIONAL
- );
-
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- );
-
-
-/**
- Saves the current CPU context that can be restored with a call to LongJump()
- and returns 0.
-
- Saves the current CPU context in the buffer specified by JumpBuffer and
- returns 0. The initial call to SetJump() must always return 0. Subsequent
- calls to LongJump() cause a non-zero value to be returned by SetJump().
-
- If JumpBuffer is NULL, then ASSERT().
- For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- NOTE: The structure BASE_LIBRARY_JUMP_BUFFER is CPU architecture specific.
- The same structure must never be used for more than one CPU architecture context.
- For example, a BASE_LIBRARY_JUMP_BUFFER allocated by an IA-32 module must never be used from an x64 module.
- SetJump()/LongJump() is not currently supported for the EBC processor type.
-
- @param JumpBuffer A pointer to CPU context buffer.
-
- @retval 0 Indicates a return from SetJump().
-
-**/
-UINTN
-EFIAPI
-SetJump (
- OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer. This
- function never returns to the caller. Instead is resumes execution based on
- the state of JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
- If Value is 0, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is
- restored and must be non-zero.
-
-**/
-VOID
-EFIAPI
-LongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- );
-
-
-/**
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- );
-
-
-/**
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- );
-
-
-/**
- Disables CPU interrupts and returns the interrupt state prior to the disable
- operation.
-
- @retval TRUE CPU interrupts were enabled on entry to this call.
- @retval FALSE CPU interrupts were disabled on entry to this call.
-
-**/
-BOOLEAN
-EFIAPI
-SaveAndDisableInterrupts (
- VOID
- );
-
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- );
-
-
-/**
- Retrieves the current CPU interrupt state.
-
- Returns TRUE if interrupts are currently enabled. Otherwise
- returns FALSE.
-
- @retval TRUE CPU interrupts are enabled.
- @retval FALSE CPU interrupts are disabled.
-
-**/
-BOOLEAN
-EFIAPI
-GetInterruptState (
- VOID
- );
-
-
-/**
- Set the current CPU interrupt state.
-
- Sets the current CPU interrupt state to the state specified by
- InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
- InterruptState is FALSE, then interrupts are disabled. InterruptState is
- returned.
-
- @param InterruptState TRUE if interrupts should enabled. FALSE if
- interrupts should be disabled.
-
- @return InterruptState
-
-**/
-BOOLEAN
-EFIAPI
-SetInterruptState (
- IN BOOLEAN InterruptState
- );
-
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- );
-
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return. This function
- supports a variable number of arguments following the NewStack parameter.
- These additional arguments are ignored on IA-32, x64, and EBC architectures.
- Itanium processors expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param ... This variable argument list is ignored for IA-32, x64, and
- EBC architectures. For Itanium processors, this variable
- argument list is expected to contain a single parameter of
- type VOID * that specifies the new backing store pointer.
-
-
-**/
-VOID
-EFIAPI
-SwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- ...
- );
-
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- );
-
-
-/**
- Executes an infinite loop.
-
- Forces the CPU to execute an infinite loop. A debugger may be used to skip
- past the loop and the code that follows the loop must execute properly. This
- implies that the infinite loop must not cause the code that follow it to be
- optimized away.
-
-**/
-VOID
-EFIAPI
-CpuDeadLoop (
- VOID
- );
-
-#if defined (MDE_CPU_IPF)
-
-/**
- Flush a range of cache lines in the cache coherency domain of the calling
- CPU.
-
- Flushes the cache lines specified by Address and Length. If Address is not aligned
- on a cache line boundary, then entire cache line containing Address is flushed.
- If Address + Length is not aligned on a cache line boundary, then the entire cache
- line containing Address + Length - 1 is flushed. This function may choose to flush
- the entire cache if that is more efficient than flushing the specified range. If
- Length is 0, the no cache lines are flushed. Address is returned.
- This function is only available on Itanium processors.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-AsmFlushCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-
-/**
- Executes an FC instruction.
- Executes an FC instruction on the cache line specified by Address.
- The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).
- An implementation may flush a larger region. This function is only available on Itanium processors.
-
- @param Address The Address of cache line to be flushed.
-
- @return The address of FC instruction executed.
-
-**/
-UINT64
-EFIAPI
-AsmFc (
- IN UINT64 Address
- );
-
-
-/**
- Executes an FC.I instruction.
- Executes an FC.I instruction on the cache line specified by Address.
- The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).
- An implementation may flush a larger region. This function is only available on Itanium processors.
-
- @param Address The Address of cache line to be flushed.
-
- @return The address of the FC.I instruction executed.
-
-**/
-UINT64
-EFIAPI
-AsmFci (
- IN UINT64 Address
- );
-
-
-/**
- Reads the current value of a Processor Identifier Register (CPUID).
-
- Reads and returns the current value of Processor Identifier Register specified by Index.
- The Index of largest implemented CPUID (One less than the number of implemented CPUID
- registers) is determined by CPUID [3] bits {7:0}.
- No parameter checking is performed on Index. If the Index value is beyond the
- implemented CPUID register range, a Reserved Register/Field fault may occur. The caller
- must either guarantee that Index is valid, or the caller must set up fault handlers to
- catch the faults. This function is only available on Itanium processors.
-
- @param Index The 8-bit Processor Identifier Register index to read.
-
- @return The current value of Processor Identifier Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadCpuid (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of 64-bit Processor Status Register (PSR).
- This function is only available on Itanium processors.
-
- @return The current value of PSR.
-
-**/
-UINT64
-EFIAPI
-AsmReadPsr (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Processor Status Register (PSR).
-
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of PSR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to PSR.
-
- @return The 64-bit value written to the PSR.
-
-**/
-UINT64
-EFIAPI
-AsmWritePsr (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #0 (KR0).
-
- Reads and returns the current value of KR0.
- This function is only available on Itanium processors.
-
- @return The current value of KR0.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr0 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #1 (KR1).
-
- Reads and returns the current value of KR1.
- This function is only available on Itanium processors.
-
- @return The current value of KR1.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr1 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #2 (KR2).
-
- Reads and returns the current value of KR2.
- This function is only available on Itanium processors.
-
- @return The current value of KR2.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr2 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #3 (KR3).
-
- Reads and returns the current value of KR3.
- This function is only available on Itanium processors.
-
- @return The current value of KR3.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr3 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #4 (KR4).
-
- Reads and returns the current value of KR4.
- This function is only available on Itanium processors.
-
- @return The current value of KR4.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr4 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #5 (KR5).
-
- Reads and returns the current value of KR5.
- This function is only available on Itanium processors.
-
- @return The current value of KR5.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr5 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #6 (KR6).
-
- Reads and returns the current value of KR6.
- This function is only available on Itanium processors.
-
- @return The current value of KR6.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr6 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #7 (KR7).
-
- Reads and returns the current value of KR7.
- This function is only available on Itanium processors.
-
- @return The current value of KR7.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr7 (
- VOID
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #0 (KR0).
-
- Writes the current value of KR0. The 64-bit value written to
- the KR0 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR0.
-
- @return The 64-bit value written to the KR0.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr0 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #1 (KR1).
-
- Writes the current value of KR1. The 64-bit value written to
- the KR1 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR1.
-
- @return The 64-bit value written to the KR1.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr1 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #2 (KR2).
-
- Writes the current value of KR2. The 64-bit value written to
- the KR2 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR2.
-
- @return The 64-bit value written to the KR2.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr2 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #3 (KR3).
-
- Writes the current value of KR3. The 64-bit value written to
- the KR3 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR3.
-
- @return The 64-bit value written to the KR3.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr3 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #4 (KR4).
-
- Writes the current value of KR4. The 64-bit value written to
- the KR4 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR4.
-
- @return The 64-bit value written to the KR4.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr4 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #5 (KR5).
-
- Writes the current value of KR5. The 64-bit value written to
- the KR5 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR5.
-
- @return The 64-bit value written to the KR5.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr5 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #6 (KR6).
-
- Writes the current value of KR6. The 64-bit value written to
- the KR6 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR6.
-
- @return The 64-bit value written to the KR6.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr6 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #7 (KR7).
-
- Writes the current value of KR7. The 64-bit value written to
- the KR7 is returned. This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to KR7.
-
- @return The 64-bit value written to the KR7.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr7 (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Interval Timer Counter Register (ITC).
-
- Reads and returns the current value of ITC.
- This function is only available on Itanium processors.
-
- @return The current value of ITC.
-
-**/
-UINT64
-EFIAPI
-AsmReadItc (
- VOID
- );
-
-
-/**
- Reads the current value of Interval Timer Vector Register (ITV).
-
- Reads and returns the current value of ITV.
- This function is only available on Itanium processors.
-
- @return The current value of ITV.
-
-**/
-UINT64
-EFIAPI
-AsmReadItv (
- VOID
- );
-
-
-/**
- Reads the current value of Interval Timer Match Register (ITM).
-
- Reads and returns the current value of ITM.
- This function is only available on Itanium processors.
-
- @return The current value of ITM.
-**/
-UINT64
-EFIAPI
-AsmReadItm (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Interval Timer Counter Register (ITC).
-
- Writes the current value of ITC. The 64-bit value written to the ITC is returned.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to ITC.
-
- @return The 64-bit value written to the ITC.
-
-**/
-UINT64
-EFIAPI
-AsmWriteItc (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Interval Timer Match Register (ITM).
-
- Writes the current value of ITM. The 64-bit value written to the ITM is returned.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to ITM.
-
- @return The 64-bit value written to the ITM.
-
-**/
-UINT64
-EFIAPI
-AsmWriteItm (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Interval Timer Vector Register (ITV).
-
- Writes the current value of ITV. The 64-bit value written to the ITV is returned.
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of ITV must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to ITV.
-
- @return The 64-bit value written to the ITV.
-
-**/
-UINT64
-EFIAPI
-AsmWriteItv (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Default Control Register (DCR).
-
- Reads and returns the current value of DCR. This function is only available on Itanium processors.
-
- @return The current value of DCR.
-
-**/
-UINT64
-EFIAPI
-AsmReadDcr (
- VOID
- );
-
-
-/**
- Reads the current value of Interruption Vector Address Register (IVA).
-
- Reads and returns the current value of IVA. This function is only available on Itanium processors.
-
- @return The current value of IVA.
-**/
-UINT64
-EFIAPI
-AsmReadIva (
- VOID
- );
-
-
-/**
- Reads the current value of Page Table Address Register (PTA).
-
- Reads and returns the current value of PTA. This function is only available on Itanium processors.
-
- @return The current value of PTA.
-
-**/
-UINT64
-EFIAPI
-AsmReadPta (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Default Control Register (DCR).
-
- Writes the current value of DCR. The 64-bit value written to the DCR is returned.
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to DCR.
-
- @return The 64-bit value written to the DCR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteDcr (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Interruption Vector Address Register (IVA).
-
- Writes the current value of IVA. The 64-bit value written to the IVA is returned.
- The size of vector table is 32 K bytes and is 32 K bytes aligned
- the low 15 bits of Value is ignored when written.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to IVA.
-
- @return The 64-bit value written to the IVA.
-
-**/
-UINT64
-EFIAPI
-AsmWriteIva (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Page Table Address Register (PTA).
-
- Writes the current value of PTA. The 64-bit value written to the PTA is returned.
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to PTA.
-
- @return The 64-bit value written to the PTA.
-**/
-UINT64
-EFIAPI
-AsmWritePta (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Local Interrupt ID Register (LID).
-
- Reads and returns the current value of LID. This function is only available on Itanium processors.
-
- @return The current value of LID.
-
-**/
-UINT64
-EFIAPI
-AsmReadLid (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Vector Register (IVR).
-
- Reads and returns the current value of IVR. This function is only available on Itanium processors.
-
- @return The current value of IVR.
-
-**/
-UINT64
-EFIAPI
-AsmReadIvr (
- VOID
- );
-
-
-/**
- Reads the current value of Task Priority Register (TPR).
-
- Reads and returns the current value of TPR. This function is only available on Itanium processors.
-
- @return The current value of TPR.
-
-**/
-UINT64
-EFIAPI
-AsmReadTpr (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #0 (IRR0).
-
- Reads and returns the current value of IRR0. This function is only available on Itanium processors.
-
- @return The current value of IRR0.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr0 (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #1 (IRR1).
-
- Reads and returns the current value of IRR1. This function is only available on Itanium processors.
-
- @return The current value of IRR1.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr1 (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #2 (IRR2).
-
- Reads and returns the current value of IRR2. This function is only available on Itanium processors.
-
- @return The current value of IRR2.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr2 (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #3 (IRR3).
-
- Reads and returns the current value of IRR3. This function is only available on Itanium processors.
-
- @return The current value of IRR3.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr3 (
- VOID
- );
-
-
-/**
- Reads the current value of Performance Monitor Vector Register (PMV).
-
- Reads and returns the current value of PMV. This function is only available on Itanium processors.
-
- @return The current value of PMV.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmv (
- VOID
- );
-
-
-/**
- Reads the current value of Corrected Machine Check Vector Register (CMCV).
-
- Reads and returns the current value of CMCV. This function is only available on Itanium processors.
-
- @return The current value of CMCV.
-
-**/
-UINT64
-EFIAPI
-AsmReadCmcv (
- VOID
- );
-
-
-/**
- Reads the current value of Local Redirection Register #0 (LRR0).
-
- Reads and returns the current value of LRR0. This function is only available on Itanium processors.
-
- @return The current value of LRR0.
-
-**/
-UINT64
-EFIAPI
-AsmReadLrr0 (
- VOID
- );
-
-
-/**
- Reads the current value of Local Redirection Register #1 (LRR1).
-
- Reads and returns the current value of LRR1. This function is only available on Itanium processors.
-
- @return The current value of LRR1.
-
-**/
-UINT64
-EFIAPI
-AsmReadLrr1 (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Page Local Interrupt ID Register (LID).
-
- Writes the current value of LID. The 64-bit value written to the LID is returned.
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of LID must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to LID.
-
- @return The 64-bit value written to the LID.
-
-**/
-UINT64
-EFIAPI
-AsmWriteLid (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Task Priority Register (TPR).
-
- Writes the current value of TPR. The 64-bit value written to the TPR is returned.
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of TPR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to TPR.
-
- @return The 64-bit value written to the TPR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteTpr (
- IN UINT64 Value
- );
-
-
-/**
- Performs a write operation on End OF External Interrupt Register (EOI).
-
- Writes a value of 0 to the EOI Register. This function is only available on Itanium processors.
-
-**/
-VOID
-EFIAPI
-AsmWriteEoi (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Performance Monitor Vector Register (PMV).
-
- Writes the current value of PMV. The 64-bit value written to the PMV is returned.
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of PMV must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to PMV.
-
- @return The 64-bit value written to the PMV.
-
-**/
-UINT64
-EFIAPI
-AsmWritePmv (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Corrected Machine Check Vector Register (CMCV).
-
- Writes the current value of CMCV. The 64-bit value written to the CMCV is returned.
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of CMCV must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to CMCV.
-
- @return The 64-bit value written to the CMCV.
-
-**/
-UINT64
-EFIAPI
-AsmWriteCmcv (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Local Redirection Register #0 (LRR0).
-
- Writes the current value of LRR0. The 64-bit value written to the LRR0 is returned.
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of LRR0 must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to LRR0.
-
- @return The 64-bit value written to the LRR0.
-
-**/
-UINT64
-EFIAPI
-AsmWriteLrr0 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Local Redirection Register #1 (LRR1).
-
- Writes the current value of LRR1. The 64-bit value written to the LRR1 is returned.
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of LRR1 must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must
- set up fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to LRR1.
-
- @return The 64-bit value written to the LRR1.
-
-**/
-UINT64
-EFIAPI
-AsmWriteLrr1 (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Instruction Breakpoint Register (IBR).
-
- The Instruction Breakpoint Registers are used in pairs. The even numbered
- registers contain breakpoint addresses, and the odd numbered registers contain
- breakpoint mask conditions. At least four instruction registers pairs are implemented
- on all processor models. Implemented registers are contiguous starting with
- register 0. No parameter checking is performed on Index, and if the Index value
- is beyond the implemented IBR register range, a Reserved Register/Field fault may
- occur. The caller must either guarantee that Index is valid, or the caller must
- set up fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Instruction Breakpoint Register index to read.
-
- @return The current value of Instruction Breakpoint Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadIbr (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of Data Breakpoint Register (DBR).
-
- The Data Breakpoint Registers are used in pairs. The even numbered registers
- contain breakpoint addresses, and odd numbered registers contain breakpoint
- mask conditions. At least four data registers pairs are implemented on all processor
- models. Implemented registers are contiguous starting with register 0.
- No parameter checking is performed on Index. If the Index value is beyond
- the implemented DBR register range, a Reserved Register/Field fault may occur.
- The caller must either guarantee that Index is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Data Breakpoint Register index to read.
-
- @return The current value of Data Breakpoint Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadDbr (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of Performance Monitor Configuration Register (PMC).
-
- All processor implementations provide at least four performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and four performance monitor counter overflow
- status registers (PMC [0]... PMC [3]). Processor implementations may provide
- additional implementation-dependent PMC and PMD to increase the number of
- 'generic' performance counters (PMC/PMD pairs). The remainder of PMC and PMD
- register set is implementation dependent. No parameter checking is performed
- on Index. If the Index value is beyond the implemented PMC register range,
- zero value will be returned.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Performance Monitor Configuration Register index to read.
-
- @return The current value of Performance Monitor Configuration Register
- specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of Performance Monitor Data Register (PMD).
-
- All processor implementations provide at least 4 performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter
- overflow status registers (PMC [0]... PMC [3]). Processor implementations may
- provide additional implementation-dependent PMC and PMD to increase the number
- of 'generic' performance counters (PMC/PMD pairs). The remainder of PMC and PMD
- register set is implementation dependent. No parameter checking is performed
- on Index. If the Index value is beyond the implemented PMD register range,
- zero value will be returned.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Performance Monitor Data Register index to read.
-
- @return The current value of Performance Monitor Data Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmd (
- IN UINT8 Index
- );
-
-
-/**
- Writes the current value of 64-bit Instruction Breakpoint Register (IBR).
-
- Writes current value of Instruction Breakpoint Register specified by Index.
- The Instruction Breakpoint Registers are used in pairs. The even numbered
- registers contain breakpoint addresses, and odd numbered registers contain
- breakpoint mask conditions. At least four instruction registers pairs are implemented
- on all processor models. Implemented registers are contiguous starting with
- register 0. No parameter checking is performed on Index. If the Index value
- is beyond the implemented IBR register range, a Reserved Register/Field fault may
- occur. The caller must either guarantee that Index is valid, or the caller must
- set up fault handlers to catch the faults.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Instruction Breakpoint Register index to write.
- @param Value The 64-bit value to write to IBR.
-
- @return The 64-bit value written to the IBR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteIbr (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Data Breakpoint Register (DBR).
-
- Writes current value of Data Breakpoint Register specified by Index.
- The Data Breakpoint Registers are used in pairs. The even numbered registers
- contain breakpoint addresses, and odd numbered registers contain breakpoint
- mask conditions. At least four data registers pairs are implemented on all processor
- models. Implemented registers are contiguous starting with register 0. No parameter
- checking is performed on Index. If the Index value is beyond the implemented
- DBR register range, a Reserved Register/Field fault may occur. The caller must
- either guarantee that Index is valid, or the caller must set up fault handlers to
- catch the faults.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Data Breakpoint Register index to write.
- @param Value The 64-bit value to write to DBR.
-
- @return The 64-bit value written to the DBR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteDbr (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Performance Monitor Configuration Register (PMC).
-
- Writes current value of Performance Monitor Configuration Register specified by Index.
- All processor implementations provide at least four performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and four performance monitor counter overflow status
- registers (PMC [0]... PMC [3]). Processor implementations may provide additional
- implementation-dependent PMC and PMD to increase the number of 'generic' performance
- counters (PMC/PMD pairs). The remainder of PMC and PMD register set is implementation
- dependent. No parameter checking is performed on Index. If the Index value is
- beyond the implemented PMC register range, the write is ignored.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Performance Monitor Configuration Register index to write.
- @param Value The 64-bit value to write to PMC.
-
- @return The 64-bit value written to the PMC.
-
-**/
-UINT64
-EFIAPI
-AsmWritePmc (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Performance Monitor Data Register (PMD).
-
- Writes current value of Performance Monitor Data Register specified by Index.
- All processor implementations provide at least four performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and four performance monitor counter overflow
- status registers (PMC [0]... PMC [3]). Processor implementations may provide
- additional implementation-dependent PMC and PMD to increase the number of 'generic'
- performance counters (PMC/PMD pairs). The remainder of PMC and PMD register set
- is implementation dependent. No parameter checking is performed on Index. If the
- Index value is beyond the implemented PMD register range, the write is ignored.
- This function is only available on Itanium processors.
-
- @param Index The 8-bit Performance Monitor Data Register index to write.
- @param Value The 64-bit value to write to PMD.
-
- @return The 64-bit value written to the PMD.
-
-**/
-UINT64
-EFIAPI
-AsmWritePmd (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of 64-bit Global Pointer (GP).
-
- Reads and returns the current value of GP.
- This function is only available on Itanium processors.
-
- @return The current value of GP.
-
-**/
-UINT64
-EFIAPI
-AsmReadGp (
- VOID
- );
-
-
-/**
- Write the current value of 64-bit Global Pointer (GP).
-
- Writes the current value of GP. The 64-bit value written to the GP is returned.
- No parameter checking is performed on Value.
- This function is only available on Itanium processors.
-
- @param Value The 64-bit value to write to GP.
-
- @return The 64-bit value written to the GP.
-
-**/
-UINT64
-EFIAPI
-AsmWriteGp (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of 64-bit Stack Pointer (SP).
-
- Reads and returns the current value of SP.
- This function is only available on Itanium processors.
-
- @return The current value of SP.
-
-**/
-UINT64
-EFIAPI
-AsmReadSp (
- VOID
- );
-
-
-///
-/// Valid Index value for AsmReadControlRegister().
-///
-#define IPF_CONTROL_REGISTER_DCR 0
-#define IPF_CONTROL_REGISTER_ITM 1
-#define IPF_CONTROL_REGISTER_IVA 2
-#define IPF_CONTROL_REGISTER_PTA 8
-#define IPF_CONTROL_REGISTER_IPSR 16
-#define IPF_CONTROL_REGISTER_ISR 17
-#define IPF_CONTROL_REGISTER_IIP 19
-#define IPF_CONTROL_REGISTER_IFA 20
-#define IPF_CONTROL_REGISTER_ITIR 21
-#define IPF_CONTROL_REGISTER_IIPA 22
-#define IPF_CONTROL_REGISTER_IFS 23
-#define IPF_CONTROL_REGISTER_IIM 24
-#define IPF_CONTROL_REGISTER_IHA 25
-#define IPF_CONTROL_REGISTER_LID 64
-#define IPF_CONTROL_REGISTER_IVR 65
-#define IPF_CONTROL_REGISTER_TPR 66
-#define IPF_CONTROL_REGISTER_EOI 67
-#define IPF_CONTROL_REGISTER_IRR0 68
-#define IPF_CONTROL_REGISTER_IRR1 69
-#define IPF_CONTROL_REGISTER_IRR2 70
-#define IPF_CONTROL_REGISTER_IRR3 71
-#define IPF_CONTROL_REGISTER_ITV 72
-#define IPF_CONTROL_REGISTER_PMV 73
-#define IPF_CONTROL_REGISTER_CMCV 74
-#define IPF_CONTROL_REGISTER_LRR0 80
-#define IPF_CONTROL_REGISTER_LRR1 81
-
-/**
- Reads a 64-bit control register.
-
- Reads and returns the control register specified by Index. The valid Index valued
- are defined above in "Related Definitions".
- If Index is invalid then 0xFFFFFFFFFFFFFFFF is returned. This function is only
- available on Itanium processors.
-
- @param Index The index of the control register to read.
-
- @return The control register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadControlRegister (
- IN UINT64 Index
- );
-
-
-///
-/// Valid Index value for AsmReadApplicationRegister().
-///
-#define IPF_APPLICATION_REGISTER_K0 0
-#define IPF_APPLICATION_REGISTER_K1 1
-#define IPF_APPLICATION_REGISTER_K2 2
-#define IPF_APPLICATION_REGISTER_K3 3
-#define IPF_APPLICATION_REGISTER_K4 4
-#define IPF_APPLICATION_REGISTER_K5 5
-#define IPF_APPLICATION_REGISTER_K6 6
-#define IPF_APPLICATION_REGISTER_K7 7
-#define IPF_APPLICATION_REGISTER_RSC 16
-#define IPF_APPLICATION_REGISTER_BSP 17
-#define IPF_APPLICATION_REGISTER_BSPSTORE 18
-#define IPF_APPLICATION_REGISTER_RNAT 19
-#define IPF_APPLICATION_REGISTER_FCR 21
-#define IPF_APPLICATION_REGISTER_EFLAG 24
-#define IPF_APPLICATION_REGISTER_CSD 25
-#define IPF_APPLICATION_REGISTER_SSD 26
-#define IPF_APPLICATION_REGISTER_CFLG 27
-#define IPF_APPLICATION_REGISTER_FSR 28
-#define IPF_APPLICATION_REGISTER_FIR 29
-#define IPF_APPLICATION_REGISTER_FDR 30
-#define IPF_APPLICATION_REGISTER_CCV 32
-#define IPF_APPLICATION_REGISTER_UNAT 36
-#define IPF_APPLICATION_REGISTER_FPSR 40
-#define IPF_APPLICATION_REGISTER_ITC 44
-#define IPF_APPLICATION_REGISTER_PFS 64
-#define IPF_APPLICATION_REGISTER_LC 65
-#define IPF_APPLICATION_REGISTER_EC 66
-
-/**
- Reads a 64-bit application register.
-
- Reads and returns the application register specified by Index. The valid Index
- valued are defined above in "Related Definitions".
- If Index is invalid then 0xFFFFFFFFFFFFFFFF is returned. This function is only
- available on Itanium processors.
-
- @param Index The index of the application register to read.
-
- @return The application register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadApplicationRegister (
- IN UINT64 Index
- );
-
-
-/**
- Reads the current value of a Machine Specific Register (MSR).
-
- Reads and returns the current value of the Machine Specific Register specified by Index. No
- parameter checking is performed on Index, and if the Index value is beyond the implemented MSR
- register range, a Reserved Register/Field fault may occur. The caller must either guarantee that
- Index is valid, or the caller must set up fault handlers to catch the faults. This function is
- only available on Itanium processors.
-
- @param Index The 8-bit Machine Specific Register index to read.
-
- @return The current value of the Machine Specific Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr (
- IN UINT8 Index
- );
-
-
-/**
- Writes the current value of a Machine Specific Register (MSR).
-
- Writes Value to the Machine Specific Register specified by Index. Value is returned. No
- parameter checking is performed on Index, and if the Index value is beyond the implemented MSR
- register range, a Reserved Register/Field fault may occur. The caller must either guarantee that
- Index is valid, or the caller must set up fault handlers to catch the faults. This function is
- only available on Itanium processors.
-
- @param Index The 8-bit Machine Specific Register index to write.
- @param Value The 64-bit value to write to the Machine Specific Register.
-
- @return The 64-bit value to write to the Machine Specific Register.
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Determines if the CPU is currently executing in virtual, physical, or mixed mode.
-
- Determines the current execution mode of the CPU.
- If the CPU is in virtual mode(PSR.RT=1, PSR.DT=1, PSR.IT=1), then 1 is returned.
- If the CPU is in physical mode(PSR.RT=0, PSR.DT=0, PSR.IT=0), then 0 is returned.
- If the CPU is not in physical mode or virtual mode, then it is in mixed mode,
- and -1 is returned.
- This function is only available on Itanium processors.
-
- @retval 1 The CPU is in virtual mode.
- @retval 0 The CPU is in physical mode.
- @retval -1 The CPU is in mixed mode.
-
-**/
-INT64
-EFIAPI
-AsmCpuVirtual (
- VOID
- );
-
-
-/**
- Makes a PAL procedure call.
-
- This is a wrapper function to make a PAL procedure call. Based on the Index
- value this API will make static or stacked PAL call. The following table
- describes the usage of PAL Procedure Index Assignment. Architected procedures
- may be designated as required or optional. If a PAL procedure is specified
- as optional, a unique return code of 0xFFFFFFFFFFFFFFFF is returned in the
- Status field of the PAL_CALL_RETURN structure.
- This indicates that the procedure is not present in this PAL implementation.
- It is the caller's responsibility to check for this return code after calling
- any optional PAL procedure.
- No parameter checking is performed on the 5 input parameters, but there are
- some common rules that the caller should follow when making a PAL call. Any
- address passed to PAL as buffers for return parameters must be 8-byte aligned.
- Unaligned addresses may cause undefined results. For those parameters defined
- as reserved or some fields defined as reserved must be zero filled or the invalid
- argument return value may be returned or undefined result may occur during the
- execution of the procedure. If the PalEntryPoint does not point to a valid
- PAL entry point then the system behavior is undefined. This function is only
- available on Itanium processors.
-
- @param PalEntryPoint The PAL procedure calls entry point.
- @param Index The PAL procedure Index number.
- @param Arg2 The 2nd parameter for PAL procedure calls.
- @param Arg3 The 3rd parameter for PAL procedure calls.
- @param Arg4 The 4th parameter for PAL procedure calls.
-
- @return structure returned from the PAL Call procedure, including the status and return value.
-
-**/
-PAL_CALL_RETURN
-EFIAPI
-AsmPalCall (
- IN UINT64 PalEntryPoint,
- IN UINT64 Index,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- );
-#endif
-
-#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
-///
-/// IA32 and x64 Specific Functions.
-/// Byte packed structure for 16-bit Real Mode EFLAGS.
-///
-typedef union {
- struct {
- UINT32 CF:1; ///< Carry Flag.
- UINT32 Reserved_0:1; ///< Reserved.
- UINT32 PF:1; ///< Parity Flag.
- UINT32 Reserved_1:1; ///< Reserved.
- UINT32 AF:1; ///< Auxiliary Carry Flag.
- UINT32 Reserved_2:1; ///< Reserved.
- UINT32 ZF:1; ///< Zero Flag.
- UINT32 SF:1; ///< Sign Flag.
- UINT32 TF:1; ///< Trap Flag.
- UINT32 IF:1; ///< Interrupt Enable Flag.
- UINT32 DF:1; ///< Direction Flag.
- UINT32 OF:1; ///< Overflow Flag.
- UINT32 IOPL:2; ///< I/O Privilege Level.
- UINT32 NT:1; ///< Nested Task.
- UINT32 Reserved_3:1; ///< Reserved.
- } Bits;
- UINT16 Uint16;
-} IA32_FLAGS16;
-
-///
-/// Byte packed structure for EFLAGS/RFLAGS.
-/// 32-bits on IA-32.
-/// 64-bits on x64. The upper 32-bits on x64 are reserved.
-///
-typedef union {
- struct {
- UINT32 CF:1; ///< Carry Flag.
- UINT32 Reserved_0:1; ///< Reserved.
- UINT32 PF:1; ///< Parity Flag.
- UINT32 Reserved_1:1; ///< Reserved.
- UINT32 AF:1; ///< Auxiliary Carry Flag.
- UINT32 Reserved_2:1; ///< Reserved.
- UINT32 ZF:1; ///< Zero Flag.
- UINT32 SF:1; ///< Sign Flag.
- UINT32 TF:1; ///< Trap Flag.
- UINT32 IF:1; ///< Interrupt Enable Flag.
- UINT32 DF:1; ///< Direction Flag.
- UINT32 OF:1; ///< Overflow Flag.
- UINT32 IOPL:2; ///< I/O Privilege Level.
- UINT32 NT:1; ///< Nested Task.
- UINT32 Reserved_3:1; ///< Reserved.
- UINT32 RF:1; ///< Resume Flag.
- UINT32 VM:1; ///< Virtual 8086 Mode.
- UINT32 AC:1; ///< Alignment Check.
- UINT32 VIF:1; ///< Virtual Interrupt Flag.
- UINT32 VIP:1; ///< Virtual Interrupt Pending.
- UINT32 ID:1; ///< ID Flag.
- UINT32 Reserved_4:10; ///< Reserved.
- } Bits;
- UINTN UintN;
-} IA32_EFLAGS32;
-
-///
-/// Byte packed structure for Control Register 0 (CR0).
-/// 32-bits on IA-32.
-/// 64-bits on x64. The upper 32-bits on x64 are reserved.
-///
-typedef union {
- struct {
- UINT32 PE:1; ///< Protection Enable.
- UINT32 MP:1; ///< Monitor Coprocessor.
- UINT32 EM:1; ///< Emulation.
- UINT32 TS:1; ///< Task Switched.
- UINT32 ET:1; ///< Extension Type.
- UINT32 NE:1; ///< Numeric Error.
- UINT32 Reserved_0:10; ///< Reserved.
- UINT32 WP:1; ///< Write Protect.
- UINT32 Reserved_1:1; ///< Reserved.
- UINT32 AM:1; ///< Alignment Mask.
- UINT32 Reserved_2:10; ///< Reserved.
- UINT32 NW:1; ///< Mot Write-through.
- UINT32 CD:1; ///< Cache Disable.
- UINT32 PG:1; ///< Paging.
- } Bits;
- UINTN UintN;
-} IA32_CR0;
-
-///
-/// Byte packed structure for Control Register 4 (CR4).
-/// 32-bits on IA-32.
-/// 64-bits on x64. The upper 32-bits on x64 are reserved.
-///
-typedef union {
- struct {
- UINT32 VME:1; ///< Virtual-8086 Mode Extensions.
- UINT32 PVI:1; ///< Protected-Mode Virtual Interrupts.
- UINT32 TSD:1; ///< Time Stamp Disable.
- UINT32 DE:1; ///< Debugging Extensions.
- UINT32 PSE:1; ///< Page Size Extensions.
- UINT32 PAE:1; ///< Physical Address Extension.
- UINT32 MCE:1; ///< Machine Check Enable.
- UINT32 PGE:1; ///< Page Global Enable.
- UINT32 PCE:1; ///< Performance Monitoring Counter
- ///< Enable.
- UINT32 OSFXSR:1; ///< Operating System Support for
- ///< FXSAVE and FXRSTOR instructions
- UINT32 OSXMMEXCPT:1; ///< Operating System Support for
- ///< Unmasked SIMD Floating Point
- ///< Exceptions.
- UINT32 Reserved_0:2; ///< Reserved.
- UINT32 VMXE:1; ///< VMX Enable
- UINT32 Reserved_1:18; ///< Reserved.
- } Bits;
- UINTN UintN;
-} IA32_CR4;
-
-///
-/// Byte packed structure for a segment descriptor in a GDT/LDT.
-///
-typedef union {
- struct {
- UINT32 LimitLow:16;
- UINT32 BaseLow:16;
- UINT32 BaseMid:8;
- UINT32 Type:4;
- UINT32 S:1;
- UINT32 DPL:2;
- UINT32 P:1;
- UINT32 LimitHigh:4;
- UINT32 AVL:1;
- UINT32 L:1;
- UINT32 DB:1;
- UINT32 G:1;
- UINT32 BaseHigh:8;
- } Bits;
- UINT64 Uint64;
-} IA32_SEGMENT_DESCRIPTOR;
-
-///
-/// Byte packed structure for an IDTR, GDTR, LDTR descriptor.
-///
-#pragma pack (1)
-typedef struct {
- UINT16 Limit;
- UINTN Base;
-} IA32_DESCRIPTOR;
-#pragma pack ()
-
-#define IA32_IDT_GATE_TYPE_TASK 0x85
-#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86
-#define IA32_IDT_GATE_TYPE_TRAP_16 0x87
-#define IA32_IDT_GATE_TYPE_INTERRUPT_32 0x8E
-#define IA32_IDT_GATE_TYPE_TRAP_32 0x8F
-
-
-#if defined (MDE_CPU_IA32)
-///
-/// Byte packed structure for an IA-32 Interrupt Gate Descriptor.
-///
-typedef union {
- struct {
- UINT32 OffsetLow:16; ///< Offset bits 15..0.
- UINT32 Selector:16; ///< Selector.
- UINT32 Reserved_0:8; ///< Reserved.
- UINT32 GateType:8; ///< Gate Type. See #defines above.
- UINT32 OffsetHigh:16; ///< Offset bits 31..16.
- } Bits;
- UINT64 Uint64;
-} IA32_IDT_GATE_DESCRIPTOR;
-
-#endif
-
-#if defined (MDE_CPU_X64)
-///
-/// Byte packed structure for an x64 Interrupt Gate Descriptor.
-///
-typedef union {
- struct {
- UINT32 OffsetLow:16; ///< Offset bits 15..0.
- UINT32 Selector:16; ///< Selector.
- UINT32 Reserved_0:8; ///< Reserved.
- UINT32 GateType:8; ///< Gate Type. See #defines above.
- UINT32 OffsetHigh:16; ///< Offset bits 31..16.
- UINT32 OffsetUpper:32; ///< Offset bits 63..32.
- UINT32 Reserved_1:32; ///< Reserved.
- } Bits;
- struct {
- UINT64 Uint64;
- UINT64 Uint64_1;
- } Uint128;
-} IA32_IDT_GATE_DESCRIPTOR;
-
-#endif
-
-///
-/// Byte packed structure for an FP/SSE/SSE2 context.
-///
-typedef struct {
- UINT8 Buffer[512];
-} IA32_FX_BUFFER;
-
-///
-/// Structures for the 16-bit real mode thunks.
-///
-typedef struct {
- UINT32 Reserved1;
- UINT32 Reserved2;
- UINT32 Reserved3;
- UINT32 Reserved4;
- UINT8 BL;
- UINT8 BH;
- UINT16 Reserved5;
- UINT8 DL;
- UINT8 DH;
- UINT16 Reserved6;
- UINT8 CL;
- UINT8 CH;
- UINT16 Reserved7;
- UINT8 AL;
- UINT8 AH;
- UINT16 Reserved8;
-} IA32_BYTE_REGS;
-
-typedef struct {
- UINT16 DI;
- UINT16 Reserved1;
- UINT16 SI;
- UINT16 Reserved2;
- UINT16 BP;
- UINT16 Reserved3;
- UINT16 SP;
- UINT16 Reserved4;
- UINT16 BX;
- UINT16 Reserved5;
- UINT16 DX;
- UINT16 Reserved6;
- UINT16 CX;
- UINT16 Reserved7;
- UINT16 AX;
- UINT16 Reserved8;
-} IA32_WORD_REGS;
-
-typedef struct {
- UINT32 EDI;
- UINT32 ESI;
- UINT32 EBP;
- UINT32 ESP;
- UINT32 EBX;
- UINT32 EDX;
- UINT32 ECX;
- UINT32 EAX;
- UINT16 DS;
- UINT16 ES;
- UINT16 FS;
- UINT16 GS;
- IA32_EFLAGS32 EFLAGS;
- UINT32 Eip;
- UINT16 CS;
- UINT16 SS;
-} IA32_DWORD_REGS;
-
-typedef union {
- IA32_DWORD_REGS E;
- IA32_WORD_REGS X;
- IA32_BYTE_REGS H;
-} IA32_REGISTER_SET;
-
-///
-/// Byte packed structure for an 16-bit real mode thunks.
-///
-typedef struct {
- IA32_REGISTER_SET *RealModeState;
- VOID *RealModeBuffer;
- UINT32 RealModeBufferSize;
- UINT32 ThunkAttributes;
-} THUNK_CONTEXT;
-
-#define THUNK_ATTRIBUTE_BIG_REAL_MODE 0x00000001
-#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 0x00000002
-#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004
-
-/**
- Retrieves CPUID information.
-
- Executes the CPUID instruction with EAX set to the value specified by Index.
- This function always returns Index.
- If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
- If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
- If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
- If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
- This function is only available on IA-32 and x64.
-
- @param Index The 32-bit value to load into EAX prior to invoking the CPUID
- instruction.
- @param Eax The pointer to the 32-bit EAX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param Ebx The pointer to the 32-bit EBX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param Ecx The pointer to the 32-bit ECX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param Edx The pointer to the 32-bit EDX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
-
- @return Index.
-
-**/
-UINT32
-EFIAPI
-AsmCpuid (
- IN UINT32 Index,
- OUT UINT32 *Eax, OPTIONAL
- OUT UINT32 *Ebx, OPTIONAL
- OUT UINT32 *Ecx, OPTIONAL
- OUT UINT32 *Edx OPTIONAL
- );
-
-
-/**
- Retrieves CPUID information using an extended leaf identifier.
-
- Executes the CPUID instruction with EAX set to the value specified by Index
- and ECX set to the value specified by SubIndex. This function always returns
- Index. This function is only available on IA-32 and x64.
-
- If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
- If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
- If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
- If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
-
- @param Index The 32-bit value to load into EAX prior to invoking the
- CPUID instruction.
- @param SubIndex The 32-bit value to load into ECX prior to invoking the
- CPUID instruction.
- @param Eax The pointer to the 32-bit EAX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param Ebx The pointer to the 32-bit EBX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param Ecx The pointer to the 32-bit ECX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param Edx The pointer to the 32-bit EDX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
-
- @return Index.
-
-**/
-UINT32
-EFIAPI
-AsmCpuidEx (
- IN UINT32 Index,
- IN UINT32 SubIndex,
- OUT UINT32 *Eax, OPTIONAL
- OUT UINT32 *Ebx, OPTIONAL
- OUT UINT32 *Ecx, OPTIONAL
- OUT UINT32 *Edx OPTIONAL
- );
-
-
-/**
- Set CD bit and clear NW bit of CR0 followed by a WBINVD.
-
- Disables the caches by setting the CD bit of CR0 to 1, clearing the NW bit of CR0 to 0,
- and executing a WBINVD instruction. This function is only available on IA-32 and x64.
-
-**/
-VOID
-EFIAPI
-AsmDisableCache (
- VOID
- );
-
-
-/**
- Perform a WBINVD and clear both the CD and NW bits of CR0.
-
- Enables the caches by executing a WBINVD instruction and then clear both the CD and NW
- bits of CR0 to 0. This function is only available on IA-32 and x64.
-
-**/
-VOID
-EFIAPI
-AsmEnableCache (
- VOID
- );
-
-
-/**
- Returns the lower 32-bits of a Machine Specific Register(MSR).
-
- Reads and returns the lower 32-bits of the MSR specified by Index.
- No parameter checking is performed on Index, and some Index values may cause
- CPU exceptions. The caller must either guarantee that Index is valid, or the
- caller must set up exception handlers to catch the exceptions. This function
- is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The lower 32 bits of the MSR identified by Index.
-
-**/
-UINT32
-EFIAPI
-AsmReadMsr32 (
- IN UINT32 Index
- );
-
-
-/**
- Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.
- The upper 32-bits of the MSR are set to zero.
-
- Writes the 32-bit value specified by Value to the MSR specified by Index. The
- upper 32-bits of the MSR write are set to zero. The 32-bit value written to
- the MSR is returned. No parameter checking is performed on Index or Value,
- and some of these may cause CPU exceptions. The caller must either guarantee
- that Index and Value are valid, or the caller must establish proper exception
- handlers. This function is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 32-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-AsmWriteMsr32 (
- IN UINT32 Index,
- IN UINT32 Value
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and
- writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the lower 32-bits of the read result and the value specified by
- OrData, and writes the result to the 64-bit MSR specified by Index. The lower
- 32-bits of the value written to the MSR is returned. No parameter checking is
- performed on Index or OrData, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and OrData are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrOr32 (
- IN UINT32 Index,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
- the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData, and
- writes the result to the 64-bit MSR specified by Index. The lower 32-bits of
- the value written to the MSR is returned. No parameter checking is performed
- on Index or AndData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index and AndData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAnd32 (
- IN UINT32 Index,
- IN UINT32 AndData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR
- on the lower 32-bits, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData
- preserving the upper 32-bits, performs a bitwise OR between the
- result of the AND operation and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Address. The lower 32-bits of the value
- written to the MSR is returned. No parameter checking is performed on Index,
- AndData, or OrData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index, AndData, and OrData are valid, or the
- caller must establish proper exception handlers. This function is only
- available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAndThenOr32 (
- IN UINT32 Index,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned. The caller must either guarantee that Index is valid, or the caller
- must set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read from the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldRead32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination MSR are preserved. The lower 32-bits of the MSR written is
- returned. The caller must either guarantee that Index and the data written
- is valid, or the caller must set up exception handlers to catch the exceptions.
- This function is only available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldWrite32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The lower 32-bits of the value
- written to the MSR are returned. Extra left bits in OrData are stripped. The
- caller must either guarantee that Index and the data written is valid, or
- the caller must set up exception handlers to catch the exceptions. This
- function is only available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The lower 32-bits of the value written to the
- MSR are returned. Extra left bits in AndData are stripped. The caller must
- either guarantee that Index and the data written is valid, or the caller must
- set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAnd32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a
- bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- lower 32-bits of the value written to the MSR are returned. Extra left bits
- in both AndData and OrData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAndThenOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-
-/**
- Returns a 64-bit Machine Specific Register(MSR).
-
- Reads and returns the 64-bit MSR specified by Index. No parameter checking is
- performed on Index, and some Index values may cause CPU exceptions. The
- caller must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and x64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The value of the MSR identified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- );
-
-
-/**
- Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
- value.
-
- Writes the 64-bit value specified by Value to the MSR specified by Index. The
- 64-bit value written to the MSR is returned. No parameter checking is
- performed on Index or Value, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and Value are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 64-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise OR, and writes the result
- back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. No parameter checking is performed on Index or OrData, and some of
- these may cause CPU exceptions. The caller must either guarantee that Index
- and OrData are valid, or the caller must establish proper exception handlers.
- This function is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrOr64 (
- IN UINT32 Index,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by OrData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned. No
- parameter checking is performed on Index or OrData, and some of these may
- cause CPU exceptions. The caller must either guarantee that Index and OrData
- are valid, or the caller must establish proper exception handlers. This
- function is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAnd64 (
- IN UINT32 Index,
- IN UINT64 AndData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between read
- result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit MSR specified by Index. The value written
- to the MSR is returned. No parameter checking is performed on Index, AndData,
- or OrData, and some of these may cause CPU exceptions. The caller must either
- guarantee that Index, AndData, and OrData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAndThenOr64 (
- IN UINT32 Index,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the 64-bit MSR. The bit field is specified by the
- StartBit and the EndBit. The value of the bit field is returned. The caller
- must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read from the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldRead64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in a 64-bit MSR. The bit field is specified by
- the StartBit and the EndBit. All other bits in the destination MSR are
- preserved. The MSR written is returned. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldWrite64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. Extra left bits in OrData are stripped. The caller must either
- guarantee that Index and the data written is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned.
- Extra left bits in AndData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAnd64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by
- a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- value written to the MSR is returned. Extra left bits in both AndData and
- OrData are stripped. The caller must either guarantee that Index and the data
- written is valid, or the caller must set up exception handlers to catch the
- exceptions. This function is only available on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAndThenOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-
-/**
- Reads the current value of the EFLAGS register.
-
- Reads and returns the current value of the EFLAGS register. This function is
- only available on IA-32 and x64. This returns a 32-bit value on IA-32 and a
- 64-bit value on x64.
-
- @return EFLAGS on IA-32 or RFLAGS on x64.
-
-**/
-UINTN
-EFIAPI
-AsmReadEflags (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 0 (CR0).
-
- Reads and returns the current value of CR0. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 0 (CR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr0 (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 2 (CR2).
-
- Reads and returns the current value of CR2. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 2 (CR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr2 (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 3 (CR3).
-
- Reads and returns the current value of CR3. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 3 (CR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr3 (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 4 (CR4).
-
- Reads and returns the current value of CR4. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 4 (CR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr4 (
- VOID
- );
-
-
-/**
- Writes a value to Control Register 0 (CR0).
-
- Writes and returns a new value to CR0. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Cr0 The value to write to CR0.
-
- @return The value written to CR0.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr0 (
- UINTN Cr0
- );
-
-
-/**
- Writes a value to Control Register 2 (CR2).
-
- Writes and returns a new value to CR2. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Cr2 The value to write to CR2.
-
- @return The value written to CR2.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr2 (
- UINTN Cr2
- );
-
-
-/**
- Writes a value to Control Register 3 (CR3).
-
- Writes and returns a new value to CR3. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Cr3 The value to write to CR3.
-
- @return The value written to CR3.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr3 (
- UINTN Cr3
- );
-
-
-/**
- Writes a value to Control Register 4 (CR4).
-
- Writes and returns a new value to CR4. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Cr4 The value to write to CR4.
-
- @return The value written to CR4.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr4 (
- UINTN Cr4
- );
-
-
-/**
- Reads the current value of Debug Register 0 (DR0).
-
- Reads and returns the current value of DR0. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr0 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 1 (DR1).
-
- Reads and returns the current value of DR1. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr1 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 2 (DR2).
-
- Reads and returns the current value of DR2. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr2 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 3 (DR3).
-
- Reads and returns the current value of DR3. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr3 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 4 (DR4).
-
- Reads and returns the current value of DR4. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr4 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 5 (DR5).
-
- Reads and returns the current value of DR5. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr5 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 6 (DR6).
-
- Reads and returns the current value of DR6. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr6 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 7 (DR7).
-
- Reads and returns the current value of DR7. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr7 (
- VOID
- );
-
-
-/**
- Writes a value to Debug Register 0 (DR0).
-
- Writes and returns a new value to DR0. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr0 The value to write to Dr0.
-
- @return The value written to Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr0 (
- UINTN Dr0
- );
-
-
-/**
- Writes a value to Debug Register 1 (DR1).
-
- Writes and returns a new value to DR1. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr1 The value to write to Dr1.
-
- @return The value written to Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr1 (
- UINTN Dr1
- );
-
-
-/**
- Writes a value to Debug Register 2 (DR2).
-
- Writes and returns a new value to DR2. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr2 The value to write to Dr2.
-
- @return The value written to Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr2 (
- UINTN Dr2
- );
-
-
-/**
- Writes a value to Debug Register 3 (DR3).
-
- Writes and returns a new value to DR3. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr3 The value to write to Dr3.
-
- @return The value written to Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr3 (
- UINTN Dr3
- );
-
-
-/**
- Writes a value to Debug Register 4 (DR4).
-
- Writes and returns a new value to DR4. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr4 The value to write to Dr4.
-
- @return The value written to Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr4 (
- UINTN Dr4
- );
-
-
-/**
- Writes a value to Debug Register 5 (DR5).
-
- Writes and returns a new value to DR5. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr5 The value to write to Dr5.
-
- @return The value written to Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr5 (
- UINTN Dr5
- );
-
-
-/**
- Writes a value to Debug Register 6 (DR6).
-
- Writes and returns a new value to DR6. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr6 The value to write to Dr6.
-
- @return The value written to Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr6 (
- UINTN Dr6
- );
-
-
-/**
- Writes a value to Debug Register 7 (DR7).
-
- Writes and returns a new value to DR7. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Dr7 The value to write to Dr7.
-
- @return The value written to Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr7 (
- UINTN Dr7
- );
-
-
-/**
- Reads the current value of Code Segment Register (CS).
-
- Reads and returns the current value of CS. This function is only available on
- IA-32 and x64.
-
- @return The current value of CS.
-
-**/
-UINT16
-EFIAPI
-AsmReadCs (
- VOID
- );
-
-
-/**
- Reads the current value of Data Segment Register (DS).
-
- Reads and returns the current value of DS. This function is only available on
- IA-32 and x64.
-
- @return The current value of DS.
-
-**/
-UINT16
-EFIAPI
-AsmReadDs (
- VOID
- );
-
-
-/**
- Reads the current value of Extra Segment Register (ES).
-
- Reads and returns the current value of ES. This function is only available on
- IA-32 and x64.
-
- @return The current value of ES.
-
-**/
-UINT16
-EFIAPI
-AsmReadEs (
- VOID
- );
-
-
-/**
- Reads the current value of FS Data Segment Register (FS).
-
- Reads and returns the current value of FS. This function is only available on
- IA-32 and x64.
-
- @return The current value of FS.
-
-**/
-UINT16
-EFIAPI
-AsmReadFs (
- VOID
- );
-
-
-/**
- Reads the current value of GS Data Segment Register (GS).
-
- Reads and returns the current value of GS. This function is only available on
- IA-32 and x64.
-
- @return The current value of GS.
-
-**/
-UINT16
-EFIAPI
-AsmReadGs (
- VOID
- );
-
-
-/**
- Reads the current value of Stack Segment Register (SS).
-
- Reads and returns the current value of SS. This function is only available on
- IA-32 and x64.
-
- @return The current value of SS.
-
-**/
-UINT16
-EFIAPI
-AsmReadSs (
- VOID
- );
-
-
-/**
- Reads the current value of Task Register (TR).
-
- Reads and returns the current value of TR. This function is only available on
- IA-32 and x64.
-
- @return The current value of TR.
-
-**/
-UINT16
-EFIAPI
-AsmReadTr (
- VOID
- );
-
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and x64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- );
-
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and x64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- );
-
-
-/**
- Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and x64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- );
-
-
-/**
- Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and x64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- );
-
-
-/**
- Reads the current Local Descriptor Table Register(LDTR) selector.
-
- Reads and returns the current 16-bit LDTR descriptor value. This function is
- only available on IA-32 and x64.
-
- @return The current selector of LDT.
-
-**/
-UINT16
-EFIAPI
-AsmReadLdtr (
- VOID
- );
-
-
-/**
- Writes the current Local Descriptor Table Register (LDTR) selector.
-
- Writes and the current LDTR descriptor specified by Ldtr. This function is
- only available on IA-32 and x64.
-
- @param Ldtr 16-bit LDTR selector value.
-
-**/
-VOID
-EFIAPI
-AsmWriteLdtr (
- IN UINT16 Ldtr
- );
-
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and x64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxSave (
- OUT IA32_FX_BUFFER *Buffer
- );
-
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and x64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
- If Buffer was not saved with AsmFxSave(), then ASSERT().
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #0 (MM0).
-
- Reads and returns the current value of MM0. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM0.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm0 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #1 (MM1).
-
- Reads and returns the current value of MM1. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM1.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm1 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #2 (MM2).
-
- Reads and returns the current value of MM2. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM2.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm2 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #3 (MM3).
-
- Reads and returns the current value of MM3. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM3.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm3 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #4 (MM4).
-
- Reads and returns the current value of MM4. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM4.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm4 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #5 (MM5).
-
- Reads and returns the current value of MM5. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM5.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm5 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #6 (MM6).
-
- Reads and returns the current value of MM6. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM6.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm6 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #7 (MM7).
-
- Reads and returns the current value of MM7. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM7.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm7 (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #0 (MM0).
-
- Writes the current value of MM0. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM0.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm0 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #1 (MM1).
-
- Writes the current value of MM1. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM1.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm1 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #2 (MM2).
-
- Writes the current value of MM2. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM2.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm2 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #3 (MM3).
-
- Writes the current value of MM3. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM3.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm3 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #4 (MM4).
-
- Writes the current value of MM4. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM4.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm4 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #5 (MM5).
-
- Writes the current value of MM5. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM5.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm5 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #6 (MM6).
-
- Writes the current value of MM6. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM6.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm6 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #7 (MM7).
-
- Writes the current value of MM7. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM7.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm7 (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Time Stamp Counter (TSC).
-
- Reads and returns the current value of TSC. This function is only available
- on IA-32 and x64.
-
- @return The current value of TSC
-
-**/
-UINT64
-EFIAPI
-AsmReadTsc (
- VOID
- );
-
-
-/**
- Reads the current value of a Performance Counter (PMC).
-
- Reads and returns the current value of performance counter specified by
- Index. This function is only available on IA-32 and x64.
-
- @param Index The 32-bit Performance Counter index to read.
-
- @return The value of the PMC specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT32 Index
- );
-
-
-/**
- Sets up a monitor buffer that is used by AsmMwait().
-
- Executes a MONITOR instruction with the register state specified by Eax, Ecx
- and Edx. Returns Eax. This function is only available on IA-32 and x64.
-
- @param Eax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param Ecx The value to load into ECX or RCX before executing the MONITOR
- instruction.
- @param Edx The value to load into EDX or RDX before executing the MONITOR
- instruction.
-
- @return Eax
-
-**/
-UINTN
-EFIAPI
-AsmMonitor (
- IN UINTN Eax,
- IN UINTN Ecx,
- IN UINTN Edx
- );
-
-
-/**
- Executes an MWAIT instruction.
-
- Executes an MWAIT instruction with the register state specified by Eax and
- Ecx. Returns Eax. This function is only available on IA-32 and x64.
-
- @param Eax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param Ecx The value to load into ECX or RCX before executing the MONITOR
- instruction.
-
- @return Eax
-
-**/
-UINTN
-EFIAPI
-AsmMwait (
- IN UINTN Eax,
- IN UINTN Ecx
- );
-
-
-/**
- Executes a WBINVD instruction.
-
- Executes a WBINVD instruction. This function is only available on IA-32 and
- x64.
-
-**/
-VOID
-EFIAPI
-AsmWbinvd (
- VOID
- );
-
-
-/**
- Executes a INVD instruction.
-
- Executes a INVD instruction. This function is only available on IA-32 and
- x64.
-
-**/
-VOID
-EFIAPI
-AsmInvd (
- VOID
- );
-
-
-/**
- Flushes a cache line from all the instruction and data caches within the
- coherency domain of the CPU.
-
- Flushed the cache line specified by LinearAddress, and returns LinearAddress.
- This function is only available on IA-32 and x64.
-
- @param LinearAddress The address of the cache line to flush. If the CPU is
- in a physical addressing mode, then LinearAddress is a
- physical address. If the CPU is in a virtual
- addressing mode, then LinearAddress is a virtual
- address.
-
- @return LinearAddress.
-**/
-VOID *
-EFIAPI
-AsmFlushCacheLine (
- IN VOID *LinearAddress
- );
-
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit paged mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode with flat
- descriptors, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging64 (
- IN UINT16 Cs,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- );
-
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on x64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 64-bit paged mode, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging64 (
- IN UINT16 Cs,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- );
-
-
-//
-// 16-bit thunking services
-//
-
-/**
- Retrieves the properties for 16-bit thunk functions.
-
- Computes the size of the buffer and stack below 1MB required to use the
- AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This
- buffer size is returned in RealModeBufferSize, and the stack size is returned
- in ExtraStackSize. If parameters are passed to the 16-bit real mode code,
- then the actual minimum stack size is ExtraStackSize plus the maximum number
- of bytes that need to be passed to the 16-bit real mode code.
-
- If RealModeBufferSize is NULL, then ASSERT().
- If ExtraStackSize is NULL, then ASSERT().
-
- @param RealModeBufferSize A pointer to the size of the buffer below 1MB
- required to use the 16-bit thunk functions.
- @param ExtraStackSize A pointer to the extra size of stack below 1MB
- that the 16-bit thunk functions require for
- temporary storage in the transition to and from
- 16-bit real mode.
-
-**/
-VOID
-EFIAPI
-AsmGetThunk16Properties (
- OUT UINT32 *RealModeBufferSize,
- OUT UINT32 *ExtraStackSize
- );
-
-
-/**
- Prepares all structures a code required to use AsmThunk16().
-
- Prepares all structures and code required to use AsmThunk16().
-
- This interface is limited to be used in either physical mode or virtual modes with paging enabled where the
- virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
-
- If ThunkContext is NULL, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- );
-
-
-/**
- Transfers control to a 16-bit real mode entry point and returns the results.
-
- Transfers control to a 16-bit real mode entry point and returns the results.
- AsmPrepareThunk16() must be called with ThunkContext before this function is used.
- This function must be called with interrupts disabled.
-
- The register state from the RealModeState field of ThunkContext is restored just prior
- to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState,
- which is used to set the interrupt state when a 16-bit real mode entry point is called.
- Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState.
- The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to
- the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function.
- The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction,
- so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment
- and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry
- point must exit with a RETF instruction. The register state is captured into RealModeState immediately
- after the RETF instruction is executed.
-
- If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
- or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure
- the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode.
-
- If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
- then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode.
- This includes the base vectors, the interrupt masks, and the edge/level trigger mode.
-
- If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code
- is invoked in big real mode. Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits.
-
- If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in
- ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to
- disable the A20 mask.
-
- If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in
- ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask. If this INT 15 call fails,
- then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.
-
- If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in
- ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.
-
- If ThunkContext is NULL, then ASSERT().
- If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().
- If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in
- ThunkAttributes, then ASSERT().
-
- This interface is limited to be used in either physical mode or virtual modes with paging enabled where the
- virtual to physical mappings for ThunkContext.RealModeBuffer are mapped 1:1.
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- );
-
-
-/**
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results.
-
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results. If the
- caller only need to perform a single 16-bit real mode thunk, then this
- service should be used. If the caller intends to make more than one 16-bit
- real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
- once and AsmThunk16() can be called for each 16-bit real mode thunk.
-
- This interface is limited to be used in either physical mode or virtual modes with paging enabled where the
- virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
-
- See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions.
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareAndThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- );
-
-/**
- Generates a 16-bit random number through RDRAND instruction.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
- **/
-BOOLEAN
-EFIAPI
-AsmRdRand16 (
- OUT UINT16 *Rand
- );
-
-/**
- Generates a 32-bit random number through RDRAND instruction.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
-**/
-BOOLEAN
-EFIAPI
-AsmRdRand32 (
- OUT UINT32 *Rand
- );
-
-/**
- Generates a 64-bit random number through RDRAND instruction.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
-**/
-BOOLEAN
-EFIAPI
-AsmRdRand64 (
- OUT UINT64 *Rand
- );
-
-#endif
-#endif
-
-
diff --git a/Core/MdePkg/Include/Library/BaseMemoryLib.h b/Core/MdePkg/Include/Library/BaseMemoryLib.h
deleted file mode 100644
index 0e565c1542..0000000000
--- a/Core/MdePkg/Include/Library/BaseMemoryLib.h
+++ /dev/null
@@ -1,489 +0,0 @@
-/** @file
- Provides copy memory, fill memory, zero memory, and GUID functions.
-
- The Base Memory Library provides optimized implementations for common memory-based operations.
- These functions should be used in place of coding your own loops to do equivalent common functions.
- This allows optimized library implementations to help increase performance.
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __BASE_MEMORY_LIB__
-#define __BASE_MEMORY_LIB__
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
-
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-CopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Fills a target buffer with a byte value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with Value, and returns Buffer.
-
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 16-bit value specified by
- Value, and returns Buffer. Value is repeated every 16-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 32-bit value specified by
- Value, and returns Buffer. Value is repeated every 32-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 64-bit value specified by
- Value, and returns Buffer. Value is repeated every 64-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Fills a target buffer with a value that is size UINTN, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the UINTN sized value specified by
- Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMemN (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- );
-
-/**
- Fills a target buffer with zeros, and returns the target buffer.
-
- This function fills Length bytes of Buffer with zeros, and returns Buffer.
-
- If Length > 0 and 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 fill with zeros.
- @param Length The number of bytes in Buffer to fill with zeros.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-ZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
- If Length > 0 and DestinationBuffer is NULL, then ASSERT().
- If Length > 0 and SourceBuffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer to compare.
- @param SourceBuffer The pointer to the source buffer to compare.
- @param Length The number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for an 8-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and 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 scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, otherwise NULL.
-
-**/
-VOID *
-EFIAPI
-ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 16-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, otherwise NULL.
-
-**/
-VOID *
-EFIAPI
-ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 32-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, otherwise NULL.
-
-**/
-VOID *
-EFIAPI
-ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 64-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, otherwise NULL.
-
-**/
-VOID *
-EFIAPI
-ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
- UINTN sized value in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a UINTN sized value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, otherwise NULL.
-
-**/
-VOID *
-EFIAPI
-ScanMemN (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- );
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
-
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid The pointer to the destination GUID.
- @param SourceGuid The pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- );
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- );
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Guid The value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer, otherwise NULL.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- );
-
-/**
- Checks if the given GUID is a zero GUID.
-
- This function checks whether the given GUID is a zero GUID. If the GUID is
- identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid The pointer to a 128 bit GUID.
-
- @retval TRUE Guid is a zero GUID.
- @retval FALSE Guid is not a zero GUID.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroGuid (
- IN CONST GUID *Guid
- );
-
-/**
- Checks if the contents of a buffer are all zeros.
-
- This function checks whether the contents of a buffer are all zeros. If the
- contents are all zeros, return TRUE. Otherwise, return FALSE.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/CacheMaintenanceLib.h b/Core/MdePkg/Include/Library/CacheMaintenanceLib.h
deleted file mode 100644
index 48e0fe5a1c..0000000000
--- a/Core/MdePkg/Include/Library/CacheMaintenanceLib.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/** @file
- Provides services to maintain instruction and data caches.
-
- The Cache Maintenance Library provides abstractions for basic processor cache operations.
- It removes the need to use assembly in C code.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __CACHE_MAINTENANCE_LIB__
-#define __CACHE_MAINTENANCE_LIB__
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-InvalidateInstructionCache (
- VOID
- );
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, then no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-/**
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- );
-
-/**
- Writes Back and Invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes Back and Invalidate the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, then no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address of cache invalidation.
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-/**
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- );
-
-/**
- Writes Back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes Back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, then no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address of cache written in main memory.
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- );
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, the no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/CpuLib.h b/Core/MdePkg/Include/Library/CpuLib.h
deleted file mode 100644
index 100020a672..0000000000
--- a/Core/MdePkg/Include/Library/CpuLib.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- Provides CPU architecture specific functions that can not be defined
- in the Base Library due to dependencies on the PAL Library
-
- The CPU Library provides services to flush CPU TLBs and place the CPU in a sleep state.
- The implementation of these services on Itanium processors requires the use of PAL Calls.
- PAL Calls require PEI and DXE specific mechanisms to look up PAL Entry Point.
- As a result, these services could not be defined in the Base Library.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __CPU_LIB_H__
-#define __CPU_LIB_H__
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- );
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- );
-
-
-#endif
diff --git a/Core/MdePkg/Include/Library/DebugLib.h b/Core/MdePkg/Include/Library/DebugLib.h
deleted file mode 100644
index 3a910e6a20..0000000000
--- a/Core/MdePkg/Include/Library/DebugLib.h
+++ /dev/null
@@ -1,529 +0,0 @@
-/** @file
- Provides services to print debug and assert messages to a debug output device.
-
- The Debug library supports debug print and asserts based on a combination of macros and code.
- The debug library can be turned on and off so that the debug code does not increase the size of an image.
-
- Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention
- of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
- defined, then debug and assert related macros wrapped by it are the NULL implementations.
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __DEBUG_LIB_H__
-#define __DEBUG_LIB_H__
-
-//
-// Declare bits for PcdDebugPropertyMask
-//
-#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED 0x01
-#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED 0x02
-#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED 0x04
-#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED 0x08
-#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED 0x10
-#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED 0x20
-
-//
-// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
-//
-#define DEBUG_INIT 0x00000001 // Initialization
-#define DEBUG_WARN 0x00000002 // Warnings
-#define DEBUG_LOAD 0x00000004 // Load events
-#define DEBUG_FS 0x00000008 // EFI File system
-#define DEBUG_POOL 0x00000010 // Alloc & Free (pool)
-#define DEBUG_PAGE 0x00000020 // Alloc & Free (page)
-#define DEBUG_INFO 0x00000040 // Informational debug messages
-#define DEBUG_DISPATCH 0x00000080 // PEI/DXE/SMM Dispatchers
-#define DEBUG_VARIABLE 0x00000100 // Variable
-#define DEBUG_BM 0x00000400 // Boot Manager
-#define DEBUG_BLKIO 0x00001000 // BlkIo Driver
-#define DEBUG_NET 0x00004000 // Network Io Driver
-#define DEBUG_UNDI 0x00010000 // UNDI Driver
-#define DEBUG_LOADFILE 0x00020000 // LoadFile
-#define DEBUG_EVENT 0x00080000 // Event messages
-#define DEBUG_GCD 0x00100000 // Global Coherency Database changes
-#define DEBUG_CACHE 0x00200000 // Memory range cachability changes
-#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may
- // significantly impact boot performance
-#define DEBUG_ERROR 0x80000000 // Error
-
-//
-// Aliases of debug message mask bits
-//
-#define EFI_D_INIT DEBUG_INIT
-#define EFI_D_WARN DEBUG_WARN
-#define EFI_D_LOAD DEBUG_LOAD
-#define EFI_D_FS DEBUG_FS
-#define EFI_D_POOL DEBUG_POOL
-#define EFI_D_PAGE DEBUG_PAGE
-#define EFI_D_INFO DEBUG_INFO
-#define EFI_D_DISPATCH DEBUG_DISPATCH
-#define EFI_D_VARIABLE DEBUG_VARIABLE
-#define EFI_D_BM DEBUG_BM
-#define EFI_D_BLKIO DEBUG_BLKIO
-#define EFI_D_NET DEBUG_NET
-#define EFI_D_UNDI DEBUG_UNDI
-#define EFI_D_LOADFILE DEBUG_LOADFILE
-#define EFI_D_EVENT DEBUG_EVENT
-#define EFI_D_VERBOSE DEBUG_VERBOSE
-#define EFI_D_ERROR DEBUG_ERROR
-
-/**
- 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 The format string for the debug message to print.
- @param ... The 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,
- ...
- );
-
-
-/**
- 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 <FileName>(<LineNumber>): <Description>\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 <FileName> string of "(NULL) Filename" is printed.
- If Description is NULL, then a <Description> 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
- );
-
-
-/**
- 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
- );
-
-
-/**
- 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
- );
-
-
-/**
- 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
- );
-
-
-/**
- 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
- );
-
-
-/**
- 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
- );
-
-/**
- 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
- );
-
-/**
- Internal worker macro that calls DebugAssert().
-
- This macro calls DebugAssert(), passing in the filename, line number, and an
- expression that evaluated to FALSE.
-
- @param Expression Boolean expression that evaluated to FALSE
-
-**/
-#define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, #Expression)
-
-
-/**
- Internal worker macro that calls DebugPrint().
-
- This macro calls DebugPrint() passing in the debug error level, a format
- string, and a variable argument list.
- __VA_ARGS__ is not supported by EBC compiler, Microsoft Visual Studio .NET 2003
- and Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830.
-
- @param Expression Expression containing an error level, a format string,
- and a variable argument list based on the format string.
-
-**/
-
-#if !defined(MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400)
- #define _DEBUG_PRINT(PrintLevel, ...) \
- do { \
- if (DebugPrintLevelEnabled (PrintLevel)) { \
- DebugPrint (PrintLevel, ##__VA_ARGS__); \
- } \
- } while (FALSE)
- #define _DEBUG(Expression) _DEBUG_PRINT Expression
-#else
-#define _DEBUG(Expression) DebugPrint Expression
-#endif
-
-/**
- Macro that calls DebugAssert() if an expression evaluates to FALSE.
-
- If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED
- bit of PcdDebugProperyMask is set, then this macro evaluates the Boolean
- expression specified by Expression. If Expression evaluates to FALSE, then
- DebugAssert() is called passing in the source filename, source line number,
- and Expression.
-
- @param Expression Boolean expression.
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define ASSERT(Expression) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (!(Expression)) { \
- _ASSERT (Expression); \
- ANALYZER_UNREACHABLE (); \
- } \
- } \
- } while (FALSE)
-#else
- #define ASSERT(Expression)
-#endif
-
-/**
- Macro that calls DebugPrint().
-
- If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED
- bit of PcdDebugProperyMask is set, then this macro passes Expression to
- DebugPrint().
-
- @param Expression Expression containing an error level, a format string,
- and a variable argument list based on the format string.
-
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define DEBUG(Expression) \
- do { \
- if (DebugPrintEnabled ()) { \
- _DEBUG (Expression); \
- } \
- } while (FALSE)
-#else
- #define DEBUG(Expression)
-#endif
-
-/**
- Macro that calls DebugAssert() if an EFI_STATUS evaluates to an error code.
-
- If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED
- bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_STATUS
- value specified by StatusParameter. If StatusParameter is an error code,
- then DebugAssert() is called passing in the source filename, source line
- number, and StatusParameter.
-
- @param StatusParameter EFI_STATUS value to evaluate.
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define ASSERT_EFI_ERROR(StatusParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (EFI_ERROR (StatusParameter)) { \
- DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \
- _ASSERT (!EFI_ERROR (StatusParameter)); \
- } \
- } \
- } while (FALSE)
-#else
- #define ASSERT_EFI_ERROR(StatusParameter)
-#endif
-
-/**
- Macro that calls DebugAssert() if a RETURN_STATUS evaluates to an error code.
-
- If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED
- bit of PcdDebugProperyMask is set, then this macro evaluates the
- RETURN_STATUS value specified by StatusParameter. If StatusParameter is an
- error code, then DebugAssert() is called passing in the source filename,
- source line number, and StatusParameter.
-
- @param StatusParameter RETURN_STATUS value to evaluate.
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define ASSERT_RETURN_ERROR(StatusParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (RETURN_ERROR (StatusParameter)) { \
- DEBUG ((DEBUG_ERROR, "\nASSERT_RETURN_ERROR (Status = %r)\n", \
- StatusParameter)); \
- _ASSERT (!RETURN_ERROR (StatusParameter)); \
- } \
- } \
- } while (FALSE)
-#else
- #define ASSERT_RETURN_ERROR(StatusParameter)
-#endif
-
-/**
- Macro that calls DebugAssert() if a protocol is already installed in the
- handle database.
-
- If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit
- of PcdDebugProperyMask is clear, then return.
-
- If Handle is NULL, then a check is made to see if the protocol specified by Guid
- is present on any handle in the handle database. If Handle is not NULL, then
- a check is made to see if the protocol specified by Guid is present on the
- handle specified by Handle. If the check finds the protocol, then DebugAssert()
- is called passing in the source filename, source line number, and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param Handle The handle to check for the protocol. This is an optional
- parameter that may be NULL. If it is NULL, then the entire
- handle database is searched.
-
- @param Guid The pointer to a protocol GUID.
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \
- do { \
- if (DebugAssertEnabled ()) { \
- VOID *Instance; \
- ASSERT (Guid != NULL); \
- if (Handle == NULL) { \
- if (!EFI_ERROR (gBS->LocateProtocol ((EFI_GUID *)Guid, NULL, &Instance))) { \
- _ASSERT (Guid already installed in database); \
- } \
- } else { \
- if (!EFI_ERROR (gBS->HandleProtocol (Handle, (EFI_GUID *)Guid, &Instance))) { \
- _ASSERT (Guid already installed on Handle); \
- } \
- } \
- } \
- } while (FALSE)
-#else
- #define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
-#endif
-
-/**
- Macro that marks the beginning of debug source code.
-
- If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
- then this macro marks the beginning of source code that is included in a module.
- Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()
- are not included in a module.
-
-**/
-#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal
-
-
-/**
- The macro that marks the end of debug source code.
-
- If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
- then this macro marks the end of source code that is included in a module.
- Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()
- are not included in a module.
-
-**/
-#define DEBUG_CODE_END() __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)
-
-
-/**
- The macro that declares a section of debug source code.
-
- If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
- then the source code specified by Expression is included in a module.
- Otherwise, the source specified by Expression is not included in a module.
-
-**/
-#define DEBUG_CODE(Expression) \
- DEBUG_CODE_BEGIN (); \
- Expression \
- DEBUG_CODE_END ()
-
-
-/**
- The macro that calls DebugClearMemory() to clear a buffer to a default value.
-
- If the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set,
- then this macro calls DebugClearMemory() passing in Address and Length.
-
- @param Address The pointer to a buffer.
- @param Length The number of bytes in the buffer to set.
-
-**/
-#define DEBUG_CLEAR_MEMORY(Address, Length) \
- do { \
- if (DebugClearMemoryEnabled ()) { \
- DebugClearMemory (Address, Length); \
- } \
- } while (FALSE)
-
-
-/**
- Macro that calls DebugAssert() if the containing record does not have a
- matching signature. If the signatures matches, then a pointer to the data
- structure that contains a specified field of that data structure is returned.
- This is a lightweight method hide information by placing a public data
- structure inside a larger private data structure and using a pointer to the
- public data structure to retrieve a pointer to the private data structure.
-
- If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit
- of PcdDebugProperyMask is clear, then this macro computes the offset, in bytes,
- of the field specified by Field from the beginning of the data structure specified
- by TYPE. This offset is subtracted from Record, and is used to return a pointer
- to a data structure of the type specified by TYPE.
-
- If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit
- of PcdDebugProperyMask is set, then this macro computes the offset, in bytes,
- of field specified by Field from the beginning of the data structure specified
- by TYPE. This offset is subtracted from Record, and is used to compute a pointer
- to a data structure of the type specified by TYPE. The Signature field of the
- data structure specified by TYPE is compared to TestSignature. If the signatures
- match, then a pointer to the pointer to a data structure of the type specified by
- TYPE is returned. If the signatures do not match, then DebugAssert() is called
- with a description of "CR has a bad signature" and Record is returned.
-
- If the data type specified by TYPE does not contain the field specified by Field,
- then the module will not compile.
-
- If TYPE does not contain a field called Signature, then the module will not
- compile.
-
- @param Record The pointer to the field specified by Field within a data
- structure of type TYPE.
-
- @param TYPE The name of the data structure type to return This
- data structure must contain the field specified by Field.
-
- @param Field The name of the field in the data structure specified
- by TYPE to which Record points.
-
- @param TestSignature The 32-bit signature value to match.
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define CR(Record, TYPE, Field, TestSignature) \
- (DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
- (TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
- BASE_CR (Record, TYPE, Field)
-#else
- #define CR(Record, TYPE, Field, TestSignature) \
- BASE_CR (Record, TYPE, Field)
-#endif
-
-#endif
diff --git a/Core/MdePkg/Include/Library/DebugPrintErrorLevelLib.h b/Core/MdePkg/Include/Library/DebugPrintErrorLevelLib.h
deleted file mode 100644
index 5a866d5fca..0000000000
--- a/Core/MdePkg/Include/Library/DebugPrintErrorLevelLib.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- Debug Print Error Level Library class
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#ifndef _DEBUG_PRINT_ERROR_LEVEL_LIB_H_
-#define _DEBUG_PRINT_ERROR_LEVEL_LIB_H_
-
-/**
- Returns the debug print error level mask for the current module.
-
- @return Debug print error level mask for the current module.
-
-**/
-UINT32
-EFIAPI
-GetDebugPrintErrorLevel (
- VOID
- );
-
-/**
- Sets the global debug print error level mask fpr the entire platform.
-
- @param ErrorLevel Global debug print error level
-
- @retval TRUE The debug print error level mask was successfully set.
- @retval FALSE The debug print error level mask could not be set.
-
-**/
-BOOLEAN
-EFIAPI
-SetDebugPrintErrorLevel (
- UINT32 ErrorLevel
- );
-#endif
diff --git a/Core/MdePkg/Include/Library/DevicePathLib.h b/Core/MdePkg/Include/Library/DevicePathLib.h
deleted file mode 100644
index 78aac35f81..0000000000
--- a/Core/MdePkg/Include/Library/DevicePathLib.h
+++ /dev/null
@@ -1,566 +0,0 @@
-/** @file
- Provides library functions to construct and parse UEFI Device Paths.
-
- This library provides defines, macros, and functions to help create and parse
- EFI_DEVICE_PATH_PROTOCOL structures.
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __DEVICE_PATH_LIB_H__
-#define __DEVICE_PATH_LIB_H__
-
-#define END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
-
-/**
- Determine whether a given device path is valid.
- If DevicePath is NULL, then ASSERT().
-
- @param DevicePath A pointer to a device path data structure.
- @param MaxSize The maximum size of the device path data structure.
-
- @retval TRUE DevicePath is valid.
- @retval FALSE The length of any node node in the DevicePath is less
- than sizeof (EFI_DEVICE_PATH_PROTOCOL).
- @retval FALSE If MaxSize is not zero, the size of the DevicePath
- exceeds MaxSize.
- @retval FALSE If PcdMaximumDevicePathNodeCount is not zero, the node
- count of the DevicePath exceeds PcdMaximumDevicePathNodeCount.
-**/
-BOOLEAN
-EFIAPI
-IsDevicePathValid (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN UINTN MaxSize
- );
-
-/**
- Returns the Type field of a device path node.
-
- Returns the Type field of the device path node specified by Node.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @return The Type field of the device path node specified by Node.
-
-**/
-UINT8
-EFIAPI
-DevicePathType (
- IN CONST VOID *Node
- );
-
-/**
- Returns the SubType field of a device path node.
-
- Returns the SubType field of the device path node specified by Node.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @return The SubType field of the device path node specified by Node.
-
-**/
-UINT8
-EFIAPI
-DevicePathSubType (
- IN CONST VOID *Node
- );
-
-/**
- Returns the 16-bit Length field of a device path node.
-
- Returns the 16-bit Length field of the device path node specified by Node.
- Node is not required to be aligned on a 16-bit boundary, so it is recommended
- that a function such as ReadUnaligned16() be used to extract the contents of
- the Length field.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @return The 16-bit Length field of the device path node specified by Node.
-
-**/
-UINTN
-EFIAPI
-DevicePathNodeLength (
- IN CONST VOID *Node
- );
-
-/**
- Returns a pointer to the next node in a device path.
-
- Returns a pointer to the device path node that follows the device path node specified by Node.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @return a pointer to the device path node that follows the device path node specified by Node.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-NextDevicePathNode (
- IN CONST VOID *Node
- );
-
-/**
- Determines if a device path node is an end node of a device path.
- This includes nodes that are the end of a device path instance and nodes that
- are the end of an entire device path.
-
- Determines if the device path node specified by Node is an end node of a device path.
- This includes nodes that are the end of a device path instance and nodes that are the
- end of an entire device path. If Node represents an end node of a device path,
- then TRUE is returned. Otherwise, FALSE is returned.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @retval TRUE The device path node specified by Node is an end node of a device path.
- @retval FALSE The device path node specified by Node is not an end node of a device path.
-
-**/
-BOOLEAN
-EFIAPI
-IsDevicePathEndType (
- IN CONST VOID *Node
- );
-
-/**
- Determines if a device path node is an end node of an entire device path.
-
- Determines if a device path node specified by Node is an end node of an entire device path.
- If Node represents the end of an entire device path, then TRUE is returned.
- Otherwise, FALSE is returned.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @retval TRUE The device path node specified by Node is the end of an entire device path.
- @retval FALSE The device path node specified by Node is not the end of an entire device path.
-
-**/
-BOOLEAN
-EFIAPI
-IsDevicePathEnd (
- IN CONST VOID *Node
- );
-
-/**
- Determines if a device path node is an end node of a device path instance.
-
- Determines if a device path node specified by Node is an end node of a device path instance.
- If Node represents the end of a device path instance, then TRUE is returned.
- Otherwise, FALSE is returned.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
- @retval TRUE The device path node specified by Node is the end of a device path instance.
- @retval FALSE The device path node specified by Node is not the end of a device path instance.
-
-**/
-BOOLEAN
-EFIAPI
-IsDevicePathEndInstance (
- IN CONST VOID *Node
- );
-
-/**
- Sets the length, in bytes, of a device path node.
-
- Sets the length of the device path node specified by Node to the value specified
- by NodeLength. NodeLength is returned. Node is not required to be aligned on
- a 16-bit boundary, so it is recommended that a function such as WriteUnaligned16()
- be used to set the contents of the Length field.
-
- If Node is NULL, then ASSERT().
- If NodeLength >= 0x10000, then ASSERT().
- If NodeLength < sizeof (EFI_DEVICE_PATH_PROTOCOL), then ASSERT().
-
- @param Node A pointer to a device path node data structure.
- @param Length The length, in bytes, of the device path node.
-
- @return Length
-
-**/
-UINT16
-EFIAPI
-SetDevicePathNodeLength (
- IN OUT VOID *Node,
- IN UINTN Length
- );
-
-/**
- Fills in all the fields of a device path node that is the end of an entire device path.
-
- Fills in all the fields of a device path node specified by Node so Node represents
- the end of an entire device path. The Type field of Node is set to
- END_DEVICE_PATH_TYPE, the SubType field of Node is set to
- END_ENTIRE_DEVICE_PATH_SUBTYPE, and the Length field of Node is set to
- END_DEVICE_PATH_LENGTH. Node is not required to be aligned on a 16-bit boundary,
- so it is recommended that a function such as WriteUnaligned16() be used to set
- the contents of the Length field.
-
- If Node is NULL, then ASSERT().
-
- @param Node A pointer to a device path node data structure.
-
-**/
-VOID
-EFIAPI
-SetDevicePathEndNode (
- OUT VOID *Node
- );
-
-/**
- Returns the size of a device path in bytes.
-
- This function returns the size, in bytes, of the device path data structure
- specified by DevicePath including the end of device path node.
- If DevicePath is NULL or invalid, then 0 is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @retval 0 If DevicePath is NULL or invalid.
- @retval Others The size of a device path in bytes.
-
-**/
-UINTN
-EFIAPI
-GetDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Creates a new copy of an existing device path.
-
- This function allocates space for a new copy of the device path specified by DevicePath. If
- DevicePath is NULL, then NULL is returned. If the memory is successfully allocated, then the
- contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer
- is returned. Otherwise, NULL is returned.
- The memory for the new device path is allocated from EFI boot services memory.
- It is the responsibility of the caller to free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
-
- @retval NULL DevicePath is NULL or invalid.
- @retval Others A pointer to the duplicated device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-DuplicateDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Creates a new device path by appending a second device path to a first device path.
-
- This function creates a new device path by appending a copy of SecondDevicePath to a copy of
- FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from
- SecondDevicePath is retained. The newly created device path is returned.
- If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.
- If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.
- If both FirstDevicePath and SecondDevicePath are NULL, then a copy of an end-of-device-path is
- returned.
- If there is not enough memory for the newly allocated buffer, then NULL is returned.
- The memory for the new device path is allocated from EFI boot services memory. It is the
- responsibility of the caller to free the memory allocated.
-
- @param FirstDevicePath A pointer to a device path data structure.
- @param SecondDevicePath A pointer to a device path data structure.
-
- @retval NULL If there is not enough memory for the newly allocated buffer.
- @retval NULL If FirstDevicePath or SecondDevicePath is invalid.
- @retval Others A pointer to the new device path if success.
- Or a copy an end-of-device-path if both FirstDevicePath and SecondDevicePath are NULL.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-AppendDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL
- );
-
-/**
- Creates a new path by appending the device node to the device path.
-
- This function creates a new device path by appending a copy of the device node specified by
- DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.
- The end-of-device-path device node is moved after the end of the appended device node.
- If DevicePathNode is NULL then a copy of DevicePath is returned.
- If DevicePath is NULL then a copy of DevicePathNode, followed by an end-of-device path device
- node is returned.
- If both DevicePathNode and DevicePath are NULL then a copy of an end-of-device-path device node
- is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
- @param DevicePathNode A pointer to a single device path node.
-
- @retval NULL There is not enough memory for the new device path.
- @retval Others A pointer to the new device path if success.
- A copy of DevicePathNode followed by an end-of-device-path node
- if both FirstDevicePath and SecondDevicePath are NULL.
- A copy of an end-of-device-path node if both FirstDevicePath and SecondDevicePath are NULL.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-AppendDevicePathNode (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL
- );
-
-/**
- Creates a new device path by appending the specified device path instance to the specified device
- path.
-
- This function creates a new device path by appending a copy of the device path instance specified
- by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.
- The end-of-device-path device node is moved after the end of the appended device path instance
- and a new end-of-device-path-instance node is inserted between.
- If DevicePath is NULL, then a copy if DevicePathInstance is returned.
- If DevicePathInstance is NULL, then NULL is returned.
- If DevicePath or DevicePathInstance is invalid, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
- @param DevicePathInstance A pointer to a device path instance.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-AppendDevicePathInstance (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL
- );
-
-/**
- Creates a copy of the current device path instance and returns a pointer to the next device path
- instance.
-
- This function creates a copy of the current device path instance. It also updates DevicePath to
- point to the next device path instance in the device path (or NULL if no more) and updates Size
- to hold the size of the device path instance copy.
- If DevicePath is NULL, then NULL is returned.
- If DevicePath points to a invalid device path, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
- If Size is NULL, then ASSERT().
-
- @param DevicePath 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 pointer to a device path data
- structure.
- @param Size On output, this holds the size of the device path instance, in
- bytes or zero, if DevicePath is NULL.
-
- @return A pointer to the current device path instance.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GetNextDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- );
-
-/**
- Creates a device node.
-
- This function creates a new device node in a newly allocated buffer of size NodeLength and
- initializes the device path node header with NodeType and NodeSubType. The new device path node
- is returned.
- If NodeLength is smaller than a device path header, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param NodeType The device node type for the new device node.
- @param NodeSubType The device node sub-type for the new device node.
- @param NodeLength The length of the new device node.
-
- @return The new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-CreateDeviceNode (
- IN UINT8 NodeType,
- IN UINT8 NodeSubType,
- IN UINT16 NodeLength
- );
-
-/**
- Determines if a device path is single or multi-instance.
-
- This function returns TRUE if the device path specified by DevicePath is multi-instance.
- Otherwise, FALSE is returned.
- If DevicePath is NULL or invalid, then FALSE is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @retval TRUE DevicePath is multi-instance.
- @retval FALSE DevicePath is not multi-instance, or DevicePath is NULL or invalid.
-
-**/
-BOOLEAN
-EFIAPI
-IsDevicePathMultiInstance (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Retrieves the device path protocol from a handle.
-
- This function returns the device path protocol from the handle specified by Handle. If Handle is
- NULL or Handle does not contain a device path protocol, then NULL is returned.
-
- @param Handle The handle from which to retrieve the device path protocol.
-
- @return The device path protocol from the handle specified by Handle.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-DevicePathFromHandle (
- IN EFI_HANDLE Handle
- );
-
-/**
- Allocates a device path for a file and appends it to an existing device path.
-
- If Device is a valid device handle that contains a device path protocol, then a device path for
- the file specified by FileName is allocated and appended to the device path associated with the
- handle Device. The allocated device path is returned. If Device is NULL or Device is a handle
- that does not support the device path protocol, then a device path containing a single device
- path node for the file specified by FileName is allocated and returned.
- The memory for the new device path is allocated from EFI boot services memory. It is the responsibility
- of the caller to free the memory allocated.
-
- If FileName is NULL, then ASSERT().
- If FileName is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Device A pointer to a device handle. This parameter is optional and
- may be NULL.
- @param FileName A pointer to a Null-terminated Unicode string.
-
- @return The allocated device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-FileDevicePath (
- IN EFI_HANDLE Device, OPTIONAL
- IN CONST CHAR16 *FileName
- );
-
-/**
- Converts a device path to its text representation.
-
- @param DevicePath A Pointer to the device to be converted.
- @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
- of the display node is used, where applicable. If DisplayOnly
- is FALSE, then the longer text representation of the display node
- is used.
- @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
- representation for a device node can be used, where applicable.
-
- @return A pointer to the allocated text representation of the device path or
- NULL if DeviceNode is NULL or there was insufficient memory.
-
-**/
-CHAR16 *
-EFIAPI
-ConvertDevicePathToText (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN BOOLEAN DisplayOnly,
- IN BOOLEAN AllowShortcuts
- );
-
-/**
- Converts a device node to its string representation.
-
- @param DeviceNode A Pointer to the device node to be converted.
- @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
- of the display node is used, where applicable. If DisplayOnly
- is FALSE, then the longer text representation of the display node
- is used.
- @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
- representation for a device node can be used, where applicable.
-
- @return A pointer to the allocated text representation of the device node or NULL if DeviceNode
- is NULL or there was insufficient memory.
-
-**/
-CHAR16 *
-EFIAPI
-ConvertDeviceNodeToText (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
- IN BOOLEAN DisplayOnly,
- IN BOOLEAN AllowShortcuts
- );
-
-/**
- Convert text to the binary representation of a device node.
-
- @param TextDeviceNode TextDeviceNode points to the text representation of a device
- node. Conversion starts with the first character and continues
- until the first non-device node character.
-
- @return A pointer to the EFI device node or NULL if TextDeviceNode is NULL or there was
- insufficient memory or text unsupported.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-ConvertTextToDeviceNode (
- IN CONST CHAR16 *TextDeviceNode
- );
-
-/**
- Convert text to the binary representation of a device path.
-
- @param TextDevicePath TextDevicePath points to the text representation of a device
- path. Conversion starts with the first character and continues
- until the first non-device node character.
-
- @return A pointer to the allocated device path or NULL if TextDeviceNode is NULL or
- there was insufficient memory.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-ConvertTextToDevicePath (
- IN CONST CHAR16 *TextDevicePath
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/DxeCoreEntryPoint.h b/Core/MdePkg/Include/Library/DxeCoreEntryPoint.h
deleted file mode 100644
index acf514a616..0000000000
--- a/Core/MdePkg/Include/Library/DxeCoreEntryPoint.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/** @file
- Module entry point library for DXE core.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MODULE_ENTRY_POINT_H__
-#define __MODULE_ENTRY_POINT_H__
-
-///
-/// Global variable that contains a pointer to the Hob List passed into the DXE Core entry point.
-///
-extern VOID *gHobList;
-
-
-/**
- The entry point of PE/COFF Image for the DXE Core.
-
- This function is the entry point for the DXE Core. This function is required to call
- ProcessModuleEntryPointList() and ProcessModuleEntryPointList() is never expected to return.
- The DXE Core is responsible for calling ProcessLibraryConstructorList() as soon as the EFI
- System Table and the image handle for the DXE Core itself have been established.
- If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
-
- @param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
-
-**/
-VOID
-EFIAPI
-_ModuleEntryPoint (
- IN VOID *HobStart
- );
-
-
-/**
- Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
-
- This function is required to call _ModuleEntryPoint() passing in HobStart.
-
- @param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
-
-**/
-VOID
-EFIAPI
-EfiMain (
- IN VOID *HobStart
- );
-
-
-/**
- Autogenerated function that calls the library constructors for all of the module's dependent libraries.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of library constructors for the set of library instances
- that a module depends on. This includes library instances that a module depends on
- directly and library instances that a module depends on indirectly through other
- libraries. This function is autogenerated by build tools and those build tools are
- responsible for collecting the set of library instances, determine which ones have
- constructors, and calling the library constructors in the proper order based upon
- each of the library instances own dependencies.
-
- @param ImageHandle The image handle of the DXE Core.
- @param SystemTable A pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Autogenerated function that calls a set of module entry points.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of module entry points.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the module entry points and calling them in a specified order.
-
- @param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
-
-**/
-VOID
-EFIAPI
-ProcessModuleEntryPointList (
- IN VOID *HobStart
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/DxeServicesLib.h b/Core/MdePkg/Include/Library/DxeServicesLib.h
deleted file mode 100644
index 7c1c62236d..0000000000
--- a/Core/MdePkg/Include/Library/DxeServicesLib.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/** @file
- MDE DXE Services Library provides functions that simplify the development of DXE Drivers.
- These functions help access data from sections of FFS files or from file path.
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __DXE_SERVICES_LIB_H__
-#define __DXE_SERVICES_LIB_H__
-
-/**
- Searches all the available firmware volumes and returns the first matching FFS section.
-
- This function searches all the firmware volumes for FFS files with FV file type specified by FileType
- The order that the firmware volumes is searched is not deterministic. For each available FV a search
- is made for FFS file of type FileType. If the FV contains more than one FFS file with the same FileType,
- the FileInstance instance will be the matched FFS file. For each FFS file found a search
- is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances
- of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.
- Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.
- It is the caller's responsibility to use FreePool() to free the allocated buffer.
- See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections
- are retrieved from an FFS file based on SectionType and SectionInstance.
-
- If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
- the search will be retried with a section type of EFI_SECTION_PE32.
- This function must be called with a TPL <= TPL_NOTIFY.
-
- If Buffer is NULL, then ASSERT().
- If Size is NULL, then ASSERT().
-
- @param FileType Indicates the FV file type to search for within all available FVs.
- @param FileInstance Indicates which file instance within all available FVs specified by FileType.
- FileInstance starts from zero.
- @param SectionType Indicates the FFS section type to search for within the FFS file
- specified by FileType with FileInstance.
- @param SectionInstance Indicates which section instance within the FFS file
- specified by FileType with FileInstance to retrieve. SectionInstance starts from zero.
- @param Buffer On output, a pointer to a callee allocated buffer containing the FFS file section that was found.
- Is it the caller's responsibility to free this buffer using FreePool().
- @param Size On output, a pointer to the size, in bytes, of Buffer.
-
- @retval EFI_SUCCESS The specified FFS section was returned.
- @retval EFI_NOT_FOUND The specified FFS section could not be found.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve the matching FFS section.
- @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a device error.
- @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the firmware volume that
- contains the matching FFS section does not allow reads.
-**/
-EFI_STATUS
-EFIAPI
-GetSectionFromAnyFvByFileType (
- IN EFI_FV_FILETYPE FileType,
- IN UINTN FileInstance,
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN SectionInstance,
- OUT VOID **Buffer,
- OUT UINTN *Size
- );
-
-/**
- Searches all the available firmware volumes and returns the first matching FFS section.
-
- This function searches all the firmware volumes for FFS files with an FFS filename specified by NameGuid.
- The order in which the firmware volumes are searched is not deterministic. For each FFS file found, a search
- is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances
- of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.
- Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.
- It is the caller's responsibility to use FreePool() to free the allocated buffer.
- See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections
- are retrieved from an FFS file based on SectionType and SectionInstance.
-
- If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
- the search will be retried with a section type of EFI_SECTION_PE32.
- This function must be called with a TPL <= TPL_NOTIFY.
-
- If NameGuid is NULL, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If Size is NULL, then ASSERT().
-
-
- @param NameGuid A pointer to to the FFS filename GUID to search for
- within any of the firmware volumes in the platform.
- @param SectionType Indicates the FFS section type to search for within
- the FFS file specified by NameGuid.
- @param SectionInstance Indicates which section instance within the FFS file
- specified by NameGuid to retrieve.
- @param Buffer On output, a pointer to a callee-allocated buffer
- containing the FFS file section that was found.
- It is the caller's responsibility to free this
- buffer using FreePool().
- @param Size On output, a pointer to the size, in bytes, of Buffer.
-
- @retval EFI_SUCCESS The specified FFS section was returned.
- @retval EFI_NOT_FOUND The specified FFS section could not be found.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve
- the matching FFS section.
- @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
- device error.
- @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
- firmware volume that contains the matching FFS
- section does not allow reads.
-**/
-EFI_STATUS
-EFIAPI
-GetSectionFromAnyFv (
- IN CONST EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN SectionInstance,
- OUT VOID **Buffer,
- OUT UINTN *Size
- );
-
-/**
- Searches the firmware volume that the currently executing module was loaded from and returns the first matching FFS section.
-
- This function searches the firmware volume that the currently executing module was loaded
- from for an FFS file with an FFS filename specified by NameGuid. If the FFS file is found, a search
- is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance
- instances of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.
- Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.
- It is the caller's responsibility to use FreePool() to free the allocated buffer.
- See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections are retrieved from
- an FFS file based on SectionType and SectionInstance.
-
- If the currently executing module was not loaded from a firmware volume, then EFI_NOT_FOUND is returned.
- If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
- the search will be retried with a section type of EFI_SECTION_PE32.
-
- This function must be called with a TPL <= TPL_NOTIFY.
- If NameGuid is NULL, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If Size is NULL, then ASSERT().
-
- @param NameGuid A pointer to to the FFS filename GUID to search for
- within the firmware volumes that the currently
- executing module was loaded from.
- @param SectionType Indicates the FFS section type to search for within
- the FFS file specified by NameGuid.
- @param SectionInstance Indicates which section instance within the FFS
- file specified by NameGuid to retrieve.
- @param Buffer On output, a pointer to a callee allocated buffer
- containing the FFS file section that was found.
- It is the caller's responsibility to free this buffer
- using FreePool().
- @param Size On output, a pointer to the size, in bytes, of Buffer.
-
-
- @retval EFI_SUCCESS The specified FFS section was returned.
- @retval EFI_NOT_FOUND The specified FFS section could not be found.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve
- the matching FFS section.
- @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
- device error.
- @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
- firmware volume that contains the matching FFS
- section does not allow reads.
-**/
-EFI_STATUS
-EFIAPI
-GetSectionFromFv (
- IN CONST EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN SectionInstance,
- OUT VOID **Buffer,
- OUT UINTN *Size
- );
-
-
-/**
- Searches the FFS file the the currently executing module was loaded from and returns the first matching FFS section.
-
- This function searches the FFS file that the currently executing module was loaded from for a FFS sections of type SectionType.
- If the FFS file contains at least SectionInstance instances of the FFS section specified by SectionType,
- then the SectionInstance instance is returned in Buffer. Buffer is allocated using AllocatePool(),
- and the size of the allocated buffer is returned in Size. It is the caller's responsibility
- to use FreePool() to free the allocated buffer. See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for
- details on how sections are retrieved from an FFS file based on SectionType and SectionInstance.
-
- If the currently executing module was not loaded from an FFS file, then EFI_NOT_FOUND is returned.
- If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
- the search will be retried with a section type of EFI_SECTION_PE32.
- This function must be called with a TPL <= TPL_NOTIFY.
-
- If Buffer is NULL, then ASSERT().
- If Size is NULL, then ASSERT().
-
-
- @param SectionType Indicates the FFS section type to search for within
- the FFS file that the currently executing module
- was loaded from.
- @param SectionInstance Indicates which section instance to retrieve within
- the FFS file that the currently executing module
- was loaded from.
- @param Buffer On output, a pointer to a callee allocated buffer
- containing the FFS file section that was found.
- It is the caller's responsibility to free this buffer
- using FreePool().
- @param Size On output, a pointer to the size, in bytes, of Buffer.
-
- @retval EFI_SUCCESS The specified FFS section was returned.
- @retval EFI_NOT_FOUND The specified FFS section could not be found.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve
- the matching FFS section.
- @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
- device error.
- @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
- firmware volume that contains the matching FFS
- section does not allow reads.
-
-**/
-EFI_STATUS
-EFIAPI
-GetSectionFromFfs (
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN SectionInstance,
- OUT VOID **Buffer,
- OUT UINTN *Size
- );
-
-
-/**
- Get the image file buffer data and buffer size by its device path.
-
- Access the file either from a firmware volume, from a file system interface,
- or from the load file interface.
-
- Allocate memory to store the found image. The caller is responsible to free memory.
-
- If FilePath is NULL, then NULL is returned.
- If FileSize is NULL, then NULL is returned.
- If AuthenticationStatus is NULL, then NULL is returned.
-
- @param[in] BootPolicy The policy for Open Image File.If TRUE,
- indicates that the request originates from
- the boot manager, and that the boot manager is
- attempting to load FilePath as a boot selection.
- If FALSE, then FilePath must match an exact
- file to be loaded.
- @param[in] FilePath Pointer to the device path of the file that is abstracted to
- the file buffer.
- @param[out] FileSize Pointer to the size of the abstracted file buffer.
- @param[out] AuthenticationStatus Pointer to the authentication status.
-
- @retval NULL FilePath is NULL, or FileSize is NULL, or AuthenticationStatus is NULL, or the file can't be found.
- @retval other The abstracted file buffer. The caller is responsible to free memory.
-**/
-VOID *
-EFIAPI
-GetFileBufferByFilePath (
- IN BOOLEAN BootPolicy,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FilePath,
- OUT UINTN *FileSize,
- OUT UINT32 *AuthenticationStatus
- );
-
-/**
- Searches all the available firmware volumes and returns the file device path of first matching
- FFS section.
-
- This function searches all the firmware volumes for FFS files with an FFS filename specified by NameGuid.
- The order that the firmware volumes is searched is not deterministic. For each FFS file found a search
- is made for FFS sections of type SectionType.
-
- If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
- the search will be retried with a section type of EFI_SECTION_PE32.
- This function must be called with a TPL <= TPL_NOTIFY.
-
- If NameGuid is NULL, then ASSERT().
-
- @param NameGuid A pointer to to the FFS filename GUID to search for
- within any of the firmware volumes in the platform.
- @param SectionType Indicates the FFS section type to search for within
- the FFS file specified by NameGuid.
- @param SectionInstance Indicates which section instance within the FFS file
- specified by NameGuid to retrieve.
- @param FvFileDevicePath Device path for the target FFS
- file.
-
- @retval EFI_SUCCESS The specified file device path of FFS section was returned.
- @retval EFI_NOT_FOUND The specified file device path of FFS section could not be found.
- @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
- device error.
- @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
- firmware volume that contains the matching FFS section does not
- allow reads.
- @retval EFI_INVALID_PARAMETER FvFileDevicePath is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-GetFileDevicePathFromAnyFv (
- IN CONST EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN SectionInstance,
- OUT EFI_DEVICE_PATH_PROTOCOL **FvFileDevicePath
- );
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/DxeServicesTableLib.h b/Core/MdePkg/Include/Library/DxeServicesTableLib.h
deleted file mode 100644
index ff13d3fcaa..0000000000
--- a/Core/MdePkg/Include/Library/DxeServicesTableLib.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/** @file
- Provides a service to retrieve a pointer to the DXE Services Table.
- Only available to DXE module types.
-
- This library does not contain any functions or macros. It simply exports a global
- pointer to the DXE Services Table as defined in the Platform Initialization Driver
- Execution Environment Core Interface Specification. The library constructor must
- initialize this global pointer to the DX Services Table, so it is available at the
- module's entry point. Since there is overhead in looking up the pointer to the DXE
- Services Table, only those modules that actually require access to the DXE Services
- Table should use this library. This will typically be DXE Drivers that require GCD
- or Dispatcher services.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __DXE_SERVICES_TABLE_LIB_H__
-#define __DXE_SERVICES_TABLE_LIB_H__
-
-///
-/// Cache copy of the DXE Services Table
-///
-extern EFI_DXE_SERVICES *gDS;
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/ExtendedSalLib.h b/Core/MdePkg/Include/Library/ExtendedSalLib.h
deleted file mode 100644
index 6f28eeb7f6..0000000000
--- a/Core/MdePkg/Include/Library/ExtendedSalLib.h
+++ /dev/null
@@ -1,494 +0,0 @@
-/** @file
- Library class definition of Extended SAL Library.
-
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EXTENDED_SAL_LIB_H__
-#define _EXTENDED_SAL_LIB_H__
-
-#include <IndustryStandard/Sal.h>
-
-/**
- Register ESAL Class and its associated global.
-
- This function Registers one or more Extended SAL services in a given
- class along with the associated global context.
- This function is only available prior to ExitBootServices().
-
- @param ClassGuidLo GUID of function class, lower 64-bits
- @param ClassGuidHi GUID of function class, upper 64-bits
- @param ModuleGlobal Module global for Function.
- @param ... List of Function/FunctionId pairs, ended by NULL
-
- @retval EFI_SUCCESS The Extended SAL services were registered.
- @retval EFI_UNSUPPORTED This function was called after ExitBootServices().
- @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services.
- @retval Other ClassGuid could not be installed onto a new handle.
-
-**/
-EFI_STATUS
-EFIAPI
-RegisterEsalClass (
- IN CONST UINT64 ClassGuidLo,
- IN CONST UINT64 ClassGuidHi,
- IN VOID *ModuleGlobal, OPTIONAL
- ...
- );
-
-/**
- Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
-
- This function calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
-
- @param ClassGuidLo GUID of function, lower 64-bits
- @param ClassGuidHi GUID of function, upper 64-bits
- @param FunctionId Function in ClassGuid to call
- @param Arg2 Argument 2 ClassGuid/FunctionId defined
- @param Arg3 Argument 3 ClassGuid/FunctionId defined
- @param Arg4 Argument 4 ClassGuid/FunctionId defined
- @param Arg5 Argument 5 ClassGuid/FunctionId defined
- @param Arg6 Argument 6 ClassGuid/FunctionId defined
- @param Arg7 Argument 7 ClassGuid/FunctionId defined
- @param Arg8 Argument 8 ClassGuid/FunctionId defined
-
- @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be determined
- for the current CPU execution mode.
- @retval Other See the return status from ExtendedSalProc() in the
- EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalCall (
- IN UINT64 ClassGuidLo,
- IN UINT64 ClassGuidHi,
- IN UINT64 FunctionId,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- );
-
-/**
- Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
-
- This function is a wrapper for the EsalStallFunctionId service of Extended SAL
- Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
-
- @param Microseconds The number of microseconds to delay.
-
- @retval EFI_SAL_SUCCESS Call completed without error.
- @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
- @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalStall (
- IN UINTN Microseconds
- );
-
-/**
- Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
-
- This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
- PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
-
- @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
- If FALSE, then PalEntryPoint is a virtual address.
- @param PalEntryPoint The PAL Entry Point being set.
-
- @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
- @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
- virtual mappings for the specified Extended SAL
- Procedure are available.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalSetNewPalEntry (
- IN BOOLEAN PhysicalAddress,
- IN UINT64 PalEntryPoint
- );
-
-/**
- Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
-
- This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
- PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
-
- @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
- If FALSE, then PalEntryPoint is a virtual address.
-
- @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
- SAL_RETURN_REGS.r9.
- @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
- virtual mappings for the specified Extended SAL
- Procedure are available.
- @return r9 PAL entry point retrieved.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetNewPalEntry (
- IN BOOLEAN PhysicalAddress
- );
-
-/**
- Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
-
- This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
- MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
-
- @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
- @param McaBuffer A pointer to the base address of the returned buffer.
- Copied from SAL_RETURN_REGS.r9.
- @param BufferSize A pointer to the size, in bytes, of the returned buffer.
- Copied from SAL_RETURN_REGS.r10.
-
- @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
- @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
- @return r9 Base address of the returned buffer
- @return r10 Size of the returned buffer in bytes
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetStateBuffer (
- IN UINT64 McaType,
- OUT UINT8 **McaBuffer,
- OUT UINTN *BufferSize
- );
-
-/**
- Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
-
- This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
- MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
-
- @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
-
- @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalSaveStateBuffer (
- IN UINT64 McaType
- );
-
-/**
- Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
-
- This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
- Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
-
- @param VectorType The vector type to retrieve.
- 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
-
- @retval EFI_SAL_SUCCESS Call completed without error.
- @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
- @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
- with the SAL Procedure SAL_SET_VECTORS.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetVectors (
- IN UINT64 VectorType
- );
-
-/**
- Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
-
- This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
- Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
-
- @param ParamInfoType The parameter type to retrieve.
- 1 - rendezvous interrupt
- 2 - wake up
- 3 - Corrected Platform Error Vector.
-
- @retval EFI_SAL_SUCCESS Call completed without error.
- @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
- @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
- with the SAL Procedure SAL_MC_SET_PARAMS.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalMcGetParams (
- IN UINT64 ParamInfoType
- );
-
-/**
- Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
-
- This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
- Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
-
- @retval EFI_SAL_SUCCESS Call completed without error.
- @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
- with the SAL Procedure SAL_MC_SET_PARAMS.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalMcGetMcParams (
- VOID
- );
-
-/**
- Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
-
- This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
- Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
-
- @param CpuIndex The index of the CPU of set of enabled CPUs to check.
-
- @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetMcCheckinFlags (
- IN UINT64 CpuIndex
- );
-
-/**
- Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
- MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU being added.
- @param Enabled The enable flag for the CPU being added.
- TRUE means the CPU is enabled.
- FALSE means the CPU is disabled.
- @param PalCompatibility The PAL Compatibility value for the CPU being added.
-
- @retval EFI_SAL_SUCCESS The CPU was added to the database.
- @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalAddCpuData (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN Enabled,
- IN UINT64 PalCompatibility
- );
-
-/**
- Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
- MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU being removed.
-
- @retval EFI_SAL_SUCCESS The CPU was removed from the database.
- @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalRemoveCpuData (
- IN UINT64 CpuGlobalId
- );
-
-/**
- Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
- MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU being modified.
- @param Enabled The enable flag for the CPU being modified.
- TRUE means the CPU is enabled.
- FALSE means the CPU is disabled.
- @param PalCompatibility The PAL Compatibility value for the CPU being modified.
-
- @retval EFI_SAL_SUCCESS The CPU database was updated.
- @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalModifyCpuData (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN Enabled,
- IN UINT64 PalCompatibility
- );
-
-/**
- Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
- MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU being looked up.
- @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
- If FALSE, then the index of set of all CPUs of database is returned.
-
- @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
- @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetCpuDataById (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN IndexByEnabledCpu
- );
-
-/**
- Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
- MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
-
- @param Index The Global ID for the CPU being modified.
- @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
- If FALSE, then the index of set of all CPUs of database is returned.
-
- @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
- @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetCpuDataByIndex (
- IN UINT64 Index,
- IN BOOLEAN IndexByEnabledCpu
- );
-
-/**
- Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
- MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
-
- @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
- If FALSE, then the index of set of all CPUs of database is returned.
-
- @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
- @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalWhoAmI (
- IN BOOLEAN IndexByEnabledCpu
- );
-
-/**
- Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalNumProcessors service of Extended SAL
- MP Services Class. See EsalNumProcessors of Extended SAL Specification.
-
- @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
- was returned.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalNumProcessors (
- VOID
- );
-
-/**
- Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
- MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
- @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
- specified by CpuGlobalId.
-
- @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
- @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalSetMinState (
- IN UINT64 CpuGlobalId,
- IN EFI_PHYSICAL_ADDRESS MinStatePointer
- );
-
-/**
- Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
-
- This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
- MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
-
- @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
- @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalGetMinState (
- IN UINT64 CpuGlobalId
- );
-
-/**
- Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
-
- This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
- MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
- @param StateBufferPointer A pointer to the returned MCA state buffer.
- @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
-
- @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
- @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalMcaGetStateInfo (
- IN UINT64 CpuGlobalId,
- OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer,
- OUT UINT64 *RequiredStateBufferSize
- );
-
-/**
- Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
-
- This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
- MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
-
- @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
- @param StateBufferPointer A pointer to the MCA state buffer.
-
- @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
- @retval EFI_SUCCESS Save the processor's state info successfully
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-EsalMcaRegisterCpu (
- IN UINT64 CpuGlobalId,
- IN EFI_PHYSICAL_ADDRESS StateBufferPointer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/ExtractGuidedSectionLib.h b/Core/MdePkg/Include/Library/ExtractGuidedSectionLib.h
deleted file mode 100644
index 539b98d41a..0000000000
--- a/Core/MdePkg/Include/Library/ExtractGuidedSectionLib.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/** @file
- This library provides common functions to process the different guided section data.
-
- This library provides functions to process GUIDed sections of FFS files. Handlers may
- be registered to decode GUIDed sections of FFS files. Services are provided to determine
- the set of supported section GUIDs, collection information about a specific GUIDed section,
- and decode a specific GUIDed section.
-
- A library instance that produces this library class may be used to produce a
- EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI or a EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
- providing a simple method to extend the number of GUIDed sections types a platform supports.
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#ifndef __EXTRACT_GUIDED_SECTION_H__
-#define __EXTRACT_GUIDED_SECTION_H__
-
-/**
- Examines a GUIDed section and returns the size of the decoded buffer and the
- size of an optional scratch buffer required to actually decode the data in a GUIDed section.
-
- Examines a GUIDed section specified by InputSection.
- If GUID for InputSection does not match the GUID that this handler supports,
- then RETURN_UNSUPPORTED is returned.
- If the required information can not be retrieved from InputSection,
- then RETURN_INVALID_PARAMETER is returned.
- If the GUID of InputSection does match the GUID that this handler supports,
- then the size required to hold the decoded buffer is returned in OututBufferSize,
- the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field
- from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.
-
- If InputSection is NULL, then ASSERT().
- If OutputBufferSize is NULL, then ASSERT().
- If ScratchBufferSize is NULL, then ASSERT().
- If SectionAttribute is NULL, then ASSERT().
-
-
- @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
- @param[out] OutputBufferSize A pointer to the size, in bytes, of an output buffer required
- if the buffer specified by InputSection were decoded.
- @param[out] ScratchBufferSize A pointer to the size, in bytes, required as scratch space
- if the buffer specified by InputSection were decoded.
- @param[out] SectionAttribute A pointer to the attributes of the GUIDed section. See the Attributes
- field of EFI_GUID_DEFINED_SECTION in the PI Specification.
-
- @retval RETURN_SUCCESS The information about InputSection was returned.
- @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
- @retval RETURN_INVALID_PARAMETER The information can not be retrieved from the section specified by InputSection.
-
-**/
-typedef
-RETURN_STATUS
-(EFIAPI *EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER)(
- IN CONST VOID *InputSection,
- OUT UINT32 *OutputBufferSize,
- OUT UINT32 *ScratchBufferSize,
- OUT UINT16 *SectionAttribute
- );
-
-/**
- Decodes a GUIDed section into a caller allocated output buffer.
-
- Decodes the GUIDed section specified by InputSection.
- If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned.
- If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.
- If the GUID of InputSection does match the GUID that this handler supports, then InputSection
- is decoded into the buffer specified by OutputBuffer and the authentication status of this
- decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the
- data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise,
- the decoded data will be placed in caller allocated buffer specified by OutputBuffer.
-
- If InputSection is NULL, then ASSERT().
- If OutputBuffer is NULL, then ASSERT().
- If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().
- If AuthenticationStatus is NULL, then ASSERT().
-
-
- @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
- @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.
- @param[out] ScratchBuffer A caller allocated buffer that may be required by this function
- as a scratch buffer to perform the decode operation.
- @param[out] AuthenticationStatus
- A pointer to the authentication status of the decoded output buffer.
- See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
- section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must
- never be set by this handler.
-
- @retval RETURN_SUCCESS The buffer specified by InputSection was decoded.
- @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
- @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded.
-
-**/
-typedef
-RETURN_STATUS
-(EFIAPI *EXTRACT_GUIDED_SECTION_DECODE_HANDLER)(
- IN CONST VOID *InputSection,
- OUT VOID **OutputBuffer,
- IN VOID *ScratchBuffer, OPTIONAL
- OUT UINT32 *AuthenticationStatus
- );
-
-/**
- Registers handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and EXTRACT_GUIDED_SECTION_DECODE_HANDLER
- for a specific GUID section type.
-
- Registers the handlers specified by GetInfoHandler and DecodeHandler with the GUID specified by SectionGuid.
- If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED.
- If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned.
-
- If SectionGuid is NULL, then ASSERT().
- If GetInfoHandler is NULL, then ASSERT().
- If DecodeHandler is NULL, then ASSERT().
-
- @param[in] SectionGuid A pointer to the GUID associated with the the handlers
- of the GUIDed section type being registered.
- @param[in] GetInfoHandler Pointer to a function that examines a GUIDed section and returns the
- size of the decoded buffer and the size of an optional scratch buffer
- required to actually decode the data in a GUIDed section.
- @param[in] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller
- allocated output buffer.
-
- @retval RETURN_SUCCESS The handlers were registered.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to register the handlers.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionRegisterHandlers (
- IN CONST GUID *SectionGuid,
- IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER GetInfoHandler,
- IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler
- );
-
-/**
- Retrieve the list GUIDs that have been registered through ExtractGuidedSectionRegisterHandlers().
-
- Sets ExtractHandlerGuidTable so it points at a callee allocated array of registered GUIDs.
- The total number of GUIDs in the array are returned. Since the array of GUIDs is callee allocated
- and caller must treat this array of GUIDs as read-only data.
- If ExtractHandlerGuidTable is NULL, then ASSERT().
-
- @param[out] ExtractHandlerGuidTable A pointer to the array of GUIDs that have been registered through
- ExtractGuidedSectionRegisterHandlers().
-
- @return the number of the supported extract guided Handler.
-
-**/
-UINTN
-EFIAPI
-ExtractGuidedSectionGetGuidList (
- OUT GUID **ExtractHandlerGuidTable
- );
-
-/**
- Retrieves a GUID from a GUIDed section and uses that GUID to select an associated handler of type
- EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers().
- The selected handler is used to retrieve and return the size of the decoded buffer and the size of an
- optional scratch buffer required to actually decode the data in a GUIDed section.
-
- Examines a GUIDed section specified by InputSection.
- If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(),
- then RETURN_UNSUPPORTED is returned.
- If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler
- of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers()
- is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of
- type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned.
-
- If InputSection is NULL, then ASSERT().
- If OutputBufferSize is NULL, then ASSERT().
- If ScratchBufferSize is NULL, then ASSERT().
- If SectionAttribute is NULL, then ASSERT().
-
- @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
- @param[out] OutputBufferSize A pointer to the size, in bytes, of an output buffer required if the buffer
- specified by InputSection were decoded.
- @param[out] ScratchBufferSize A pointer to the size, in bytes, required as scratch space if the buffer specified by
- InputSection were decoded.
- @param[out] SectionAttribute A pointer to the attributes of the GUIDed section. See the Attributes field of
- EFI_GUID_DEFINED_SECTION in the PI Specification.
-
- @retval RETURN_SUCCESS Get the required information successfully.
- @retval RETURN_UNSUPPORTED The GUID from the section specified by InputSection does not match any of
- the GUIDs registered with ExtractGuidedSectionRegisterHandlers().
- @retval Others The return status from the handler associated with the GUID retrieved from
- the section specified by InputSection.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionGetInfo (
- IN CONST VOID *InputSection,
- OUT UINT32 *OutputBufferSize,
- OUT UINT32 *ScratchBufferSize,
- OUT UINT16 *SectionAttribute
- );
-
-/**
- Retrieves the GUID from a GUIDed section and uses that GUID to select an associated handler of type
- EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers().
- The selected handler is used to decode the data in a GUIDed section and return the result in a caller
- allocated output buffer.
-
- Decodes the GUIDed section specified by InputSection.
- If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(),
- then RETURN_UNSUPPORTED is returned.
- If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler
- of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers()
- is used to decode InputSection into the buffer specified by OutputBuffer and the authentication status of this
- decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the data in InputSection,
- then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in caller
- allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE
- bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned.
-
- If InputSection is NULL, then ASSERT().
- If OutputBuffer is NULL, then ASSERT().
- If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().
- If AuthenticationStatus is NULL, then ASSERT().
-
- @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
- @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.
- @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation.
- @param[out] AuthenticationStatus
- A pointer to the authentication status of the decoded output buffer. See the definition
- of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI section of the PI
- Specification.
-
- @retval RETURN_SUCCESS The buffer specified by InputSection was decoded.
- @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
- @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionDecode (
- IN CONST VOID *InputSection,
- OUT VOID **OutputBuffer,
- IN VOID *ScratchBuffer, OPTIONAL
- OUT UINT32 *AuthenticationStatus
- );
-
-/**
- Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and
- EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type.
-
- Retrieves the handlers associated with SectionGuid and returns them in
- GetInfoHandler and DecodeHandler.
-
- If the GUID value specified by SectionGuid has not been registered, then
- return RETURN_NOT_FOUND.
-
- If SectionGuid is NULL, then ASSERT().
-
- @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed
- section type being retrieved.
- @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns
- the size of the decoded buffer and the size of an optional scratch
- buffer required to actually decode the data in a GUIDed section.
- This is an optional parameter that may be NULL. If it is NULL, then
- the previously registered handler is not returned.
- @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller
- allocated output buffer. This is an optional parameter that may be NULL.
- If it is NULL, then the previously registered handler is not returned.
-
- @retval RETURN_SUCCESS The handlers were retrieved.
- @retval RETURN_NOT_FOUND No handlers have been registered with the specified GUID.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionGetHandlers (
- IN CONST GUID *SectionGuid,
- OUT EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *GetInfoHandler, OPTIONAL
- OUT EXTRACT_GUIDED_SECTION_DECODE_HANDLER *DecodeHandler OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/FileHandleLib.h b/Core/MdePkg/Include/Library/FileHandleLib.h
deleted file mode 100644
index f3423d841c..0000000000
--- a/Core/MdePkg/Include/Library/FileHandleLib.h
+++ /dev/null
@@ -1,507 +0,0 @@
-/** @file
- Provides interface to EFI_FILE_HANDLE functionality.
-
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _FILE_HANDLE_LIBRARY_HEADER_
-#define _FILE_HANDLE_LIBRARY_HEADER_
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Guid/FileInfo.h>
-
-/// The tag for use in identifying UNICODE files.
-/// If the file is UNICODE, the first 16 bits of the file will equal this value.
-extern CONST UINT16 gUnicodeFileTag;
-
-/**
- This function retrieves information about the file for the handle
- specified and stores it in the allocated pool memory.
-
- This function allocates a buffer to store the file's information. It is the
- caller's responsibility to free the buffer.
-
- @param[in] FileHandle The file handle of the file for which information is
- being requested.
-
- @retval NULL Information could not be retrieved.
- @retval !NULL The information about the file.
-**/
-EFI_FILE_INFO*
-EFIAPI
-FileHandleGetInfo (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- This function sets the information about the file for the opened handle
- specified.
-
- @param[in] FileHandle The file handle of the file for which information
- is being set.
-
- @param[in] FileInfo The information to set.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.
- @retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetInfo (
- IN EFI_FILE_HANDLE FileHandle,
- IN CONST EFI_FILE_INFO *FileInfo
- );
-
-/**
- This function reads information from an opened file.
-
- If FileHandle is not a directory, the function reads the requested number of
- bytes from the file at the file's current position and returns them in Buffer.
- If the read goes beyond the end of the file, the read length is truncated to the
- end of the file. The file's current position is increased by the number of bytes
- returned. If FileHandle is a directory, the function reads the directory entry
- at the file's current position and returns the entry in Buffer. If the Buffer
- is not large enough to hold the current directory entry, then
- EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.
- BufferSize is set to be the size of the buffer needed to read the entry. On
- success, the current position is updated to the next directory entry. If there
- are no more directory entries, the read returns a zero-length buffer.
- EFI_FILE_INFO is the structure returned as the directory entry.
-
- @param[in] FileHandle The opened file handle.
- @param[in, out] BufferSize On input, the size of buffer in bytes. On return,
- the number of bytes written.
- @param[out] Buffer The buffer to put read data into.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required
- size.
-
-**/
-EFI_STATUS
-EFIAPI
-FileHandleRead(
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- );
-
-/**
- Write data to a file.
-
- This function writes the specified number of bytes to the file at the current
- file position. The current file position is advanced the actual number of bytes
- written, which is returned in BufferSize. Partial writes only occur when there
- has been a data error during the write attempt (such as "volume space full").
- The file is automatically grown to hold the data if required. Direct writes to
- opened directories are not supported.
-
- @param[in] FileHandle The opened file for writing.
- @param[in, out] BufferSize On input, the number of bytes in Buffer. On output,
- the number of bytes written.
- @param[in] Buffer The buffer containing data to write is stored.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to an open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleWrite(
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- );
-
-/**
- Close an open file handle.
-
- This function closes a specified file handle. All "dirty" cached file data is
- flushed to the device, and the file is closed. In all cases the handle is
- closed.
-
- @param[in] FileHandle The file handle to close.
-
- @retval EFI_SUCCESS The file handle was closed successfully.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleClose (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- Delete a file and close the handle.
-
- This function closes and deletes a file. In all cases the file handle is closed.
- If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
- returned, but the handle is still closed.
-
- @param[in] FileHandle The file handle to delete.
-
- @retval EFI_SUCCESS The file was closed successfully.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not
- deleted.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleDelete (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- Set the current position in a file.
-
- This function sets the current file position for the handle to the position
- supplied. With the exception of moving to position 0xFFFFFFFFFFFFFFFF, only
- absolute positioning is supported, and moving past the end of the file is
- allowed (a subsequent write would grow the file). Moving to position
- 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.
- If FileHandle is a directory, the only position that may be set is zero. This
- has the effect of starting the read process of the directory entries over again.
-
- @param[in] FileHandle The file handle on which the position is being set.
- @param[in] Position The byte position from the beginning of the file.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_UNSUPPORTED The request for non-zero is not valid on
- directories.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetPosition (
- IN EFI_FILE_HANDLE FileHandle,
- IN UINT64 Position
- );
-
-/**
- Gets a file's current position.
-
- This function retrieves the current file position for the file handle. For
- directories, the current file position has no meaning outside of the file
- system driver. As such, the operation is not supported. An error is returned
- if FileHandle is a directory.
-
- @param[in] FileHandle The open file handle on which to get the position.
- @param[out] Position The byte position from beginning of file.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED The request is not valid on directories.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetPosition (
- IN EFI_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- );
-/**
- Flushes data on a file.
-
- This function flushes all modified data associated with a file to a device.
-
- @param[in] FileHandle The file handle on which to flush data.
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFlush (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- Function to determine if a given handle is a directory handle.
-
- Open the file information on the DirHandle and verify that the Attribute
- includes EFI_FILE_DIRECTORY bit set.
-
- @param[in] DirHandle Handle to open file.
-
- @retval EFI_SUCCESS DirHandle is a directory.
- @retval EFI_INVALID_PARAMETER DirHandle is NULL.
- The file information returns from FileHandleGetInfo is NULL.
- @retval EFI_NOT_FOUND DirHandle is not a directory.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleIsDirectory (
- IN EFI_FILE_HANDLE DirHandle
- );
-
-/** Retrieve first entry from a directory.
-
- This function takes an open directory handle and gets information from the
- first entry in the directory. A buffer is allocated to contain
- the information and a pointer to the buffer is returned in *Buffer. The
- caller can use FileHandleFindNextFile() to get subsequent directory entries.
-
- The buffer will be freed by FileHandleFindNextFile() when the last directory
- entry is read. Otherwise, the caller must free the buffer, using FreePool,
- when finished with it.
-
- @param[in] DirHandle The file handle of the directory to search.
- @param[out] Buffer The pointer to pointer to buffer for file's information.
-
- @retval EFI_SUCCESS Found the first file.
- @retval EFI_NOT_FOUND Cannot find the directory.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @return Others The status of FileHandleGetInfo, FileHandleSetPosition,
- or FileHandleRead.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFindFirstFile (
- IN EFI_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO **Buffer
- );
-
-/** Retrieve next entries from a directory.
-
- To use this function, the caller must first call the FileHandleFindFirstFile()
- function to get the first directory entry. Subsequent directory entries are
- retrieved by using the FileHandleFindNextFile() function. This function can
- be called several times to get each entry from the directory. If the call of
- FileHandleFindNextFile() retrieved the last directory entry, the next call of
- this function will set *NoFile to TRUE and free the buffer.
-
- @param[in] DirHandle The file handle of the directory.
- @param[out] Buffer The pointer to buffer for file's information.
- @param[out] NoFile The pointer to boolean when last file is found.
-
- @retval EFI_SUCCESS Found the next file, or reached last file.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFindNextFile(
- IN EFI_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO *Buffer,
- OUT BOOLEAN *NoFile
- );
-
-/**
- Retrieve the size of a file.
-
- This function extracts the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param[in] FileHandle The file handle from which size is retrieved.
- @param[out] Size The pointer to size.
-
- @retval EFI_SUCCESS Operation was completed successfully.
- @retval EFI_DEVICE_ERROR Cannot access the file.
- @retval EFI_INVALID_PARAMETER FileHandle is NULL.
- Size is NULL.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetSize (
- IN EFI_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- );
-
-/**
- Set the size of a file.
-
- This function changes the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param[in] FileHandle The file handle whose size is to be changed.
- @param[in] Size The new size.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR Cannot access the file.
- @retval EFI_INVALID_PARAMETER FileHandle is NULL.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetSize (
- IN EFI_FILE_HANDLE FileHandle,
- IN UINT64 Size
- );
-
-/**
- Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the
- directory 'stack'. If the file is a directory, then append the '\' char at the
- end of name string. If it's not a directory, then the last '\' should not be
- added.
-
- @param[in] Handle Handle to the Directory or File to create path to.
- @param[out] FullFileName Pointer to pointer to generated full file name. It
- is the responsibility of the caller to free this memory
- with a call to FreePool().
- @retval EFI_SUCCESS The operation was successful and FullFileName is valid.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER FullFileName was NULL.
- @retval EFI_OUT_OF_MEMORY A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetFileName (
- IN CONST EFI_FILE_HANDLE Handle,
- OUT CHAR16 **FullFileName
- );
-
-/**
- Function to read a single line (up to but not including the \n) from a file.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
- The function will not return the \r and \n character in buffer. When an empty line is
- read a CHAR_NULL character will be returned in buffer.
-
- @param[in] Handle FileHandle to read from.
- @param[in, out] Buffer The pointer to buffer to read into.
- @param[in, out] Size The pointer to number of bytes in Buffer.
- @param[in] Truncate If the buffer is large enough, this has no effect.
- If the buffer is is too small and Truncate is TRUE,
- the line will be truncated.
- If the buffer is is too small and Truncate is FALSE,
- then no read will occur.
-
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @retval EFI_SUCCESS The operation was successful. The line is stored in
- Buffer.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER Size was NULL.
- @retval EFI_BUFFER_TOO_SMALL Size was not large enough to store the line.
- Size was updated to the minimum space required.
- @sa FileHandleRead
-**/
-EFI_STATUS
-EFIAPI
-FileHandleReadLine(
- IN EFI_FILE_HANDLE Handle,
- IN OUT CHAR16 *Buffer,
- IN OUT UINTN *Size,
- IN BOOLEAN Truncate,
- IN OUT BOOLEAN *Ascii
- );
-
-/**
- Function to read a single line from a file. The \n is not included in the returned
- buffer. The returned buffer must be callee freed.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle FileHandle to read from.
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @return The line of text from the file.
-
- @sa FileHandleReadLine
-**/
-CHAR16*
-EFIAPI
-FileHandleReturnLine(
- IN EFI_FILE_HANDLE Handle,
- IN OUT BOOLEAN *Ascii
- );
-
-/**
- Function to write a line of text to a file.
-
- If the file is a Unicode file (with UNICODE file tag) then write the unicode
- text.
- If the file is an ASCII file then write the ASCII text.
- If the size of file is zero (without file tag at the beginning) then write
- ASCII text as default.
-
- @param[in] Handle FileHandle to write to.
- @param[in] Buffer Buffer to write, if NULL the function will
- take no action and return EFI_SUCCESS.
-
- @retval EFI_SUCCESS The data was written.
- Buffer is NULL.
- @retval EFI_INVALID_PARAMETER Handle is NULL.
- @retval EFI_OUT_OF_RESOURCES Unable to allocate temporary space for ASCII
- string due to out of resources.
-
- @sa FileHandleWrite
-**/
-EFI_STATUS
-EFIAPI
-FileHandleWriteLine(
- IN EFI_FILE_HANDLE Handle,
- IN CHAR16 *Buffer
- );
-
-/**
- Function to take a formatted argument and print it to a file.
-
- @param[in] Handle The file handle for the file to write to.
- @param[in] Format The format argument (see printlib for the format specifier).
- @param[in] ... The variable arguments for the format.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval other A return value from FileHandleWriteLine.
-
- @sa FileHandleWriteLine
-**/
-EFI_STATUS
-EFIAPI
-FileHandlePrintLine(
- IN EFI_FILE_HANDLE Handle,
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Function to determine if a FILE_HANDLE is at the end of the file.
-
- This will NOT work on directories.
-
- If Handle is NULL, then ASSERT().
-
- @param[in] Handle The file handle.
-
- @retval TRUE The position is at the end of the file.
- @retval FALSE The position is not at the end of the file.
-**/
-BOOLEAN
-EFIAPI
-FileHandleEof(
- IN EFI_FILE_HANDLE Handle
- );
-
-#endif //_FILE_HANDLE_LIBRARY_HEADER_
-
diff --git a/Core/MdePkg/Include/Library/HobLib.h b/Core/MdePkg/Include/Library/HobLib.h
deleted file mode 100644
index fc48703826..0000000000
--- a/Core/MdePkg/Include/Library/HobLib.h
+++ /dev/null
@@ -1,534 +0,0 @@
-/** @file
- Provides services to create and parse HOBs. Only available for PEI
- and DXE module types.
-
- The HOB Library supports the efficient creation and searching of HOBs
- defined in the PI Specification.
- A HOB is a Hand-Off Block, defined in the Framework architecture, that
- allows the PEI phase to pass information to the DXE phase. HOBs are position
- independent and can be relocated easily to different memory memory locations.
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __HOB_LIB_H__
-#define __HOB_LIB_H__
-
-/**
- Returns the pointer to the HOB list.
-
- This function returns the pointer to first HOB in the list.
- For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer
- to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through
- the EFI System Table by looking up theHOB list GUID in the System Configuration Table.
- Since the System Configuration Table does not exist that the time the DXE Core is
- launched, the DXE Core uses a global variable from the DXE Core Entry Point Library
- to manage the pointer to the HOB list.
-
- If the pointer to the HOB list is NULL, then ASSERT().
-
- @return The pointer to the HOB list.
-
-**/
-VOID *
-EFIAPI
-GetHobList (
- VOID
- );
-
-/**
- Returns the next instance of a HOB type from the starting HOB.
-
- This function searches the first instance of a HOB type from the starting HOB pointer.
- If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
-
- If HobStart is NULL, then ASSERT().
-
- @param Type The HOB type to return.
- @param HobStart The starting HOB pointer to search from.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetNextHob (
- IN UINT16 Type,
- IN CONST VOID *HobStart
- );
-
-/**
- Returns the first instance of a HOB type among the whole HOB list.
-
- This function searches the first instance of a HOB type among the whole HOB list.
- If there does not exist such HOB type in the HOB list, it will return NULL.
-
- If the pointer to the HOB list is NULL, then ASSERT().
-
- @param Type The HOB type to return.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetFirstHob (
- IN UINT16 Type
- );
-
-/**
- Returns the next instance of the matched GUID HOB from the starting HOB.
-
- This function searches the first instance of a HOB from the starting HOB pointer.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
-
- If Guid is NULL, then ASSERT().
- If HobStart is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
- @param HobStart A pointer to a Guid.
-
- @return The next instance of the matched GUID HOB from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetNextGuidHob (
- IN CONST EFI_GUID *Guid,
- IN CONST VOID *HobStart
- );
-
-/**
- Returns the first instance of the matched GUID HOB among the whole HOB list.
-
- This function searches the first instance of a HOB among the whole HOB list.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
-
- If the pointer to the HOB list is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
-
- @return The first instance of the matched GUID HOB among the whole HOB list.
-
-**/
-VOID *
-EFIAPI
-GetFirstGuidHob (
- IN CONST EFI_GUID *Guid
- );
-
-/**
- Get the system boot mode from the HOB list.
-
- This function returns the system boot mode information from the
- PHIT HOB in HOB list.
-
- If the pointer to the HOB list is NULL, then ASSERT().
-
- @param VOID
-
- @return The Boot Mode.
-
-**/
-EFI_BOOT_MODE
-EFIAPI
-GetBootModeHob (
- VOID
- );
-
-/**
- Builds a HOB for a loaded PE32 module.
-
- This function builds a HOB for a loaded PE32 module.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If ModuleName is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ModuleName The GUID File Name of the module.
- @param MemoryAllocationModule The 64 bit physical address of the module.
- @param ModuleLength The length of the module in bytes.
- @param EntryPoint The 64 bit physical address of the module entry point.
-
-**/
-VOID
-EFIAPI
-BuildModuleHob (
- IN CONST EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- );
-
-/**
- Builds a HOB that describes a chunk of system memory with Owner GUID.
-
- This function builds a HOB that describes a chunk of system memory.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ResourceType The type of resource described by this HOB.
- @param ResourceAttribute The resource attributes of the memory described by this HOB.
- @param PhysicalStart The 64 bit physical address of memory described by this HOB.
- @param NumberOfBytes The length of the memory described by this HOB in bytes.
- @param OwnerGUID GUID for the owner of this resource.
-
-**/
-VOID
-EFIAPI
-BuildResourceDescriptorWithOwnerHob (
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes,
- IN EFI_GUID *OwnerGUID
- );
-
-/**
- Builds a HOB that describes a chunk of system memory.
-
- This function builds a HOB that describes a chunk of system memory.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ResourceType The type of resource described by this HOB.
- @param ResourceAttribute The resource attributes of the memory described by this HOB.
- @param PhysicalStart The 64 bit physical address of memory described by this HOB.
- @param NumberOfBytes The length of the memory described by this HOB in bytes.
-
-**/
-VOID
-EFIAPI
-BuildResourceDescriptorHob (
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- );
-
-/**
- Builds a customized HOB tagged with a GUID for identification and returns
- the start address of GUID HOB data.
-
- This function builds a customized HOB tagged with a GUID for identification
- and returns the start address of GUID HOB data so that caller can fill the customized data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If Guid is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
- HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.
-
- @param Guid The GUID to tag the customized HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidHob (
- IN CONST EFI_GUID *Guid,
- IN UINTN DataLength
- );
-
-/**
- Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB
- data field, and returns the start address of the GUID HOB data.
-
- This function builds a customized HOB tagged with a GUID for identification and copies the input
- data to the HOB data field and returns the start address of the GUID HOB data. It can only be
- invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If Guid is NULL, then ASSERT().
- If Data is NULL and DataLength > 0, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
- HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8.
-
- @param Guid The GUID to tag the customized HOB.
- @param Data The data to be copied into the data field of the GUID HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidDataHob (
- IN CONST EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- );
-
-/**
- Builds a Firmware Volume HOB.
-
- This function builds a Firmware Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
- If the FvImage buffer is not at its required alignment, then ASSERT().
-
- @param BaseAddress The base address of the Firmware Volume.
- @param Length The size of the Firmware Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- );
-
-/**
- Builds a EFI_HOB_TYPE_FV2 HOB.
-
- This function builds a EFI_HOB_TYPE_FV2 HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
- If the FvImage buffer is not at its required alignment, then ASSERT().
-
- @param BaseAddress The base address of the Firmware Volume.
- @param Length The size of the Firmware Volume in bytes.
- @param FvName The name of the Firmware Volume.
- @param FileName The name of the file.
-
-**/
-VOID
-EFIAPI
-BuildFv2Hob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN CONST EFI_GUID *FvName,
- IN CONST EFI_GUID *FileName
- );
-
-/**
- Builds a Capsule Volume HOB.
-
- This function builds a Capsule Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If the platform does not support Capsule Volume HOBs, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Capsule Volume.
- @param Length The size of the Capsule Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildCvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- );
-
-/**
- Builds a HOB for the CPU.
-
- This function builds a HOB for the CPU.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
-
- @param SizeOfMemorySpace The maximum physical memory addressability of the processor.
- @param SizeOfIoSpace The maximum physical I/O addressability of the processor.
-
-**/
-VOID
-EFIAPI
-BuildCpuHob (
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- );
-
-/**
- Builds a HOB for the Stack.
-
- This function builds a HOB for the stack.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the Stack.
- @param Length The length of the stack in bytes.
-
-**/
-VOID
-EFIAPI
-BuildStackHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- );
-
-/**
- Builds a HOB for the BSP store.
-
- This function builds a HOB for BSP store.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the BSP.
- @param Length The length of the BSP store in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-BuildBspStoreHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- );
-
-/**
- Builds a HOB for the memory allocation.
-
- This function builds a HOB for the memory allocation.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
-
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the memory.
- @param Length The length of the memory allocation in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-BuildMemoryAllocationHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- );
-
-/**
- Returns the type of a HOB.
-
- This macro returns the HobType field from the HOB header for the
- HOB specified by HobStart.
-
- @param HobStart A pointer to a HOB.
-
- @return HobType.
-
-**/
-#define GET_HOB_TYPE(HobStart) \
- ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobType)
-
-/**
- Returns the length, in bytes, of a HOB.
-
- This macro returns the HobLength field from the HOB header for the
- HOB specified by HobStart.
-
- @param HobStart A pointer to a HOB.
-
- @return HobLength.
-
-**/
-#define GET_HOB_LENGTH(HobStart) \
- ((*(EFI_HOB_GENERIC_HEADER **)&(HobStart))->HobLength)
-
-/**
- Returns a pointer to the next HOB in the HOB list.
-
- This macro returns a pointer to HOB that follows the
- HOB specified by HobStart in the HOB List.
-
- @param HobStart A pointer to a HOB.
-
- @return A pointer to the next HOB in the HOB list.
-
-**/
-#define GET_NEXT_HOB(HobStart) \
- (VOID *)(*(UINT8 **)&(HobStart) + GET_HOB_LENGTH (HobStart))
-
-/**
- Determines if a HOB is the last HOB in the HOB list.
-
- This macro determine if the HOB specified by HobStart is the
- last HOB in the HOB list. If HobStart is last HOB in the HOB list,
- then TRUE is returned. Otherwise, FALSE is returned.
-
- @param HobStart A pointer to a HOB.
-
- @retval TRUE The HOB specified by HobStart is the last HOB in the HOB list.
- @retval FALSE The HOB specified by HobStart is not the last HOB in the HOB list.
-
-**/
-#define END_OF_HOB_LIST(HobStart) (GET_HOB_TYPE (HobStart) == (UINT16)EFI_HOB_TYPE_END_OF_HOB_LIST)
-
-/**
- Returns a pointer to data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
-
- This macro returns a pointer to the data buffer in a HOB specified by HobStart.
- HobStart is assumed to be a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
-
- @param GuidHob A pointer to a HOB.
-
- @return A pointer to the data buffer in a HOB.
-
-**/
-#define GET_GUID_HOB_DATA(HobStart) \
- (VOID *)(*(UINT8 **)&(HobStart) + sizeof (EFI_HOB_GUID_TYPE))
-
-/**
- Returns the size of the data buffer from a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
-
- This macro returns the size, in bytes, of the data buffer in a HOB specified by HobStart.
- HobStart is assumed to be a HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
-
- @param GuidHob A pointer to a HOB.
-
- @return The size of the data buffer.
-**/
-#define GET_GUID_HOB_DATA_SIZE(HobStart) \
- (UINT16)(GET_HOB_LENGTH (HobStart) - sizeof (EFI_HOB_GUID_TYPE))
-
-#endif
diff --git a/Core/MdePkg/Include/Library/HstiLib.h b/Core/MdePkg/Include/Library/HstiLib.h
deleted file mode 100644
index 9af8817b75..0000000000
--- a/Core/MdePkg/Include/Library/HstiLib.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/** @file
- Provides services to create, get and update HSTI table in AIP protocol.
-
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __HSTI_LIB_H__
-#define __HSTI_LIB_H__
-
-/**
- Publish HSTI table in AIP protocol.
-
- One system should have only one PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE.
-
- If the Role is NOT PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE,
- SecurityFeaturesRequired field will be ignored.
-
- @param Hsti HSTI data
- @param HstiSize HSTI size
-
- @retval EFI_SUCCESS The HSTI data is published in AIP protocol.
- @retval EFI_ALREADY_STARTED There is already HSTI table with Role and ImplementationID published in system.
- @retval EFI_VOLUME_CORRUPTED The input HSTI data does not follow HSTI specification.
- @retval EFI_OUT_OF_RESOURCES There is not enough system resource to publish HSTI data in AIP protocol.
-**/
-EFI_STATUS
-EFIAPI
-HstiLibSetTable (
- IN VOID *Hsti,
- IN UINTN HstiSize
- );
-
-/**
- Search HSTI table in AIP protocol, and return the data.
- This API will return the HSTI table with indicated Role and ImplementationID,
- NULL ImplementationID means to find the first HSTI table with indicated Role.
-
- @param Role Role of HSTI data.
- @param ImplementationID ImplementationID of HSTI data.
- NULL means find the first one match Role.
- @param Hsti HSTI data. This buffer is allocated by callee, and it
- is the responsibility of the caller to free it after
- using it.
- @param HstiSize HSTI size
-
- @retval EFI_SUCCESS The HSTI data in AIP protocol is returned.
- @retval EFI_NOT_FOUND There is not HSTI table with the Role and ImplementationID published in system.
-**/
-EFI_STATUS
-EFIAPI
-HstiLibGetTable (
- IN UINT32 Role,
- IN CHAR16 *ImplementationID OPTIONAL,
- OUT VOID **Hsti,
- OUT UINTN *HstiSize
- );
-
-/**
- Set FeaturesVerified in published HSTI table.
- This API will update the HSTI table with indicated Role and ImplementationID,
- NULL ImplementationID means to find the first HSTI table with indicated Role.
-
- @param Role Role of HSTI data.
- @param ImplementationID ImplementationID of HSTI data.
- NULL means find the first one match Role.
- @param ByteIndex Byte index of FeaturesVerified of HSTI data.
- @param BitMask Bit mask of FeaturesVerified of HSTI data.
-
- @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.
- @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
- @retval EFI_UNSUPPORTED The ByteIndex is invalid.
-**/
-EFI_STATUS
-EFIAPI
-HstiLibSetFeaturesVerified (
- IN UINT32 Role,
- IN CHAR16 *ImplementationID, OPTIONAL
- IN UINT32 ByteIndex,
- IN UINT8 BitMask
- );
-
-/**
- Clear FeaturesVerified in published HSTI table.
- This API will update the HSTI table with indicated Role and ImplementationID,
- NULL ImplementationID means to find the first HSTI table with indicated Role.
-
- @param Role Role of HSTI data.
- @param ImplementationID ImplementationID of HSTI data.
- NULL means find the first one match Role.
- @param ByteIndex Byte index of FeaturesVerified of HSTI data.
- @param BitMask Bit mask of FeaturesVerified of HSTI data.
-
- @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.
- @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
- @retval EFI_UNSUPPORTED The ByteIndex is invalid.
-**/
-EFI_STATUS
-EFIAPI
-HstiLibClearFeaturesVerified (
- IN UINT32 Role,
- IN CHAR16 *ImplementationID, OPTIONAL
- IN UINT32 ByteIndex,
- IN UINT8 BitMask
- );
-
-/**
- Append ErrorString in published HSTI table.
- This API will update the HSTI table with indicated Role and ImplementationID,
- NULL ImplementationID means to find the first HSTI table with indicated Role.
-
- @param Role Role of HSTI data.
- @param ImplementationID ImplementationID of HSTI data.
- NULL means find the first one match Role.
- @param ErrorString ErrorString of HSTI data.
-
- @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.
- @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
- @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.
-**/
-EFI_STATUS
-EFIAPI
-HstiLibAppendErrorString (
- IN UINT32 Role,
- IN CHAR16 *ImplementationID, OPTIONAL
- IN CHAR16 *ErrorString
- );
-
-/**
- Set a new ErrorString in published HSTI table.
- This API will update the HSTI table with indicated Role and ImplementationID,
- NULL ImplementationID means to find the first HSTI table with indicated Role.
-
- @param Role Role of HSTI data.
- @param ImplementationID ImplementationID of HSTI data.
- NULL means find the first one match Role.
- @param ErrorString ErrorString of HSTI data.
-
- @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.
- @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
- @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.
-**/
-EFI_STATUS
-EFIAPI
-HstiLibSetErrorString (
- IN UINT32 Role,
- IN CHAR16 *ImplementationID, OPTIONAL
- IN CHAR16 *ErrorString
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/IoLib.h b/Core/MdePkg/Include/Library/IoLib.h
deleted file mode 100644
index b6df4c10b9..0000000000
--- a/Core/MdePkg/Include/Library/IoLib.h
+++ /dev/null
@@ -1,2815 +0,0 @@
-/** @file
- Provide services to access I/O Ports and MMIO registers.
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
-
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __IO_LIB_H__
-#define __IO_LIB_H__
-
-/**
- Macro that converts PCI Segment and I/O Port to an address that can be
- passed to the I/O Library functions.
-
- Computes an address that is compatible with the I/O Library functions.
- The unused upper bits of Segment, and Port are stripped prior to the
- generation of the address.
-
- @param Segment PCI Segment number. Range 0..65535.
- @param Port I/O Port number. Range 0..65535.
-
- @return An address that the I/o Library functions need.
-
-**/
-
-#define IO_LIB_ADDRESS(Segment,Port) \
- ( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- );
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- );
-
-/**
- Reads an 8-bit I/O port fifo into a block of memory.
-
- Reads the 8-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- );
-
-/**
- Writes a block of memory into an 8-bit I/O port fifo.
-
- Writes the 8-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise OR, and writes the
- result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoOr8 (
- IN UINTN Port,
- IN UINT8 OrData
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
- to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAnd8 (
- IN UINTN Port,
- IN UINT8 AndData
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAndThenOr8 (
- IN UINTN Port,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in an 8-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldRead8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldWrite8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAnd8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 8-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAndThenOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- );
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- );
-
-/**
- Reads a 16-bit I/O port fifo into a block of memory.
-
- Reads the 16-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- );
-
-/**
- Writes a block of memory into a 16-bit I/O port fifo.
-
- Writes the 16-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise OR, and writes the
- result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoOr16 (
- IN UINTN Port,
- IN UINT16 OrData
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
- to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAnd16 (
- IN UINTN Port,
- IN UINT16 AndData
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAndThenOr16 (
- IN UINTN Port,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 16-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldRead16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldWrite16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAnd16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 16-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAndThenOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- );
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- );
-
-/**
- Reads a 32-bit I/O port fifo into a block of memory.
-
- Reads the 32-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- );
-
-/**
- Writes a block of memory into a 32-bit I/O port fifo.
-
- Writes the 32-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise OR, and writes the
- result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoOr32 (
- IN UINTN Port,
- IN UINT32 OrData
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
- to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAnd32 (
- IN UINTN Port,
- IN UINT32 AndData
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAndThenOr32 (
- IN UINTN Port,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 32-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldRead32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldWrite32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAnd32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 32-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAndThenOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- );
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise OR, and writes the
- result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoOr64 (
- IN UINTN Port,
- IN UINT64 OrData
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
- to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAnd64 (
- IN UINTN Port,
- IN UINT64 AndData
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAndThenOr64 (
- IN UINTN Port,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 64-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldRead64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldWrite64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAnd64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAndThenOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
- @return Value.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 8-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in an 8-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 8-bit register is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 8-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
- @return Value.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 16-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 16-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 16-bit register is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 16-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
- @return Value.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 32-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 32-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 32-bit register is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 32-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- );
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioOr64 (
- IN UINTN Address,
- IN UINT64 OrData
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAnd64 (
- IN UINTN Address,
- IN UINT64 AndData
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 64-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAndThenOr64 (
- IN UINTN Address,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 64-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldRead64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 64-bit register is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldWrite64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAnd64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 64-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAndThenOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Copy data from MMIO region to system memory by using 8-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 8-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT8 *
-EFIAPI
-MmioReadBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT8 *Buffer
- );
-
-/**
- Copy data from MMIO region to system memory by using 16-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 16-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT16 *
-EFIAPI
-MmioReadBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT16 *Buffer
- );
-
-/**
- Copy data from MMIO region to system memory by using 32-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 32-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT32 *
-EFIAPI
-MmioReadBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT32 *Buffer
- );
-
-/**
- Copy data from MMIO region to system memory by using 64-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 64-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT64 *
-EFIAPI
-MmioReadBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT64 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 8-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 8-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT8 *
-EFIAPI
-MmioWriteBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT8 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 16-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 16-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT16 *
-EFIAPI
-MmioWriteBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT16 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 32-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 32-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT32 *
-EFIAPI
-MmioWriteBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT32 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 64-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 64-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT64 *
-EFIAPI
-MmioWriteBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT64 *Buffer
- );
-
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/MemoryAllocationLib.h b/Core/MdePkg/Include/Library/MemoryAllocationLib.h
deleted file mode 100644
index 0df59e60a3..0000000000
--- a/Core/MdePkg/Include/Library/MemoryAllocationLib.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/** @file
- Provides services to allocate and free memory buffers of various memory types and alignments.
-
- The Memory Allocation Library abstracts various common memory allocation operations. This library
- allows code to be written in a phase-independent manner because the allocation of memory in PEI, DXE,
- and SMM (for example) is done via a different mechanism. Using a common library interface makes it
- much easier to port algorithms from phase to phase.
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MEMORY_ALLOCATION_LIB_H__
-#define __MEMORY_ALLOCATION_LIB_H__
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData.
-
- Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocatePages (
- IN UINTN Pages
- );
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData.
-
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePages (
- IN UINTN Pages
- );
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType.
-
- Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPages (
- IN UINTN Pages
- );
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the page allocation
- functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the page allocation services of the Memory
- Allocation Library. If it is not possible to free allocated pages, then this function will
- perform no actions.
-
- If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
- then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-FreePages (
- IN VOID *Buffer,
- IN UINTN Pages
- );
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
- returned. If there is not enough memory at the specified alignment remaining to satisfy the
- request, then NULL is returned.
-
- If Alignment is not a power of two and Alignment is not zero, then ASSERT().
- If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- );
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
- returned. If there is not enough memory at the specified alignment remaining to satisfy the
- request, then NULL is returned.
-
- If Alignment is not a power of two and Alignment is not zero, then ASSERT().
- If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePages (
- IN UINTN Pages,
- IN UINTN Alignment
- );
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
- returned. If there is not enough memory at the specified alignment remaining to satisfy the
- request, then NULL is returned.
-
- If Alignment is not a power of two and Alignment is not zero, then ASSERT().
- If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- );
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the aligned page
- allocation functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the aligned page allocation services of the Memory
- Allocation Library. If it is not possible to free allocated pages, then this function will
- perform no actions.
-
- If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
- Library, then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPages (
- IN VOID *Buffer,
- IN UINTN Pages
- );
-
-/**
- Allocates a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
- pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocatePool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates a buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateZeroPool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeZeroPool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates and zeros a buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedZeroPool (
- IN UINTN AllocationSize
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
-
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- );
-
-/**
- Reallocates a buffer of type EfiBootServicesData.
-
- Allocates and zeros the number bytes specified by NewSize from memory of type
- EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
- NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
- OldBuffer is freed. A pointer to the newly allocated buffer is returned.
- If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
- enough memory remaining to satisfy the request, then NULL is returned.
-
- If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
- is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
-
- @param OldSize The size, in bytes, of OldBuffer.
- @param NewSize The size, in bytes, of the buffer to reallocate.
- @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
- parameter that may be NULL.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-ReallocatePool (
- IN UINTN OldSize,
- IN UINTN NewSize,
- IN VOID *OldBuffer OPTIONAL
- );
-
-/**
- Reallocates a buffer of type EfiRuntimeServicesData.
-
- Allocates and zeros the number bytes specified by NewSize from memory of type
- EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
- NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
- OldBuffer is freed. A pointer to the newly allocated buffer is returned.
- If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
- enough memory remaining to satisfy the request, then NULL is returned.
-
- If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
- is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
-
- @param OldSize The size, in bytes, of OldBuffer.
- @param NewSize The size, in bytes, of the buffer to reallocate.
- @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
- parameter that may be NULL.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-ReallocateRuntimePool (
- IN UINTN OldSize,
- IN UINTN NewSize,
- IN VOID *OldBuffer OPTIONAL
- );
-
-/**
- Reallocates a buffer of type EfiReservedMemoryType.
-
- Allocates and zeros the number bytes specified by NewSize from memory of type
- EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and
- NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
- OldBuffer is freed. A pointer to the newly allocated buffer is returned.
- If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
- enough memory remaining to satisfy the request, then NULL is returned.
-
- If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
- is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
-
- @param OldSize The size, in bytes, of OldBuffer.
- @param NewSize The size, in bytes, of the buffer to reallocate.
- @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
- parameter that may be NULL.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-ReallocateReservedPool (
- IN UINTN OldSize,
- IN UINTN NewSize,
- IN VOID *OldBuffer OPTIONAL
- );
-
-/**
- Frees a buffer that was previously allocated with one of the pool allocation functions in the
- Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- pool allocation services of the Memory Allocation Library. If it is not possible to free pool
- resources, then this function will perform no actions.
-
- If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
- then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-FreePool (
- IN VOID *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/OrderedCollectionLib.h b/Core/MdePkg/Include/Library/OrderedCollectionLib.h
deleted file mode 100644
index fc45d6dab7..0000000000
--- a/Core/MdePkg/Include/Library/OrderedCollectionLib.h
+++ /dev/null
@@ -1,425 +0,0 @@
-/** @file
- An ordered collection library interface.
-
- The library class provides a set of APIs to manage an ordered collection of
- items.
-
- Copyright (C) 2014, Red Hat, Inc.
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License that accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef __ORDERED_COLLECTION_LIB__
-#define __ORDERED_COLLECTION_LIB__
-
-#include <Base.h>
-
-//
-// Opaque structure for a collection.
-//
-typedef struct ORDERED_COLLECTION ORDERED_COLLECTION;
-
-//
-// Opaque structure for collection entries.
-//
-// Collection entries do not take ownership of the associated user structures,
-// they only link them. This makes it easy to link the same user structure into
-// several collections. If reference counting is required, the caller is
-// responsible for implementing it, as part of the user structure.
-//
-// A pointer-to-ORDERED_COLLECTION_ENTRY is considered an "iterator". Multiple,
-// simultaneous iterations are supported.
-//
-typedef struct ORDERED_COLLECTION_ENTRY ORDERED_COLLECTION_ENTRY;
-
-//
-// Altering the key field of an in-collection user structure (ie. the portion
-// of the user structure that ORDERED_COLLECTION_USER_COMPARE and
-// ORDERED_COLLECTION_KEY_COMPARE, below, read) is not allowed in-place. The
-// caller is responsible for bracketing the key change with the deletion and
-// the reinsertion of the user structure, so that the changed key value is
-// reflected in the collection.
-//
-
-/**
- Comparator function type for two user structures.
-
- @param[in] UserStruct1 Pointer to the first user structure.
-
- @param[in] UserStruct2 Pointer to the second user structure.
-
- @retval <0 If UserStruct1 compares less than UserStruct2.
-
- @retval 0 If UserStruct1 compares equal to UserStruct2.
-
- @retval >0 If UserStruct1 compares greater than UserStruct2.
-**/
-typedef
-INTN
-(EFIAPI *ORDERED_COLLECTION_USER_COMPARE)(
- IN CONST VOID *UserStruct1,
- IN CONST VOID *UserStruct2
- );
-
-/**
- Compare a standalone key against a user structure containing an embedded key.
-
- @param[in] StandaloneKey Pointer to the bare key.
-
- @param[in] UserStruct Pointer to the user structure with the embedded
- key.
-
- @retval <0 If StandaloneKey compares less than UserStruct's key.
-
- @retval 0 If StandaloneKey compares equal to UserStruct's key.
-
- @retval >0 If StandaloneKey compares greater than UserStruct's key.
-**/
-typedef
-INTN
-(EFIAPI *ORDERED_COLLECTION_KEY_COMPARE)(
- IN CONST VOID *StandaloneKey,
- IN CONST VOID *UserStruct
- );
-
-
-//
-// Some functions below are read-only, while others are read-write. If any
-// write operation is expected to run concurrently with any other operation on
-// the same collection, then the caller is responsible for implementing locking
-// for the whole collection.
-//
-
-/**
- Retrieve the user structure linked by the specified collection entry.
-
- Read-only operation.
-
- @param[in] Entry Pointer to the collection entry whose associated user
- structure we want to retrieve. The caller is responsible
- for passing a non-NULL argument.
-
- @return Pointer to user structure linked by Entry.
-**/
-VOID *
-EFIAPI
-OrderedCollectionUserStruct (
- IN CONST ORDERED_COLLECTION_ENTRY *Entry
- );
-
-
-/**
- Allocate and initialize the ORDERED_COLLECTION structure.
-
- @param[in] UserStructCompare This caller-provided function will be used to
- order two user structures linked into the
- collection, during the insertion procedure.
-
- @param[in] KeyCompare This caller-provided function will be used to
- order the standalone search key against user
- structures linked into the collection, during
- the lookup procedure.
-
- @retval NULL If allocation failed.
-
- @return Pointer to the allocated, initialized ORDERED_COLLECTION
- structure, otherwise.
-**/
-ORDERED_COLLECTION *
-EFIAPI
-OrderedCollectionInit (
- IN ORDERED_COLLECTION_USER_COMPARE UserStructCompare,
- IN ORDERED_COLLECTION_KEY_COMPARE KeyCompare
- );
-
-
-/**
- Check whether the collection is empty (has no entries).
-
- Read-only operation.
-
- @param[in] Collection The collection to check for emptiness.
-
- @retval TRUE The collection is empty.
-
- @retval FALSE The collection is not empty.
-**/
-BOOLEAN
-EFIAPI
-OrderedCollectionIsEmpty (
- IN CONST ORDERED_COLLECTION *Collection
- );
-
-
-/**
- Uninitialize and release an empty ORDERED_COLLECTION structure.
-
- Read-write operation.
-
- It is the caller's responsibility to delete all entries from the collection
- before calling this function.
-
- @param[in] Collection The empty collection to uninitialize and release.
-**/
-VOID
-EFIAPI
-OrderedCollectionUninit (
- IN ORDERED_COLLECTION *Collection
- );
-
-
-/**
- Look up the collection entry that links the user structure that matches the
- specified standalone key.
-
- Read-only operation.
-
- @param[in] Collection The collection to search for StandaloneKey.
-
- @param[in] StandaloneKey The key to locate among the user structures linked
- into Collection. StandaloneKey will be passed to
- ORDERED_COLLECTION_KEY_COMPARE.
-
- @retval NULL StandaloneKey could not be found.
-
- @return The collection entry that links to the user structure matching
- StandaloneKey, otherwise.
-**/
-ORDERED_COLLECTION_ENTRY *
-EFIAPI
-OrderedCollectionFind (
- IN CONST ORDERED_COLLECTION *Collection,
- IN CONST VOID *StandaloneKey
- );
-
-
-/**
- Find the collection entry of the minimum user structure stored in the
- collection.
-
- Read-only operation.
-
- @param[in] Collection The collection to return the minimum entry of. The
- user structure linked by the minimum entry compares
- less than all other user structures in the collection.
-
- @retval NULL If Collection is empty.
-
- @return The collection entry that links the minimum user structure,
- otherwise.
-**/
-ORDERED_COLLECTION_ENTRY *
-EFIAPI
-OrderedCollectionMin (
- IN CONST ORDERED_COLLECTION *Collection
- );
-
-
-/**
- Find the collection entry of the maximum user structure stored in the
- collection.
-
- Read-only operation.
-
- @param[in] Collection The collection to return the maximum entry of. The
- user structure linked by the maximum entry compares
- greater than all other user structures in the
- collection.
-
- @retval NULL If Collection is empty.
-
- @return The collection entry that links the maximum user structure,
- otherwise.
-**/
-ORDERED_COLLECTION_ENTRY *
-EFIAPI
-OrderedCollectionMax (
- IN CONST ORDERED_COLLECTION *Collection
- );
-
-
-/**
- Get the collection entry of the least user structure that is greater than the
- one linked by Entry.
-
- Read-only operation.
-
- @param[in] Entry The entry to get the successor entry of.
-
- @retval NULL If Entry is NULL, or Entry is the maximum entry of its
- containing collection (ie. Entry has no successor entry).
-
- @return The collection entry linking the least user structure that is
- greater than the one linked by Entry, otherwise.
-**/
-ORDERED_COLLECTION_ENTRY *
-EFIAPI
-OrderedCollectionNext (
- IN CONST ORDERED_COLLECTION_ENTRY *Entry
- );
-
-
-/**
- Get the collection entry of the greatest user structure that is less than the
- one linked by Entry.
-
- Read-only operation.
-
- @param[in] Entry The entry to get the predecessor entry of.
-
- @retval NULL If Entry is NULL, or Entry is the minimum entry of its
- containing collection (ie. Entry has no predecessor entry).
-
- @return The collection entry linking the greatest user structure that
- is less than the one linked by Entry, otherwise.
-**/
-ORDERED_COLLECTION_ENTRY *
-EFIAPI
-OrderedCollectionPrev (
- IN CONST ORDERED_COLLECTION_ENTRY *Entry
- );
-
-
-/**
- Insert (link) a user structure into the collection, allocating a new
- collection entry.
-
- Read-write operation.
-
- @param[in,out] Collection The collection to insert UserStruct into.
-
- @param[out] Entry The meaning of this optional, output-only
- parameter depends on the return value of the
- function.
-
- When insertion is successful (RETURN_SUCCESS),
- Entry is set on output to the new collection entry
- that now links UserStruct.
-
- When insertion fails due to lack of memory
- (RETURN_OUT_OF_RESOURCES), Entry is not changed.
-
- When insertion fails due to key collision (ie.
- another user structure is already in the
- collection that compares equal to UserStruct),
- with return value RETURN_ALREADY_STARTED, then
- Entry is set on output to the entry that links the
- colliding user structure. This enables
- "find-or-insert" in one function call, or helps
- with later removal of the colliding element.
-
- @param[in] UserStruct The user structure to link into the collection.
- UserStruct is ordered against in-collection user
- structures with the
- ORDERED_COLLECTION_USER_COMPARE function.
-
- @retval RETURN_SUCCESS Insertion successful. A new collection entry
- has been allocated, linking UserStruct. The
- new collection entry is reported back in
- Entry (if the caller requested it).
-
- Existing ORDERED_COLLECTION_ENTRY pointers
- into Collection remain valid. For example,
- on-going iterations in the caller can
- continue with OrderedCollectionNext() /
- OrderedCollectionPrev(), and they will
- return the new entry at some point if user
- structure order dictates it.
-
- @retval RETURN_OUT_OF_RESOURCES The function failed to allocate memory for
- the new collection entry. The collection has
- not been changed. Existing
- ORDERED_COLLECTION_ENTRY pointers into
- Collection remain valid.
-
- @retval RETURN_ALREADY_STARTED A user structure has been found in the
- collection that compares equal to
- UserStruct. The entry linking the colliding
- user structure is reported back in Entry (if
- the caller requested it). The collection has
- not been changed. Existing
- ORDERED_COLLECTION_ENTRY pointers into
- Collection remain valid.
-**/
-RETURN_STATUS
-EFIAPI
-OrderedCollectionInsert (
- IN OUT ORDERED_COLLECTION *Collection,
- OUT ORDERED_COLLECTION_ENTRY **Entry OPTIONAL,
- IN VOID *UserStruct
- );
-
-
-/**
- Delete an entry from the collection, unlinking the associated user structure.
-
- Read-write operation.
-
- @param[in,out] Collection The collection to delete Entry from.
-
- @param[in] Entry The collection entry to delete from Collection.
- The caller is responsible for ensuring that Entry
- belongs to Collection, and that Entry is non-NULL
- and valid. Entry is typically an earlier return
- value, or output parameter, of:
-
- - OrderedCollectionFind(), for deleting an entry
- by user structure key,
-
- - OrderedCollectionMin() / OrderedCollectionMax(),
- for deleting the minimum / maximum entry,
-
- - OrderedCollectionNext() /
- OrderedCollectionPrev(), for deleting an entry
- found during an iteration,
-
- - OrderedCollectionInsert() with return value
- RETURN_ALREADY_STARTED, for deleting an entry
- whose linked user structure caused collision
- during insertion.
-
- Existing ORDERED_COLLECTION_ENTRY pointers (ie.
- iterators) *different* from Entry remain valid.
- For example:
-
- - OrderedCollectionNext() /
- OrderedCollectionPrev() iterations in the caller
- can be continued from Entry, if
- OrderedCollectionNext() or
- OrderedCollectionPrev() is called on Entry
- *before* OrderedCollectionDelete() is. That is,
- fetch the successor / predecessor entry first,
- then delete Entry.
-
- - On-going iterations in the caller that would
- have otherwise returned Entry at some point, as
- dictated by user structure order, will correctly
- reflect the absence of Entry after
- OrderedCollectionDelete() is called
- mid-iteration.
-
- @param[out] UserStruct If the caller provides this optional output-only
- parameter, then on output it is set to the user
- structure originally linked by Entry (which is now
- freed).
-
- This is a convenience that may save the caller a
- OrderedCollectionUserStruct() invocation before
- calling OrderedCollectionDelete(), in order to
- retrieve the user structure being unlinked.
-**/
-VOID
-EFIAPI
-OrderedCollectionDelete (
- IN OUT ORDERED_COLLECTION *Collection,
- IN ORDERED_COLLECTION_ENTRY *Entry,
- OUT VOID **UserStruct OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PalLib.h b/Core/MdePkg/Include/Library/PalLib.h
deleted file mode 100644
index 4458047231..0000000000
--- a/Core/MdePkg/Include/Library/PalLib.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- Provides library services to make PAL Calls.
-
- The PAL Library provides a service to make a PAL CALL. This service is identical
- in functionality to AsmPalCall() in the functions of the Base Library specific to Intel Itanium architecture.
- The only difference is that the PAL Entry Point is not passed in. Implementations
- of this library class must manage PAL Entry Point on their own. For example, a PEI
- implementation can use a PPI to lookup the PAL Entry Point, and a DXE implementation
- can contain a constructor to look up the PAL Entry Point from a HOB. This library class
- is only available on Intel Itanium-based platforms.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PAL_CALL_LIB_H__
-#define __PAL_CALL_LIB_H__
-
-#include <IndustryStandard/Pal.h>
-
-/**
- Makes a PAL procedure call.
-
- This is a wrapper function to make a PAL procedure call. Based on the Index value,
- this API will make static or stacked PAL call. Architected procedures may be designated
- as required or optional. If a PAL procedure is specified as optional, a unique return
- code of 0xFFFFFFFFFFFFFFFF is returned in the Status field of the PAL_CALL_RETURN structure.
- This indicates that the procedure is not present in this PAL implementation. It is the
- caller's responsibility to check for this return code after calling any optional PAL
- procedure. No parameter checking is performed on the 4 input parameters, but there are
- some common rules that the caller should follow when making a PAL call. Any address
- passed to PAL as buffers for return parameters must be 8-byte aligned. Unaligned addresses
- may cause undefined results. For those parameters defined as reserved or some fields
- defined as reserved must be zero filled or the invalid argument return value may be
- returned or undefined result may occur during the execution of the procedure.
- This function is only available on Intel Itanium-based platforms.
-
- @param Index The PAL procedure Index number.
- @param Arg2 The 2nd parameter for PAL procedure calls.
- @param Arg3 The 3rd parameter for PAL procedure calls.
- @param Arg4 The 4th parameter for PAL procedure calls.
-
- @return Structure returned from the PAL Call procedure, including the status and return value.
-
-**/
-PAL_CALL_RETURN
-EFIAPI
-PalCall (
- IN UINT64 Index,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- );
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/PcdLib.h b/Core/MdePkg/Include/Library/PcdLib.h
deleted file mode 100644
index 9e7e09f52c..0000000000
--- a/Core/MdePkg/Include/Library/PcdLib.h
+++ /dev/null
@@ -1,2260 +0,0 @@
-/** @file
- Provides library services to get and set Platform Configuration Database entries.
-
- PCD Library Class provides a PCD usage macro interface for all PCD types.
- It should be included in any module that uses PCD. If a module uses dynamic/dynamicex
- PCD, module should be linked to a PEIM/DXE library instance to access that PCD.
- If a module uses PatchableInModule type PCD, it also needs the library instance to produce
- LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is
- translated to a variable or macro that is auto-generated by build tool in
- module's autogen.h/autogen.c.
- The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are
- only available prior to ExitBootServices(). If access to PCD values are required
- at runtime, then their values must be collected prior to ExitBootServices().
- There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),
- PatchPcdGetXX(), and PatchPcdSetXX().
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PCD_LIB_H__
-#define __PCD_LIB_H__
-
-
-/**
- Retrieves a token number based on a token name.
-
- Returns the token number associated with the PCD token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve the token number for.
-
- @return The token number associated with the PCD.
-
-**/
-#define PcdToken(TokenName) _PCD_TOKEN_##TokenName
-
-
-/**
- Retrieves a Boolean PCD feature flag based on a token name.
-
- Returns the Boolean value for the PCD feature flag specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a feature flag PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return Boolean value for the PCD feature flag.
-
-**/
-#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName
-
-
-/**
- Retrieves an 8-bit fixed PCD token value based on a token name.
-
- Returns the 8-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a fixed at build PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 8-bit value for the token specified by TokenName.
-
-**/
-#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName
-
-
-/**
- Retrieves a 16-bit fixed PCD token value based on a token name.
-
- Returns the 16-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a fixed at build PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 16-bit value for the token specified by TokenName.
-
-**/
-#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName
-
-
-/**
- Retrieves a 32-bit fixed PCD token value based on a token name.
-
- Returns the 32-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a fixed at build PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 32-bit value for the token specified by TokenName.
-
-**/
-#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName
-
-
-/**
- Retrieves a 64-bit fixed PCD token value based on a token name.
-
- Returns the 64-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a fixed at build PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 64-bit value for the token specified by TokenName.
-
-**/
-#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName
-
-
-/**
- Retrieves a Boolean fixed PCD token value based on a token name.
-
- Returns the Boolean value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a fixed at build PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return The Boolean value for the token.
-
-**/
-#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName
-
-
-/**
- Retrieves a pointer to a fixed PCD token buffer based on a token name.
-
- Returns a pointer to the buffer for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a fixed at build PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A pointer to the buffer.
-
-**/
-#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)
-
-
-/**
- Retrieves an 8-bit binary patchable PCD token value based on a token name.
-
- Returns the 8-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return An 8-bit binary patchable PCD token value.
-
-**/
-#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName
-
-/**
- Retrieves a 16-bit binary patchable PCD token value based on a token name.
-
- Returns the 16-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A 16-bit binary patchable PCD token value.
-
-**/
-#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName
-
-
-/**
- Retrieves a 32-bit binary patchable PCD token value based on a token name.
-
- Returns the 32-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A 32-bit binary patchable PCD token value.
-
-**/
-#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName
-
-
-/**
- Retrieves a 64-bit binary patchable PCD token value based on a token name.
-
- Returns the 64-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A 64-bit binary patchable PCD token value.
-
-**/
-#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName
-
-
-/**
- Retrieves a Boolean binary patchable PCD token value based on a token name.
-
- Returns the Boolean value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return The Boolean value for the token.
-
-**/
-#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName
-
-
-/**
- Retrieves a pointer to a binary patchable PCD token buffer based on a token name.
-
- Returns a pointer to the buffer for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A pointer to the buffer for the token.
-
-**/
-#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)
-
-
-/**
- Sets an 8-bit binary patchable PCD token value based on a token name.
-
- Sets the 8-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the binary patchable PCD token to set the current value for.
- @param Value The 8-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
-
-
-/**
- Sets a 16-bit binary patchable PCD token value based on a token name.
-
- Sets the 16-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the binary patchable PCD token to set the current value for.
- @param Value The 16-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
-
-
-/**
- Sets a 32-bit binary patchable PCD token value based on a token name.
-
- Sets the 32-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the binary patchable PCD token to set the current value for.
- @param Value The 32-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
-
-
-/**
- Sets a 64-bit binary patchable PCD token value based on a token name.
-
- Sets the 64-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the binary patchable PCD token to set the current value for.
- @param Value The 64-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
-
-
-/**
- Sets a Boolean binary patchable PCD token value based on a token name.
-
- Sets the Boolean value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- @param TokenName The name of the binary patchable PCD token to set the current value for.
- @param Value The boolean value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
-
-
-/**
- Sets a pointer to a binary patchable PCD token buffer based on a token name.
-
- Sets the buffer for the token specified by TokenName. Buffer is returned.
- If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer
- to the maximum size supported by TokenName and return NULL to indicate that the set operation
- was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be
- set to the maximum size supported by TokenName and NULL must be returned.
- If TokenName is not a valid token in the token space, then the module will not build.
- If TokenName is not a patchable in module PCD, then the module will not build.
-
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param TokenName The name of the binary patchable PCD token to set the current value for.
- @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param Buffer Pointer to the value to set.
-
- @return Return the pointer to the Buffer that was set.
-
-**/
-#define PatchPcdSetPtr(TokenName, Size, Buffer) \
- LibPatchPcdSetPtrAndSize ( \
- (VOID *)_gPcd_BinaryPatch_##TokenName, \
- &_gPcd_BinaryPatch_Size_##TokenName, \
- (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
- (Size), \
- (Buffer) \
- )
-/**
- Retrieves an 8-bit PCD token value based on a token name.
-
- Returns the 8-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 8-bit value for the token specified by TokenName.
-
-**/
-#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName
-
-
-/**
- Retrieves a 16-bit PCD token value based on a token name.
-
- Returns the 16-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 16-bit value for the token specified by TokenName.
-
-**/
-#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName
-
-
-/**
- Retrieves a 32-bit PCD token value based on a token name.
-
- Returns the 32-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 32-bit value for the token specified by TokenName.
-
-**/
-#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName
-
-
-/**
- Retrieves a 64-bit PCD token value based on a token name.
-
- Returns the 64-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return 64-bit value for the token specified by TokenName.
-
-**/
-#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName
-
-
-/**
- Retrieves a pointer to a PCD token buffer based on a token name.
-
- Returns a pointer to the buffer for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A pointer to the buffer.
-
-**/
-#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName
-
-
-/**
- Retrieves a Boolean PCD token value based on a token name.
-
- Returns the Boolean value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A Boolean PCD token value.
-
-**/
-#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName
-
-
-/**
- Retrieves the size of a fixed PCD token based on a token name.
-
- Returns the size of the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param[in] TokenName The name of the PCD token to retrieve a current value size for.
-
- @return Return the size
-
-**/
-#define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName
-
-
-/**
- Retrieves the size of a binary patchable PCD token based on a token name.
-
- Returns the size of the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param[in] TokenName The name of the PCD token to retrieve a current value size for.
-
- @return Return the size
-
-**/
-#define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName
-
-
-/**
- Retrieves the size of the PCD token based on a token name.
-
- Returns the size of the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param[in] TokenName The name of the PCD token to retrieve a current value size for.
-
- @return Return the size
-
-**/
-#define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName
-
-
-/**
- Retrieve the size of a given PCD token.
-
- Returns the size of the token specified by TokenNumber and Guid.
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value size for.
-
- @return Return the size.
-
-**/
-#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-/**
- Sets an 8-bit PCD token value based on a token name.
-
- Sets the 8-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 8-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value))
-
-
-/**
- Sets a 16-bit PCD token value based on a token name.
-
- Sets the 16-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 16-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value))
-
-
-/**
- Sets a 32-bit PCD token value based on a token name.
-
- Sets the 32-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 32-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value))
-
-
-/**
- Sets a 64-bit PCD token value based on a token name.
-
- Sets the 64-bit value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 64-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value))
-
-
-/**
- Sets a pointer to a PCD token buffer based on a token name.
-
- Sets the buffer for the token specified by TokenName. Buffer is returned.
- If SizeOfBuffer is greater than the maximum size supported by TokenName,
- then set SizeOfBuffer to the maximum size supported by TokenName and return NULL
- to indicate that the set operation was not actually performed. If SizeOfBuffer
- is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported
- by TokenName and NULL must be returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param TokenName The name of the PCD token to set the current value for.
- @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param Buffer A pointer to the buffer to set.
-
- @return Return the pointer to the Buffer that was set.
-
-**/
-#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \
- _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer))
-
-/**
- Sets a Boolean PCD token value based on a token name.
-
- Sets the Boolean value for the token specified by TokenName. Value is returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to set the current value for.
- @param Buffer The Boolean value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value))
-#endif
-
-/**
- Sets a 8-bit PCD token value based on a token name.
-
- Sets the 8-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 8-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value))
-
-/**
- Sets a 16-bit PCD token value based on a token name.
-
- Sets the 16-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 16-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value))
-
-/**
- Sets a 32-bit PCD token value based on a token name.
-
- Sets the 32-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 32-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value))
-
-/**
- Sets a 64-bit PCD token value based on a token name.
-
- Sets the 64-bit value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The 64-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value))
-
-/**
- Sets a pointer to a PCD token buffer based on a token name.
-
- Sets the buffer for the token specified by TokenName.
- If SizeOfBuffer is greater than the maximum size supported by TokenName,
- then set SizeOfBuffer to the maximum size supported by TokenName and return
- RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size
- supported by TokenName and RETURN_INVALID_PARAMETER must be returned.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param TokenName The name of the PCD token to set the current value for.
- @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param Buffer A pointer to the buffer to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \
- _PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer))
-
-
-
-/**
- Sets a boolean PCD token value based on a token name.
-
- Sets the boolean value for the token specified by TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param TokenName The name of the PCD token to retrieve a current value for.
- @param Value The boolean value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value))
-
-/**
- Retrieves a token number based on a GUID and a token name.
-
- Returns the token number for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space, then the module will not build.
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return Return the token number.
-
-**/
-#define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid)
-
-/**
- Retrieves an 8-bit PCD token value based on a GUID and a token name.
-
- Returns the 8-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return An 8-bit PCD token value.
-
-**/
-#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
-
-/**
- Retrieves a 16-bit PCD token value based on a GUID and a token name.
-
- Returns the 16-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A 16-bit PCD token value.
-
-**/
-#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
-
-
-/**
- Retrieves a 32-bit PCD token value based on a GUID and a token name.
-
- Returns the 32-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A 32-bit PCD token value.
-
-**/
-#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
-
-
-/**
- Retrieves a 64-bit PCD token value based on a GUID and a token name.
-
- Returns the 64-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A 64-bit PCD token value.
-
-**/
-#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
-
-
-/**
- Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
-
- Returns a pointer to the buffer for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A pointer to a PCD token buffer.
-
-**/
-#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
-
-
-/**
- Retrieves a Boolean PCD token value based on a GUID and a token name.
-
- Returns the Boolean value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to retrieve a current value for.
-
- @return A Boolean PCD token value.
-
-**/
-#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))
-
-
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-/**
- Sets an 8-bit PCD token value based on a GUID and a token name.
-
- Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 8-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-
-/**
- Sets a 16-bit PCD token value based on a GUID and a token name.
-
- Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 16-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-
-/**
- Sets a 32-bit PCD token value based on a GUID and a token name.
-
- Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 32-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-
-/**
- Sets a 64-bit PCD token value based on a GUID and a token name.
-
- Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 64-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-
-/**
- Sets a pointer to a PCD token buffer based on a GUID and a token name.
-
- Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
- If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
- then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
- NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
- is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
- Guid and TokenName and NULL must be returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param Buffer Pointer to the buffer to set.
-
- @return Return the pointer to the Buffer that was set.
-
-**/
-#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
- LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
-
-
-/**
- Sets a Boolean PCD token value based on a GUID and a token name.
-
- Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The Boolean value to set.
-
- @return Return the Value that was set.
-
-**/
-#define PcdSetExBool(Guid, TokenName, Value) \
- LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))
-#endif
-
-/**
- Sets an 8-bit PCD token value based on a GUID and a token name.
-
- Sets the 8-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 8-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-/**
- Sets an 16-bit PCD token value based on a GUID and a token name.
-
- Sets the 16-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 16-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-/**
- Sets an 32-bit PCD token value based on a GUID and a token name.
-
- Sets the 32-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 32-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-/**
- Sets an 64-bit PCD token value based on a GUID and a token name.
-
- Sets the 64-bit value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The 64-bit value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-/**
- Sets a pointer to a PCD token buffer based on a GUID and a token name.
-
- Sets the buffer for the token specified by Guid and TokenName.
- If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
- then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
- RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size
- supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param Buffer Pointer to the buffer to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \
- LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
-
-
-/**
- Sets an boolean PCD token value based on a GUID and a token name.
-
- Sets the boolean value for the token specified by Guid and TokenName.
- If TokenName is not a valid token in the token space specified by Guid,
- then the module will not build.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param TokenName The name of the PCD token to set the current value for.
- @param Value The boolean value to set.
-
- @return The status of the set operation.
-
-**/
-#define PcdSetExBoolS(Guid, TokenName, Value) \
- LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value))
-
-/**
- This function provides a means by which SKU support can be established in the PCD infrastructure.
-
- Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
-
- @param SkuId The SKU value that will be used when the PCD service retrieves and sets values
- associated with a PCD token.
-
- @return Return the SKU ID that was set.
-
-**/
-UINTN
-EFIAPI
-LibPcdSetSku (
- IN UINTN SkuId
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 8-bit value for the token specified by TokenNumber.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the 8-bit value for the token specified by TokenNumber.
-
-**/
-UINT8
-EFIAPI
-LibPcdGet8 (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 16-bit value for the token specified by TokenNumber.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the 16-bit value for the token specified by TokenNumber.
-
-**/
-UINT16
-EFIAPI
-LibPcdGet16 (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 32-bit value for the token specified by TokenNumber.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the 32-bit value for the token specified by TokenNumber.
-
-**/
-UINT32
-EFIAPI
-LibPcdGet32 (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 64-bit value for the token specified by TokenNumber.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the 64-bit value for the token specified by TokenNumber.
-
-**/
-UINT64
-EFIAPI
-LibPcdGet64 (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the pointer to the buffer of the token specified by TokenNumber.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the pointer to the token specified by TokenNumber.
-
-**/
-VOID *
-EFIAPI
-LibPcdGetPtr (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the Boolean value of the token specified by TokenNumber.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the Boolean value of the token specified by TokenNumber.
-
-**/
-BOOLEAN
-EFIAPI
-LibPcdGetBool (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve the size of a given PCD token.
-
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Returns the size of the token specified by TokenNumber.
-
-**/
-UINTN
-EFIAPI
-LibPcdGetSize (
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 8-bit value for the token specified by TokenNumber and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the UINT8.
-
-**/
-UINT8
-EFIAPI
-LibPcdGetEx8 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 16-bit value for the token specified by TokenNumber and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the UINT16.
-
-**/
-UINT16
-EFIAPI
-LibPcdGetEx16 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-/**
- Returns the 32-bit value for the token specified by TokenNumber and Guid.
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the UINT32.
-
-**/
-UINT32
-EFIAPI
-LibPcdGetEx32 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the 64-bit value for the token specified by TokenNumber and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the UINT64.
-
-**/
-UINT64
-EFIAPI
-LibPcdGetEx64 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the pointer to the buffer of token specified by TokenNumber and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the VOID* pointer.
-
-**/
-VOID *
-EFIAPI
-LibPcdGetExPtr (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve a value for a given PCD token.
-
- Returns the Boolean value of the token specified by TokenNumber and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the BOOLEAN.
-
-**/
-BOOLEAN
-EFIAPI
-LibPcdGetExBool (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-/**
- This function provides a means by which to retrieve the size of a given PCD token.
-
- Returns the size of the token specified by TokenNumber and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates
- which namespace to retrieve a value from.
- @param[in] TokenNumber The PCD token number to retrieve a current value for.
-
- @return Return the size.
-
-**/
-UINTN
-EFIAPI
-LibPcdGetExSize (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber
- );
-
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 8-bit value for the token specified by TokenNumber
- to the value specified by Value. Value is returned.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 8-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT8
-EFIAPI
-LibPcdSet8 (
- IN UINTN TokenNumber,
- IN UINT8 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 16-bit value for the token specified by TokenNumber
- to the value specified by Value. Value is returned.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 16-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT16
-EFIAPI
-LibPcdSet16 (
- IN UINTN TokenNumber,
- IN UINT16 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 32-bit value for the token specified by TokenNumber
- to the value specified by Value. Value is returned.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 32-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT32
-EFIAPI
-LibPcdSet32 (
- IN UINTN TokenNumber,
- IN UINT32 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 64-bit value for the token specified by TokenNumber
- to the value specified by Value. Value is returned.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 64-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT64
-EFIAPI
-LibPcdSet64 (
- IN UINTN TokenNumber,
- IN UINT64 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets a buffer for the token specified by TokenNumber to the value
- specified by Buffer and SizeOfBuffer. Buffer is returned.
- If SizeOfBuffer is greater than the maximum size support by TokenNumber,
- then set SizeOfBuffer to the maximum size supported by TokenNumber and
- return NULL to indicate that the set operation was not actually performed.
-
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
- maximum size supported by TokenName and NULL must be returned.
-
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to set.
-
- @return Return the pointer for the Buffer that was set.
-
-**/
-VOID *
-EFIAPI
-LibPcdSetPtr (
- IN UINTN TokenNumber,
- IN OUT UINTN *SizeOfBuffer,
- IN CONST VOID *Buffer
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the Boolean value for the token specified by TokenNumber
- to the value specified by Value. Value is returned.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The boolean value to set.
-
- @return Return the Value that was set.
-
-**/
-BOOLEAN
-EFIAPI
-LibPcdSetBool (
- IN UINTN TokenNumber,
- IN BOOLEAN Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 8-bit value for the token specified by TokenNumber and
- Guid to the value specified by Value. Value is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 8-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT8
-EFIAPI
-LibPcdSetEx8 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT8 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 16-bit value for the token specified by TokenNumber and
- Guid to the value specified by Value. Value is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 16-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT16
-EFIAPI
-LibPcdSetEx16 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT16 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 32-bit value for the token specified by TokenNumber and
- Guid to the value specified by Value. Value is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 32-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT32
-EFIAPI
-LibPcdSetEx32 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT32 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 64-bit value for the token specified by TokenNumber and
- Guid to the value specified by Value. Value is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 64-bit value to set.
-
- @return Return the Value that was set.
-
-**/
-UINT64
-EFIAPI
-LibPcdSetEx64 (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT64 Value
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets a buffer for the token specified by TokenNumber to the value specified by
- Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
- the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
- supported by TokenNumber and return NULL to indicate that the set operation
- was not actually performed.
-
- If Guid is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to set.
-
- @return Return the pointer to the Buffer that was set.
-
-**/
-VOID *
-EFIAPI
-LibPcdSetExPtr (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN OUT UINTN *SizeOfBuffer,
- IN VOID *Buffer
- );
-
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the Boolean value for the token specified by TokenNumber and
- Guid to the value specified by Value. Value is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The Boolean value to set.
-
- @return Return the Value that was set.
-
-**/
-BOOLEAN
-EFIAPI
-LibPcdSetExBool (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN BOOLEAN Value
- );
-#endif
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 8-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 8-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSet8S (
- IN UINTN TokenNumber,
- IN UINT8 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 16-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 16-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSet16S (
- IN UINTN TokenNumber,
- IN UINT16 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 32-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 32-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSet32S (
- IN UINTN TokenNumber,
- IN UINT32 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 64-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 64-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSet64S (
- IN UINTN TokenNumber,
- IN UINT64 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets a buffer for the token specified by TokenNumber to the value specified
- by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
- support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
- TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation
- was not actually performed.
-
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
- maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned.
-
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetPtrS (
- IN UINTN TokenNumber,
- IN OUT UINTN *SizeOfBuffer,
- IN CONST VOID *Buffer
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the boolean value for the token specified by TokenNumber
- to the value specified by Value.
-
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The boolean value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetBoolS (
- IN UINTN TokenNumber,
- IN BOOLEAN Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 8-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid The pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 8-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetEx8S (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT8 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 16-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid The pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 16-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetEx16S (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT16 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 32-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid The pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 32-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetEx32S (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT32 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the 64-bit value for the token specified by TokenNumber
- to the value specified by Value.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid The pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The 64-bit value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetEx64S (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN UINT64 Value
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets a buffer for the token specified by TokenNumber to the value specified by
- Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
- support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
- TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation
- was not actually performed.
-
- If Guid is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in, out] SizeOfBuffer The size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetExPtrS (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN OUT UINTN *SizeOfBuffer,
- IN VOID *Buffer
- );
-
-/**
- This function provides a means by which to set a value for a given PCD token.
-
- Sets the boolean value for the token specified by TokenNumber
- to the value specified by Value.
-
- If Guid is NULL, then ASSERT().
-
- @param[in] Guid The pointer to a 128-bit unique value that
- designates which namespace to set a value from.
- @param[in] TokenNumber The PCD token number to set a current value for.
- @param[in] Value The boolean value to set.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPcdSetExBoolS (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- IN BOOLEAN Value
- );
-
-/**
- This notification function serves two purposes.
-
- Firstly, it notifies the module that did the registration that the value of this
- PCD token has been set.
- Secondly, it provides a mechanism for the module that did the registration to intercept
- the set operation and override the value been set if necessary. After the invocation of
- the callback function, TokenData will be used by PCD service PEIM or driver to modify th
- internal data in PCD database.
-
- @param[in] CallBackGuid The PCD token GUID being set.
- @param[in] CallBackToken The PCD token number being set.
- @param[in, out] TokenData A pointer to the token data being set.
- @param[in] TokenDataSize The size, in bytes, of the data being set.
-
-**/
-typedef
-VOID
-(EFIAPI *PCD_CALLBACK)(
- IN CONST GUID *CallBackGuid, OPTIONAL
- IN UINTN CallBackToken,
- IN OUT VOID *TokenData,
- IN UINTN TokenDataSize
- );
-
-
-/**
- Set up a notification function that is called when a specified token is set.
-
- When the token specified by TokenNumber and Guid is set,
- then notification function specified by NotificationFunction is called.
- If Guid is NULL, then the default token space is used.
- If NotificationFunction is NULL, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates which
- namespace to set a value from. If NULL, then the default
- token space is used.
- @param[in] TokenNumber The PCD token number to monitor.
- @param[in] NotificationFunction The function to call when the token
- specified by Guid and TokenNumber is set.
-
-**/
-VOID
-EFIAPI
-LibPcdCallbackOnSet (
- IN CONST GUID *Guid, OPTIONAL
- IN UINTN TokenNumber,
- IN PCD_CALLBACK NotificationFunction
- );
-
-
-/**
- Disable a notification function that was established with LibPcdCallbackonSet().
-
- Disable a notification function that was previously established with LibPcdCallbackOnSet().
- If NotificationFunction is NULL, then ASSERT().
- If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
- and NotificationFunction, then ASSERT().
-
- @param[in] Guid Specify the GUID token space.
- @param[in] TokenNumber Specify the token number.
- @param[in] NotificationFunction The callback function to be unregistered.
-
-**/
-VOID
-EFIAPI
-LibPcdCancelCallback (
- IN CONST GUID *Guid, OPTIONAL
- IN UINTN TokenNumber,
- IN PCD_CALLBACK NotificationFunction
- );
-
-
-/**
- Retrieves the next token in a token space.
-
- Retrieves the next PCD token number from the token space specified by Guid.
- If Guid is NULL, then the default token space is used. If TokenNumber is 0,
- then the first token number is returned. Otherwise, the token number that
- follows TokenNumber in the token space is returned. If TokenNumber is the last
- token number in the token space, then 0 is returned.
-
- If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
-
- @param[in] Guid Pointer to a 128-bit unique value that designates which namespace
- to set a value from. If NULL, then the default token space is used.
- @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD
- token number.
-
- @return The next valid token number.
-
-**/
-UINTN
-EFIAPI
-LibPcdGetNextToken (
- IN CONST GUID *Guid, OPTIONAL
- IN UINTN TokenNumber
- );
-
-
-
-/**
- Used to retrieve the list of available PCD token space GUIDs.
-
- Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
- in the platform.
- If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
- If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
-
- @param TokenSpaceGuid Pointer to the a PCD token space GUID
-
- @return The next valid token namespace.
-
-**/
-GUID *
-EFIAPI
-LibPcdGetNextTokenSpace (
- IN CONST GUID *TokenSpaceGuid
- );
-
-
-/**
- Sets a value of a patchable PCD entry that is type pointer.
-
- Sets the PCD entry specified by PatchVariable to the value specified by Buffer
- and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
- MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
- NULL to indicate that the set operation was not actually performed.
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
- MaximumDatumSize and NULL must be returned.
-
- If PatchVariable is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[out] PatchVariable A pointer to the global variable in a module that is
- the target of the set operation.
- @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
- @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to used to set the target variable.
-
- @return Return the pointer to the Buffer that was set.
-
-**/
-VOID *
-EFIAPI
-LibPatchPcdSetPtr (
- OUT VOID *PatchVariable,
- IN UINTN MaximumDatumSize,
- IN OUT UINTN *SizeOfBuffer,
- IN CONST VOID *Buffer
- );
-
-/**
- Sets a value of a patchable PCD entry that is type pointer.
-
- Sets the PCD entry specified by PatchVariable to the value specified
- by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
- then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
- to indicate that the set operation was not actually performed.
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
- MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
-
- If PatchVariable is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[out] PatchVariable A pointer to the global variable in a module that is
- the target of the set operation.
- @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
- @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to used to set the target variable.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPatchPcdSetPtrS (
- OUT VOID *PatchVariable,
- IN UINTN MaximumDatumSize,
- IN OUT UINTN *SizeOfBuffer,
- IN CONST VOID *Buffer
- );
-
-/**
- Sets a value and size of a patchable PCD entry that is type pointer.
-
- Sets the PCD entry specified by PatchVariable to the value specified by Buffer
- and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
- MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
- NULL to indicate that the set operation was not actually performed.
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
- MaximumDatumSize and NULL must be returned.
-
- If PatchVariable is NULL, then ASSERT().
- If SizeOfPatchVariable is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[out] PatchVariable A pointer to the global variable in a module that is
- the target of the set operation.
- @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
- @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
- @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to used to set the target variable.
-
- @return Return the pointer to the Buffer that was set.
-
-**/
-VOID *
-EFIAPI
-LibPatchPcdSetPtrAndSize (
- OUT VOID *PatchVariable,
- OUT UINTN *SizeOfPatchVariable,
- IN UINTN MaximumDatumSize,
- IN OUT UINTN *SizeOfBuffer,
- IN CONST VOID *Buffer
- );
-
-/**
- Sets a value and size of a patchable PCD entry that is type pointer.
-
- Sets the PCD entry specified by PatchVariable to the value specified
- by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
- then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
- to indicate that the set operation was not actually performed.
- If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
- MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
-
- If PatchVariable is NULL, then ASSERT().
- If SizeOfPatchVariable is NULL, then ASSERT().
- If SizeOfBuffer is NULL, then ASSERT().
- If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
-
- @param[out] PatchVariable A pointer to the global variable in a module that is
- the target of the set operation.
- @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
- @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.
- @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.
- @param[in] Buffer A pointer to the buffer to used to set the target variable.
-
- @return The status of the set operation.
-
-**/
-RETURN_STATUS
-EFIAPI
-LibPatchPcdSetPtrAndSizeS (
- OUT VOID *PatchVariable,
- OUT UINTN *SizeOfPatchVariable,
- IN UINTN MaximumDatumSize,
- IN OUT UINTN *SizeOfBuffer,
- IN CONST VOID *Buffer
- );
-
-typedef enum {
- PCD_TYPE_8,
- PCD_TYPE_16,
- PCD_TYPE_32,
- PCD_TYPE_64,
- PCD_TYPE_BOOL,
- PCD_TYPE_PTR
-} PCD_TYPE;
-
-typedef struct {
- ///
- /// The returned information associated with the requested TokenNumber. If
- /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.
- ///
- PCD_TYPE PcdType;
- ///
- /// The size of the data in bytes associated with the TokenNumber specified. If
- /// TokenNumber is 0, then PcdSize is set 0.
- ///
- UINTN PcdSize;
- ///
- /// The null-terminated ASCII string associated with a given token. If the
- /// TokenNumber specified was 0, then this field corresponds to the null-terminated
- /// ASCII string associated with the token's namespace Guid. If NULL, there is no
- /// name associated with this request.
- ///
- CHAR8 *PcdName;
-} PCD_INFO;
-
-
-/**
- Retrieve additional information associated with a PCD token.
-
- This includes information such as the type of value the TokenNumber is associated with as well as possible
- human readable name that is associated with the token.
-
- If TokenNumber is not in the default token space specified, then ASSERT().
-
- @param[in] TokenNumber The PCD token number.
- @param[out] PcdInfo The returned information associated with the requested TokenNumber.
- The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
-**/
-VOID
-EFIAPI
-LibPcdGetInfo (
- IN UINTN TokenNumber,
- OUT PCD_INFO *PcdInfo
- );
-
-/**
- Retrieve additional information associated with a PCD token.
-
- This includes information such as the type of value the TokenNumber is associated with as well as possible
- human readable name that is associated with the token.
-
- If TokenNumber is not in the token space specified by Guid, then ASSERT().
-
- @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
- @param[in] TokenNumber The PCD token number.
- @param[out] PcdInfo The returned information associated with the requested TokenNumber.
- The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
-**/
-VOID
-EFIAPI
-LibPcdGetInfoEx (
- IN CONST GUID *Guid,
- IN UINTN TokenNumber,
- OUT PCD_INFO *PcdInfo
- );
-
-/**
- Retrieve the currently set SKU Id.
-
- @return The currently set SKU Id. If the platform has not set at a SKU Id, then the
- default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
- Id is returned.
-**/
-UINTN
-EFIAPI
-LibPcdGetSku (
- VOID
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PciCf8Lib.h b/Core/MdePkg/Include/Library/PciCf8Lib.h
deleted file mode 100644
index 52fb142a9c..0000000000
--- a/Core/MdePkg/Include/Library/PciCf8Lib.h
+++ /dev/null
@@ -1,1094 +0,0 @@
-/** @file
- Provides services to access PCI Configuration Space using the I/O ports 0xCF8 and 0xCFC.
-
- This library is identical to the PCI Library, except the access method for performing PCI
- configuration cycles must be through I/O ports 0xCF8 and 0xCFC. This library only allows
- access to PCI Segment #0.
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PCI_CF8_LIB_H__
-#define __PCI_CF8_LIB_H__
-
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the PCI Library functions.
-
- Computes an address that is compatible with the PCI Library functions. The
- unused upper bits of Bus, Device, Function and Register are stripped prior to
- the generation of the address.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..255.
-
- @return The encode PCI address.
-
-**/
-#define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
- (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
- Registers a PCI device so PCI configuration registers may be accessed after
- SetVirtualAddressMap().
-
- Registers the PCI device specified by Address so all the PCI configuration registers
- associated with that PCI device may be accessed after SetVirtualAddressMap() is called.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @retval RETURN_SUCCESS The PCI device was registered for runtime access.
- @retval RETURN_UNSUPPORTED An attempt was made to call this function
- after ExitBootServices().
- @retval RETURN_UNSUPPORTED The resources required to access the PCI device
- at runtime could not be mapped.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- complete the registration.
-
-**/
-RETURN_STATUS
-EFIAPI
-PciCf8RegisterForRuntimeAccess (
- IN UINTN Address
- );
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Read8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Write8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Performs a bitwise OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Or8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8And8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8AndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Read16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Write16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Performs a bitwise OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Or16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8And16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8AndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Read32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Write32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Performs a bitwise OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Or32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8And32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8AndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If the register specified by StartAddress >= 0x100, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size read from StartAddress.
-
-**/
-UINTN
-EFIAPI
-PciCf8ReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If the register specified by StartAddress >= 0x100, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size written to StartAddress.
-
-**/
-UINTN
-EFIAPI
-PciCf8WriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PciExpressLib.h b/Core/MdePkg/Include/Library/PciExpressLib.h
deleted file mode 100644
index e312d57528..0000000000
--- a/Core/MdePkg/Include/Library/PciExpressLib.h
+++ /dev/null
@@ -1,1061 +0,0 @@
-/** @file
- Provides services to access PCI Configuration Space using the MMIO PCI Express window.
-
- This library is identical to the PCI Library, except the access method for performing PCI
- configuration cycles must be through the 256 MB PCI Express MMIO window whose base address
- is defined by PcdPciExpressBaseAddress.
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PCI_EXPRESS_LIB_H__
-#define __PCI_EXPRESS_LIB_H__
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the PCI Library functions.
-
- Computes an address that is compatible with the PCI Library functions. The
- unused upper bits of Bus, Device, Function and Register are stripped prior to
- the generation of the address.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..4095.
-
- @return The encode PCI address.
-
-**/
-#define PCI_EXPRESS_LIB_ADDRESS(Bus,Device,Function,Offset) \
- (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
- Registers a PCI device so PCI configuration registers may be accessed after
- SetVirtualAddressMap().
-
- Registers the PCI device specified by Address so all the PCI configuration
- registers associated with that PCI device may be accessed after SetVirtualAddressMap()
- is called.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @retval RETURN_SUCCESS The PCI device was registered for runtime access.
- @retval RETURN_UNSUPPORTED An attempt was made to call this function
- after ExitBootServices().
- @retval RETURN_UNSUPPORTED The resources required to access the PCI device
- at runtime could not be mapped.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- complete the registration.
-
-**/
-RETURN_STATUS
-EFIAPI
-PciExpressRegisterForRuntimeAccess (
- IN UINTN Address
- );
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Performs a bitwise OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Performs a bitwise OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Performs a bitwise OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size read data from StartAddress.
-
-**/
-UINTN
-EFIAPI
-PciExpressReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size written to StartAddress.
-
-**/
-UINTN
-EFIAPI
-PciExpressWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PciLib.h b/Core/MdePkg/Include/Library/PciLib.h
deleted file mode 100644
index b113ddf487..0000000000
--- a/Core/MdePkg/Include/Library/PciLib.h
+++ /dev/null
@@ -1,1062 +0,0 @@
-/** @file
- Provides services to access PCI Configuration Space.
-
- These functions perform PCI configuration cycles using the default PCI configuration
- access method. This may use I/O ports 0xCF8 and 0xCFC to perform PCI configuration accesses,
- or it may use MMIO registers relative to the PcdPciExpressBaseAddress, or it may use some
- alternate access method. Modules will typically use the PCI Library for its PCI configuration
- accesses. However, if a module requires a mix of PCI access methods, the PCI CF8 Library or
- PCI Express Library may be used in conjunction with the PCI Library. The functionality of
- these three libraries is identical. The PCI CF8 Library and PCI Express Library simply use
- explicit access methods.
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PCI_LIB_H__
-#define __PCI_LIB_H__
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the PCI Library functions.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..255 for PCI. Range 0..4095
- for PCI Express.
-
- @return The encoded PCI address.
-
-**/
-#define PCI_LIB_ADDRESS(Bus,Device,Function,Register) \
- (((Register) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
- Registers a PCI device so PCI configuration registers may be accessed after
- SetVirtualAddressMap().
-
- Registers the PCI device specified by Address so all the PCI configuration registers
- associated with that PCI device may be accessed after SetVirtualAddressMap() is called.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @retval RETURN_SUCCESS The PCI device was registered for runtime access.
- @retval RETURN_UNSUPPORTED An attempt was made to call this function
- after ExitBootServices().
- @retval RETURN_UNSUPPORTED The resources required to access the PCI device
- at runtime could not be mapped.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- complete the registration.
-
-**/
-RETURN_STATUS
-EFIAPI
-PciRegisterForRuntimeAccess (
- IN UINTN Address
- );
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Performs a bitwise OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed by a bitwise OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Performs a bitwise OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Performs a bitwise OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size written to StartAddress.
-
-**/
-UINTN
-EFIAPI
-PciWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PciSegmentLib.h b/Core/MdePkg/Include/Library/PciSegmentLib.h
deleted file mode 100644
index 5175e07606..0000000000
--- a/Core/MdePkg/Include/Library/PciSegmentLib.h
+++ /dev/null
@@ -1,1045 +0,0 @@
-/** @file
- Provides services to access PCI Configuration Space on a platform with multiple PCI segments.
-
- The PCI Segment Library function provide services to read, write, and modify the PCI configuration
- registers on PCI root bridges on any supported PCI segment. These library services take a single
- address parameter that encodes the PCI Segment, PCI Bus, PCI Device, PCI Function, and PCI Register.
- The layout of this address parameter is as follows:
-
- PCI Register: Bits 0..11
- PCI Function Bits 12..14
- PCI Device Bits 15..19
- PCI Bus Bits 20..27
- Reserved Bits 28..31. Must be 0.
- PCI Segment Bits 32..47
- Reserved Bits 48..63. Must be 0.
-
- | Reserved (MBZ) | Segment | Reserved (MBZ) | Bus | Device | Function | Register |
- 63 48 47 32 31 28 27 20 19 15 14 12 11 0
-
- These functions perform PCI configuration cycles using the default PCI configuration access
- method. This may use I/O ports 0xCF8 and 0xCFC to perform PCI configuration accesses, or it
- may use MMIO registers relative to the PcdPciExpressBaseAddress, or it may use some alternate
- access method. Modules will typically use the PCI Segment Library for its PCI configuration
- accesses when PCI Segments other than Segment #0 must be accessed.
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PCI_SEGMENT_LIB__
-#define __PCI_SEGMENT_LIB__
-
-
-/**
- Macro that converts PCI Segment, PCI Bus, PCI Device, PCI Function,
- and PCI Register to an address that can be passed to the PCI Segment Library functions.
-
- Computes an address that is compatible with the PCI Segment Library functions.
- The unused upper bits of Segment, Bus, Device, Function,
- and Register are stripped prior to the generation of the address.
-
- @param Segment PCI Segment number. Range 0..65535.
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..255 for PCI. Range 0..4095 for PCI Express.
-
- @return The address that is compatible with the PCI Segment Library functions.
-
-**/
-#define PCI_SEGMENT_LIB_ADDRESS(Segment,Bus,Device,Function,Register) \
- ((Segment != 0) ? \
- ( ((Register) & 0xfff) | \
- (((Function) & 0x07) << 12) | \
- (((Device) & 0x1f) << 15) | \
- (((Bus) & 0xff) << 20) | \
- (LShiftU64 ((Segment) & 0xffff, 32)) \
- ) : \
- ( ((Register) & 0xfff) | \
- (((Function) & 0x07) << 12) | \
- (((Device) & 0x1f) << 15) | \
- (((Bus) & 0xff) << 20) \
- ) \
- )
-
-/**
- Register a PCI device so PCI configuration registers may be accessed after
- SetVirtualAddressMap().
-
- If any reserved bits in Address are set, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @retval RETURN_SUCCESS The PCI device was registered for runtime access.
- @retval RETURN_UNSUPPORTED An attempt was made to call this function
- after ExitBootServices().
- @retval RETURN_UNSUPPORTED The resources required to access the PCI device
- at runtime could not be mapped.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- complete the registration.
-
-**/
-RETURN_STATUS
-EFIAPI
-PciSegmentRegisterForRuntimeAccess (
- IN UINTN Address
- );
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
-
- @return The 8-bit PCI configuration register specified by Address.
-
-**/
-UINT8
-EFIAPI
-PciSegmentRead8 (
- IN UINT64 Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the value specified by Value.
- Value is returned. This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentWrite8 (
- IN UINT64 Address,
- IN UINT8 Value
- );
-
-/**
- Performs a bitwise OR of an 8-bit PCI configuration register with an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address,
- performs a bitwise OR between the read result and the value specified by OrData,
- and writes the result to the 8-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentOr8 (
- IN UINT64 Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address,
- performs a bitwise AND between the read result and the value specified by AndData,
- and writes the result to the 8-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
- If any reserved bits in Address are set, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentAnd8 (
- IN UINT64 Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value,
- followed a bitwise OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address,
- performs a bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentAndThenOr8 (
- IN UINT64 Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentBitFieldRead8 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentBitFieldWrite8 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentBitFieldOr8 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentBitFieldAnd8 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciSegmentBitFieldAndThenOr8 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
-
- @return The 16-bit PCI configuration register specified by Address.
-
-**/
-UINT16
-EFIAPI
-PciSegmentRead16 (
- IN UINT64 Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the value specified by Value.
- Value is returned. This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param Value The value to write.
-
- @return The parameter of Value.
-
-**/
-UINT16
-EFIAPI
-PciSegmentWrite16 (
- IN UINT64 Address,
- IN UINT16 Value
- );
-
-/**
- Performs a bitwise OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentOr16 (
- IN UINT64 Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address,
- performs a bitwise AND between the read result and the value specified by AndData,
- and writes the result to the 16-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentAnd16 (
- IN UINT64 Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value,
- followed a bitwise OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address,
- performs a bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentAndThenOr16 (
- IN UINT64 Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentBitFieldRead16 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentBitFieldWrite16 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads the 16-bit PCI configuration register specified by Address,
- performs a bitwise OR between the read result and the value specified by OrData,
- and writes the result to the 16-bit PCI configuration register specified by Address.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentBitFieldOr16 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR,
- and writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address,
- performs a bitwise OR between the read result and the value specified by OrData,
- and writes the result to the 16-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
- Extra left bits in OrData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param StartBit The ordinal of the least significant bit in the bit field.
- The ordinal of the least significant bit in a byte is bit 0.
- @param EndBit The ordinal of the most significant bit in the bit field.
- The ordinal of the most significant bit in a byte is bit 7.
- @param AndData The value to AND with the read value from the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentBitFieldAnd16 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciSegmentBitFieldAndThenOr16 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
-
- @return The 32-bit PCI configuration register specified by Address.
-
-**/
-UINT32
-EFIAPI
-PciSegmentRead32 (
- IN UINT64 Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the value specified by Value.
- Value is returned. This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param Value The value to write.
-
- @return The parameter of Value.
-
-**/
-UINT32
-EFIAPI
-PciSegmentWrite32 (
- IN UINT64 Address,
- IN UINT32 Value
- );
-
-/**
- Performs a bitwise OR of a 32-bit PCI configuration register with a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address,
- performs a bitwise OR between the read result and the value specified by OrData,
- and writes the result to the 32-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentOr32 (
- IN UINT64 Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address,
- performs a bitwise AND between the read result and the value specified by AndData,
- and writes the result to the 32-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentAnd32 (
- IN UINT64 Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value,
- followed a bitwise OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address,
- performs a bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit PCI configuration register specified by Address.
- The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are serialized.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentAndThenOr32 (
- IN UINT64 Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentBitFieldRead32 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentBitFieldWrite32 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentBitFieldOr32 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
-
- Reads the 32-bit PCI configuration register specified by Address, performs a bitwise
- AND between the read result and the value specified by AndData, and writes the result
- to the 32-bit PCI configuration register specified by Address. The value written to
- the PCI configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in AndData are stripped.
- If any reserved bits in Address are set, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentBitFieldAnd32 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If any reserved bits in Address are set, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciSegmentBitFieldAndThenOr32 (
- IN UINT64 Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If any reserved bits in StartAddress are set, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Segment, Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciSegmentReadBuffer (
- IN UINT64 StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If any reserved bits in StartAddress are set, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Segment, Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return The parameter of Size.
-
-**/
-UINTN
-EFIAPI
-PciSegmentWriteBuffer (
- IN UINT64 StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PeCoffExtraActionLib.h b/Core/MdePkg/Include/Library/PeCoffExtraActionLib.h
deleted file mode 100644
index 6136786312..0000000000
--- a/Core/MdePkg/Include/Library/PeCoffExtraActionLib.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @file
- Provides services to perform additional actions when a PE/COFF image is loaded
- or unloaded. This is useful for environment where symbols need to be loaded
- and unloaded to support source level debugging.
-
- Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PE_COFF_EXTRA_ACTION_LIB_H__
-#define __PE_COFF_EXTRA_ACTION_LIB_H__
-
-#include <Library/PeCoffLib.h>
-
-/**
- Performs additional actions after a PE/COFF image has been loaded and relocated.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the
- PE/COFF image that has already been loaded and relocated.
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageExtraAction (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-/**
- Performs additional actions just before a PE/COFF image is unloaded. Any resources
- that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the
- PE/COFF image that is being unloaded.
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderUnloadImageExtraAction (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PeCoffGetEntryPointLib.h b/Core/MdePkg/Include/Library/PeCoffGetEntryPointLib.h
deleted file mode 100644
index f211cf5426..0000000000
--- a/Core/MdePkg/Include/Library/PeCoffGetEntryPointLib.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/** @file
- Provides a service to retrieve the PE/COFF entry point from a PE/COFF image.
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PE_COFF_GET_ENTRY_POINT_LIB_H__
-#define __PE_COFF_GET_ENTRY_POINT_LIB_H__
-
-/**
- Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded
- into system memory with the PE/COFF Loader Library functions.
-
- Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry
- point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then
- return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.
- If Pe32Data is NULL, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
-
- @param Pe32Data The pointer to the PE/COFF image that is loaded in system memory.
- @param EntryPoint The pointer to entry point to the PE/COFF image to return.
-
- @retval RETURN_SUCCESS EntryPoint was returned.
- @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- OUT VOID **EntryPoint
- );
-
-/**
- Returns the machine type of a PE/COFF image.
-
- Returns the machine type from the PE/COFF image specified by Pe32Data.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data The pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return Machine type or zero if not a valid image.
-
-**/
-UINT16
-EFIAPI
-PeCoffLoaderGetMachineType (
- IN VOID *Pe32Data
- );
-
-/**
- Returns a pointer to the PDB file name for a PE/COFF image that has been
- loaded into system memory with the PE/COFF Loader Library functions.
-
- Returns the PDB file name for the PE/COFF image specified by Pe32Data. If
- the PE/COFF image specified by Pe32Data is not a valid, then NULL is
- returned. If the PE/COFF image specified by Pe32Data does not contain a
- debug directory entry, then NULL is returned. If the debug directory entry
- in the PE/COFF image specified by Pe32Data does not contain a PDB file name,
- then NULL is returned.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data The pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return The PDB file name for the PE/COFF image specified by Pe32Data, or NULL
- if it cannot be retrieved.
-
-**/
-VOID *
-EFIAPI
-PeCoffLoaderGetPdbPointer (
- IN VOID *Pe32Data
- );
-
-
-/**
- Returns the size of the PE/COFF headers
-
- Returns the size of the PE/COFF header specified by Pe32Data.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data The pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return Size of PE/COFF header in bytes, or zero if not a valid image.
-
-**/
-UINT32
-EFIAPI
-PeCoffGetSizeOfHeaders (
- IN VOID *Pe32Data
- );
-
-/**
- Returns PE/COFF image base specified by the address in this PE/COFF image.
-
- On DEBUG build, searches the PE/COFF image base forward the address in this
- PE/COFF image and returns it.
-
- @param Address Address located in one PE/COFF image.
-
- @retval 0 RELEASE build or cannot find the PE/COFF image base.
- @retval others PE/COFF image base found.
-
-**/
-UINTN
-EFIAPI
-PeCoffSearchImageBase (
- IN UINTN Address
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PeCoffLib.h b/Core/MdePkg/Include/Library/PeCoffLib.h
deleted file mode 100644
index 5a3f98810a..0000000000
--- a/Core/MdePkg/Include/Library/PeCoffLib.h
+++ /dev/null
@@ -1,392 +0,0 @@
-/** @file
- Provides services to load and relocate a PE/COFF image.
-
- The PE/COFF Loader Library abstracts the implementation of a PE/COFF loader for
- IA-32, x86, IPF, and EBC processor types. The library functions are memory-based
- and can be ported easily to any environment.
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __BASE_PE_COFF_LIB_H__
-#define __BASE_PE_COFF_LIB_H__
-
-#include <IndustryStandard/PeImage.h>
-//
-// Return status codes from the PE/COFF Loader services
-//
-#define IMAGE_ERROR_SUCCESS 0
-#define IMAGE_ERROR_IMAGE_READ 1
-#define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE 2
-#define IMAGE_ERROR_INVALID_MACHINE_TYPE 3
-#define IMAGE_ERROR_INVALID_SUBSYSTEM 4
-#define IMAGE_ERROR_INVALID_IMAGE_ADDRESS 5
-#define IMAGE_ERROR_INVALID_IMAGE_SIZE 6
-#define IMAGE_ERROR_INVALID_SECTION_ALIGNMENT 7
-#define IMAGE_ERROR_SECTION_NOT_LOADED 8
-#define IMAGE_ERROR_FAILED_RELOCATION 9
-#define IMAGE_ERROR_FAILED_ICACHE_FLUSH 10
-#define IMAGE_ERROR_UNSUPPORTED 11
-
-/**
- Reads contents of a PE/COFF image.
-
- A function of this type reads contents of the PE/COFF image specified by FileHandle. The read
- operation copies ReadSize bytes from the PE/COFF image starting at byte offset FileOffset into
- the buffer specified by Buffer. The size of the buffer actually read is returned in ReadSize.
- If FileOffset specifies an offset past the end of the PE/COFF image, a ReadSize of 0 is returned.
- A function of this type must be registered in the ImageRead field of a PE_COFF_LOADER_IMAGE_CONTEXT
- structure for the PE/COFF Loader Library service to function correctly. This function abstracts access
- to a PE/COFF image so it can be implemented in an environment specific manner. For example, SEC and PEI
- environments may access memory directly to read the contents of a PE/COFF image, and DXE or UEFI
- environments may require protocol services to read the contents of PE/COFF image
- stored on FLASH, disk, or network devices.
-
- If FileHandle is not a valid handle, then ASSERT().
- If ReadSize is NULL, then ASSERT().
- If Buffer is NULL, then ASSERT().
-
- @param FileHandle Pointer to the file handle to read the PE/COFF image.
- @param FileOffset Offset into the PE/COFF image to begin the read operation.
- @param ReadSize On input, the size in bytes of the requested read operation.
- On output, the number of bytes actually read.
- @param Buffer Output buffer that contains the data read from the PE/COFF image.
-
- @retval RETURN_SUCCESS The specified portion of the PE/COFF image was
- read and the size return in ReadSize.
- @retval RETURN_DEVICE_ERROR The specified portion of the PE/COFF image
- could not be read due to a device error.
-
-**/
-typedef
-RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_READ_FILE)(
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- );
-
-///
-/// The context structure used while PE/COFF image is being loaded and relocated.
-///
-typedef struct {
- ///
- /// Set by PeCoffLoaderGetImageInfo() to the ImageBase in the PE/COFF header.
- ///
- PHYSICAL_ADDRESS ImageAddress;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to the SizeOfImage in the PE/COFF header.
- /// Image size includes the size of Debug Entry if it is present.
- ///
- UINT64 ImageSize;
- ///
- /// Is set to zero by PeCoffLoaderGetImageInfo(). If DestinationAddress is non-zero,
- /// PeCoffLoaderRelocateImage() will relocate the image using this base address.
- /// If the DestinationAddress is zero, the ImageAddress will be used as the base
- /// address of relocation.
- ///
- PHYSICAL_ADDRESS DestinationAddress;
- ///
- /// PeCoffLoaderLoadImage() sets EntryPoint to to the entry point of the PE/COFF image.
- ///
- PHYSICAL_ADDRESS EntryPoint;
- ///
- /// Passed in by the caller to PeCoffLoaderGetImageInfo() and PeCoffLoaderLoadImage()
- /// to abstract accessing the image from the library.
- ///
- PE_COFF_LOADER_READ_FILE ImageRead;
- ///
- /// Used as the FileHandle passed into the ImageRead function when it's called.
- ///
- VOID *Handle;
- ///
- /// Caller allocated buffer of size FixupDataSize that can be optionally allocated
- /// prior to calling PeCoffLoaderRelocateImage().
- /// This buffer is filled with the information used to fix up the image.
- /// The fixups have been applied to the image and this entry is just for information.
- ///
- VOID *FixupData;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to the Section Alignment in the PE/COFF header.
- /// If the image is a TE image, then this field is set to 0.
- ///
- UINT32 SectionAlignment;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to offset to the PE/COFF header.
- /// If the PE/COFF image does not start with a DOS header, this value is zero.
- /// Otherwise, it's the offset to the PE/COFF header.
- ///
- UINT32 PeCoffHeaderOffset;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to the Relative Virtual Address of the debug directory,
- /// if it exists in the image
- ///
- UINT32 DebugDirectoryEntryRva;
- ///
- /// Set by PeCoffLoaderLoadImage() to CodeView area of the PE/COFF Debug directory.
- ///
- VOID *CodeView;
- ///
- /// Set by PeCoffLoaderLoadImage() to point to the PDB entry contained in the CodeView area.
- /// The PdbPointer points to the filename of the PDB file used for source-level debug of
- /// the image by a debugger.
- ///
- CHAR8 *PdbPointer;
- ///
- /// Is set by PeCoffLoaderGetImageInfo() to the Section Alignment in the PE/COFF header.
- ///
- UINTN SizeOfHeaders;
- ///
- /// Not used by this library class. Other library classes that layer on top of this library
- /// class fill in this value as part of their GetImageInfo call.
- /// This allows the caller of the library to know what type of memory needs to be allocated
- /// to load and relocate the image.
- ///
- UINT32 ImageCodeMemoryType;
- ///
- /// Not used by this library class. Other library classes that layer on top of this library
- /// class fill in this value as part of their GetImageInfo call.
- /// This allows the caller of the library to know what type of memory needs to be allocated
- /// to load and relocate the image.
- ///
- UINT32 ImageDataMemoryType;
- ///
- /// Set by any of the library functions if they encounter an error.
- ///
- UINT32 ImageError;
- ///
- /// Set by PeCoffLoaderLoadImage() to indicate the size of FixupData that the caller must
- /// allocate before calling PeCoffLoaderRelocateImage().
- ///
- UINTN FixupDataSize;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to the machine type stored in the PE/COFF header.
- ///
- UINT16 Machine;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to the subsystem type stored in the PE/COFF header.
- ///
- UINT16 ImageType;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to TRUE if the PE/COFF image does not contain
- /// relocation information.
- ///
- BOOLEAN RelocationsStripped;
- ///
- /// Set by PeCoffLoaderGetImageInfo() to TRUE if the image is a TE image.
- /// For a definition of the TE Image format, see the Platform Initialization Pre-EFI
- /// Initialization Core Interface Specification.
- ///
- BOOLEAN IsTeImage;
- ///
- /// Set by PeCoffLoaderLoadImage() to the HII resource offset
- /// if the image contains a custom PE/COFF resource with the type 'HII'.
- /// Otherwise, the entry remains to be 0.
- ///
- PHYSICAL_ADDRESS HiiResourceData;
- ///
- /// Private storage for implementation specific data.
- ///
- UINT64 Context;
-} PE_COFF_LOADER_IMAGE_CONTEXT;
-
-/**
- Retrieves information about a PE/COFF image.
-
- Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize,
- DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and
- DebugDirectoryEntryRva fields of the ImageContext structure.
- If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.
- If the PE/COFF image accessed through the ImageRead service in the ImageContext
- structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED.
- If any errors occur while computing the fields of ImageContext,
- then the error status is returned in the ImageError field of ImageContext.
- If the image is a TE image, then SectionAlignment is set to 0.
- The ImageRead and Handle fields of ImageContext structure must be valid prior
- to invoking this service.
-
- @param ImageContext The pointer to the image context structure that
- describes the PE/COFF image that needs to be
- examined by this function.
-
- @retval RETURN_SUCCESS The information on the PE/COFF image was collected.
- @retval RETURN_INVALID_PARAMETER ImageContext is NULL.
- @retval RETURN_UNSUPPORTED The PE/COFF image is not supported.
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetImageInfo (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-/**
- Applies relocation fixups to a PE/COFF image that was loaded with PeCoffLoaderLoadImage().
-
- If the DestinationAddress field of ImageContext is 0, then use the ImageAddress field of
- ImageContext as the relocation base address. Otherwise, use the DestinationAddress field
- of ImageContext as the relocation base address. The caller must allocate the relocation
- fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.
-
- The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress,
- ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders,
- DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of
- the ImageContext structure must be valid prior to invoking this service.
-
- If ImageContext is NULL, then ASSERT().
-
- Note that if the platform does not maintain coherency between the instruction cache(s) and the data
- cache(s) in hardware, then the caller is responsible for performing cache maintenance operations
- prior to transferring control to a PE/COFF image that is loaded using this library.
-
- @param ImageContext The pointer to the image context structure that describes the PE/COFF
- image that is being relocated.
-
- @retval RETURN_SUCCESS The PE/COFF image was relocated.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_LOAD_ERROR The image in not a valid PE/COFF image.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_UNSUPPORTED A relocation record type is not supported.
- Extended status information is in the ImageError field of ImageContext.
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-/**
- Loads a PE/COFF image into memory.
-
- Loads the PE/COFF image accessed through the ImageRead service of ImageContext into the buffer
- specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate
- the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.
- The EntryPoint, FixupDataSize, CodeView, PdbPointer and HiiResourceData fields of ImageContext are computed.
- The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize,
- DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva
- fields of the ImageContext structure must be valid prior to invoking this service.
-
- If ImageContext is NULL, then ASSERT().
-
- Note that if the platform does not maintain coherency between the instruction cache(s) and the data
- cache(s) in hardware, then the caller is responsible for performing cache maintenance operations
- prior to transferring control to a PE/COFF image that is loaded using this library.
-
- @param ImageContext The pointer to the image context structure that describes the PE/COFF
- image that is being loaded.
-
- @retval RETURN_SUCCESS The PE/COFF image was loaded into the buffer specified by
- the ImageAddress and ImageSize fields of ImageContext.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_BUFFER_TOO_SMALL The caller did not provide a large enough buffer.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_LOAD_ERROR The PE/COFF image is an EFI Runtime image with no relocations.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_INVALID_PARAMETER The image address is invalid.
- Extended status information is in the ImageError field of ImageContext.
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderLoadImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-
-/**
- Reads contents of a PE/COFF image from a buffer in system memory.
-
- This is the default implementation of a PE_COFF_LOADER_READ_FILE function
- that assumes FileHandle pointer to the beginning of a PE/COFF image.
- This function reads contents of the PE/COFF image that starts at the system memory
- address specified by FileHandle. The read operation copies ReadSize bytes from the
- PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer.
- The size of the buffer actually read is returned in ReadSize.
-
- If FileHandle is NULL, then ASSERT().
- If ReadSize is NULL, then ASSERT().
- If Buffer is NULL, then ASSERT().
-
- @param FileHandle The pointer to base of the input stream
- @param FileOffset Offset into the PE/COFF image to begin the read operation.
- @param ReadSize On input, the size in bytes of the requested read operation.
- On output, the number of bytes actually read.
- @param Buffer Output buffer that contains the data read from the PE/COFF image.
-
- @retval RETURN_SUCCESS The data is read from FileOffset from the Handle into
- the buffer.
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderImageReadFromMemory (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- );
-
-
-/**
- Reapply fixups on a fixed up PE32/PE32+ image to allow virtual calling at EFI
- runtime.
-
- This function reapplies relocation fixups to the PE/COFF image specified by ImageBase
- and ImageSize so the image will execute correctly when the PE/COFF image is mapped
- to the address specified by VirtualImageBase. RelocationData must be identical
- to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure
- after this PE/COFF image was relocated with PeCoffLoaderRelocateImage().
-
- Note that if the platform does not maintain coherency between the instruction cache(s) and the data
- cache(s) in hardware, then the caller is responsible for performing cache maintenance operations
- prior to transferring control to a PE/COFF image that is loaded using this library.
-
- @param ImageBase The base address of a PE/COFF image that has been loaded
- and relocated into system memory.
- @param VirtImageBase The request virtual address that the PE/COFF image is to
- be fixed up for.
- @param ImageSize The size, in bytes, of the PE/COFF image.
- @param RelocationData A pointer to the relocation data that was collected when the PE/COFF
- image was relocated using PeCoffLoaderRelocateImage().
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageForRuntime (
- IN PHYSICAL_ADDRESS ImageBase,
- IN PHYSICAL_ADDRESS VirtImageBase,
- IN UINTN ImageSize,
- IN VOID *RelocationData
- );
-
-/**
- Unloads a loaded PE/COFF image from memory and releases its taken resource.
- Releases any environment specific resources that were allocated when the image
- specified by ImageContext was loaded using PeCoffLoaderLoadImage().
-
- For NT32 emulator, the PE/COFF image loaded by system needs to release.
- For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,
- this function can simply return RETURN_SUCCESS.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image to be unloaded.
-
- @retval RETURN_SUCCESS The PE/COFF image was unloaded successfully.
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderUnloadImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-#endif
diff --git a/Core/MdePkg/Include/Library/PeiCoreEntryPoint.h b/Core/MdePkg/Include/Library/PeiCoreEntryPoint.h
deleted file mode 100644
index 7485f7a40e..0000000000
--- a/Core/MdePkg/Include/Library/PeiCoreEntryPoint.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/** @file
- Module entry point library for PEI core.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MODULE_ENTRY_POINT_H__
-#define __MODULE_ENTRY_POINT_H__
-
-/**
- The entry point of PE/COFF Image for the PEI Core.
-
- This function is the entry point for the PEI Foundation, which allows the SEC phase
- to pass information about the stack, temporary RAM and the Boot Firmware Volume.
- In addition, it also allows the SEC phase to pass services and data forward for use
- during the PEI phase in the form of one or more PPIs.
- There is no limit to the number of additional PPIs that can be passed from SEC into
- the PEI Foundation. As part of its initialization phase, the PEI Foundation will add
- these SEC-hosted PPIs to its PPI database such that both the PEI Foundation and any
- modules can leverage the associated service calls and/or code in these early PPIs.
- This function is required to call ProcessModuleEntryPointList() with the Context
- parameter set to NULL. ProcessModuleEntryPoint() is never expected to return.
- The PEI Core is responsible for calling ProcessLibraryConstructorList() as soon as
- the PEI Services Table and the file handle for the PEI Core itself have been established.
- If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
-
- @param SecCoreData Points to a data structure containing information about the PEI
- core's operating environment, such as the size and location of
- temporary RAM, the stack location and the BFV location.
-
- @param PpiList Points to a list of one or more PPI descriptors to be installed
- initially by the PEI core. An empty PPI list consists of a single
- descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
- As part of its initialization phase, the PEI Foundation will add
- these SEC-hosted PPIs to its PPI database such that both the PEI
- Foundation and any modules can leverage the associated service calls
- and/or code in these early PPIs.
-
-**/
-VOID
-EFIAPI
-_ModuleEntryPoint(
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
- );
-
-/**
- Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
-
- This function is required to call _ModuleEntryPoint() passing in SecCoreData and PpiList.
-
- @param SecCoreData Points to a data structure containing information about the PEI core's
- operating environment, such as the size and location of temporary RAM,
- the stack location and the BFV location.
-
- @param PpiList Points to a list of one or more PPI descriptors to be installed
- initially by the PEI core. An empty PPI list consists of a single
- descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
- As part of its initialization phase, the PEI Foundation will add these
- SEC-hosted PPIs to its PPI database such that both the PEI Foundation
- and any modules can leverage the associated service calls and/or code
- in these early PPIs.
-
-**/
-VOID
-EFIAPI
-EfiMain (
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
- );
-
-/**
- Autogenerated function that calls the library constructors for all of the module's
- dependent libraries.
-
- This function must be called by the PEI Core once an initial PEI Services Table has been established.
- This function calls the set of library constructors for the set of library instances that a
- module depends on. This include library instances that a module depends on directly and library
- instances that a module depends on indirectly through other libraries.
- This function is autogenerated by build tools and those build tools are responsible for collecting
- the set of library instances, determining which ones have constructors, and calling the library
- constructors in the proper order based upon the dependencies of each of the library instances.
- The PEI Core must call this function with a NULL FileHandle value as soon as the initial PEI
- Services Table has been established.
-
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );
-
-
-/**
- Autogenerated function that calls a set of module entry points.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of module entry points.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the module entry points and calling them in a specified order.
-
- @param SecCoreData Points to a data structure containing information about the PEI
- core's operating environment, such as the size and location of
- temporary RAM, the stack location and the BFV location.
-
- @param PpiList Points to a list of one or more PPI descriptors to be installed
- initially by the PEI core. An empty PPI list consists of a single
- descriptor with the end-tag EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
- As part of its initialization phase, the PEI Foundation will add
- these SEC-hosted PPIs to its PPI database such that both the PEI
- Foundation and any modules can leverage the associated service calls
- and/or code in these early PPIs.
- @param Context A pointer to a private context structure defined by the PEI Core
- implementation. The implementation of _ModuleEntryPoint() must set
- this parameter is NULL to indicate that this is the first PEI phase.
-
-**/
-VOID
-EFIAPI
-ProcessModuleEntryPointList (
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,
- IN VOID *Context
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PeiServicesLib.h b/Core/MdePkg/Include/Library/PeiServicesLib.h
deleted file mode 100644
index 2b51d374c9..0000000000
--- a/Core/MdePkg/Include/Library/PeiServicesLib.h
+++ /dev/null
@@ -1,524 +0,0 @@
-/** @file
- Provides library functions for all PEI Services.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PEI_SERVICES_LIB_H__
-#define __PEI_SERVICES_LIB_H__
-
-/**
- This service enables a given PEIM to register an interface into the PEI Foundation.
-
- @param PpiList A pointer to the list of interfaces that the caller shall install.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesInstallPpi (
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
- );
-
-/**
- This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
-
- @param OldPpi Pointer to the old PEI PPI Descriptors.
- @param NewPpi Pointer to the new PEI PPI Descriptors.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
- @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
- installed.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesReInstallPpi (
- IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi
- );
-
-/**
- This service enables PEIMs to discover a given instance of an interface.
-
- @param Guid A pointer to the GUID whose corresponding interface needs to be
- found.
- @param Instance The N-th instance of the interface that is required.
- @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
- @param Ppi A pointer to the instance of the interface.
-
- @retval EFI_SUCCESS The interface was successfully returned.
- @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesLocatePpi (
- IN CONST EFI_GUID *Guid,
- IN UINTN Instance,
- IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
- IN OUT VOID **Ppi
- );
-
-/**
- This service enables PEIMs to register a given service to be invoked when another service is
- installed or reinstalled.
-
- @param NotifyList A pointer to the list of notification interfaces that the caller
- shall install.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesNotifyPpi (
- IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
- );
-
-/**
- This service enables PEIMs to ascertain the present value of the boot mode.
-
- @param BootMode A pointer to contain the value of the boot mode.
-
- @retval EFI_SUCCESS The boot mode was returned successfully.
- @retval EFI_INVALID_PARAMETER BootMode is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesGetBootMode (
- OUT EFI_BOOT_MODE *BootMode
- );
-
-/**
- This service enables PEIMs to update the boot mode variable.
-
- @param BootMode The value of the boot mode to set.
-
- @retval EFI_SUCCESS The value was successfully updated
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesSetBootMode (
- IN EFI_BOOT_MODE BootMode
- );
-
-/**
- This service enables a PEIM to ascertain the address of the list of HOBs in memory.
-
- @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
-
- @retval EFI_SUCCESS The list was successfully returned.
- @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesGetHobList (
- OUT VOID **HobList
- );
-
-/**
- This service enables PEIMs to create various types of HOBs.
-
- @param Type The type of HOB to be installed.
- @param Length The length of the HOB to be added.
- @param Hob The address of a pointer that will contain the HOB header.
-
- @retval EFI_SUCCESS The HOB was successfully created.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesCreateHob (
- IN UINT16 Type,
- IN UINT16 Length,
- OUT VOID **Hob
- );
-
-/**
- This service enables PEIMs to discover additional firmware volumes.
-
- @param Instance This instance of the firmware volume to find. The value 0 is the
- Boot Firmware Volume (BFV).
- @param VolumeHandle Handle of the firmware volume header of the volume to return.
-
- @retval EFI_SUCCESS The volume was found.
- @retval EFI_NOT_FOUND The volume was not found.
- @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindNextVolume (
- IN UINTN Instance,
- IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
- );
-
-/**
- This service enables PEIMs to discover additional firmware files.
-
- @param SearchType A filter to find files only of this type.
- @param VolumeHandle Pointer to the firmware volume header of the volume to search.
- This parameter must point to a valid FFS volume.
- @param FileHandle Handle of the current file from which to begin searching.
-
- @retval EFI_SUCCESS The file was found.
- @retval EFI_NOT_FOUND The file was not found.
- @retval EFI_NOT_FOUND The header checksum was not zero.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- IN OUT EFI_PEI_FILE_HANDLE *FileHandle
- );
-
-/**
- This service enables PEIMs to discover sections of a given type within a valid FFS file.
-
- @param SectionType The value of the section type to find.
- @param FileHandle A pointer to the file header that contains the set of sections to
- be searched.
- @param SectionData A pointer to the discovered section, if successful.
-
- @retval EFI_SUCCESS The section was found.
- @retval EFI_NOT_FOUND The section was not found.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_PEI_FILE_HANDLE FileHandle,
- OUT VOID **SectionData
- );
-
-/**
- This service enables PEIMs to discover sections of a given instance and type within a valid FFS file.
-
- @param SectionType The value of the section type to find.
- @param SectionInstance Section instance to find.
- @param FileHandle A pointer to the file header that contains the set
- of sections to be searched.
- @param SectionData A pointer to the discovered section, if successful.
- @param AuthenticationStatus A pointer to the authentication status for this section.
-
- @retval EFI_SUCCESS The section was found.
- @retval EFI_NOT_FOUND The section was not found.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindSectionData3 (
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN SectionInstance,
- IN EFI_PEI_FILE_HANDLE FileHandle,
- OUT VOID **SectionData,
- OUT UINT32 *AuthenticationStatus
- );
-
-/**
- This service enables PEIMs to register the permanent memory configuration
- that has been initialized with the PEI Foundation.
-
- @param MemoryBegin The value of a region of installed memory.
- @param MemoryLength The corresponding length of a region of installed memory.
-
- @retval EFI_SUCCESS The region was successfully installed in a HOB.
- @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesInstallPeiMemory (
- IN EFI_PHYSICAL_ADDRESS MemoryBegin,
- IN UINT64 MemoryLength
- );
-
-/**
- This service enables PEIMs to allocate memory after the permanent memory has been installed by a
- PEIM.
-
- @param MemoryType Type of memory to allocate.
- @param Pages Number of pages to allocate.
- @param Memory Pointer of memory allocated.
-
- @retval EFI_SUCCESS The memory range was successfully allocated.
- @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
- @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
- @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesAllocatePages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- OUT EFI_PHYSICAL_ADDRESS *Memory
- );
-
-/**
- This service allocates memory from the Hand-Off Block (HOB) heap.
-
- @param Size The number of bytes to allocate from the pool.
- @param Buffer If the call succeeds, a pointer to a pointer to the allocate
- buffer; undefined otherwise.
-
- @retval EFI_SUCCESS The allocation was successful
- @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesAllocatePool (
- IN UINTN Size,
- OUT VOID **Buffer
- );
-
-/**
- Resets the entire platform.
-
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesResetSystem (
- VOID
- );
-
-
-/**
- This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services
- Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
- Specification for details.
-
- @param FileName A pointer to the name of the file to
- find within the firmware volume.
-
- @param VolumeHandle The firmware volume to search FileHandle
- Upon exit, points to the found file's
- handle or NULL if it could not be found.
- @param FileHandle Pointer to found file handle
-
- @retval EFI_SUCCESS File was found.
-
- @retval EFI_NOT_FOUND File was not found.
-
- @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
- FileName was NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindFileByName (
- IN CONST EFI_GUID *FileName,
- IN CONST EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
- );
-
-
-/**
- This service is a wrapper for the PEI Service FfsGetFileInfo(), except the pointer to the PEI Services
- Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
- Specification for details.
-
- @param FileHandle Handle of the file.
-
- @param FileInfo Upon exit, points to the file's
- information.
-
- @retval EFI_SUCCESS File information returned.
-
- @retval EFI_INVALID_PARAMETER If FileHandle does not
- represent a valid file.
-
- @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsGetFileInfo (
- IN CONST EFI_PEI_FILE_HANDLE FileHandle,
- OUT EFI_FV_FILE_INFO *FileInfo
- );
-
-/**
- This service is a wrapper for the PEI Service FfsGetFileInfo2(), except the pointer to the PEI Services
- Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
- Specification for details.
-
- @param FileHandle Handle of the file.
-
- @param FileInfo Upon exit, points to the file's
- information.
-
- @retval EFI_SUCCESS File information returned.
-
- @retval EFI_INVALID_PARAMETER If FileHandle does not
- represent a valid file.
-
- @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsGetFileInfo2 (
- IN CONST EFI_PEI_FILE_HANDLE FileHandle,
- OUT EFI_FV_FILE_INFO2 *FileInfo
- );
-
-/**
- This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services
- Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
- Specification for details.
-
- @param VolumeHandle Handle of the volume.
-
- @param VolumeInfo Upon exit, points to the volume's
- information.
-
- @retval EFI_SUCCESS File information returned.
-
- @retval EFI_INVALID_PARAMETER If FileHandle does not
- represent a valid file.
-
- @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsGetVolumeInfo (
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_FV_INFO *VolumeInfo
- );
-
-
-/**
- This service is a wrapper for the PEI Service RegisterForShadow(), except the pointer to the PEI Services
- Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
- Specification for details.
-
- @param FileHandle PEIM's file handle. Must be the currently
- executing PEIM.
-
- @retval EFI_SUCCESS The PEIM was successfully registered for
- shadowing.
-
- @retval EFI_ALREADY_STARTED The PEIM was previously
- registered for shadowing.
-
- @retval EFI_NOT_FOUND The FileHandle does not refer to a
- valid file handle.
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesRegisterForShadow (
- IN EFI_PEI_FILE_HANDLE FileHandle
- );
-
-/**
- Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.
-
- This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using
- the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.
- If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().
- If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().
-
-
- @param FvFormat Unique identifier of the format of the memory-mapped firmware volume.
- This parameter is optional and may be NULL.
- If NULL is specified, the EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
- @param FvInfo Points to a buffer which allows the EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
- The format of this buffer is specific to the FvFormat. For memory-mapped firmware volumes,
- this typically points to the first byte of the firmware volume.
- @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped firmware volumes,
- this is typically the size of the firmware volume.
- @param ParentFvName If the new firmware volume originated from a file in a different firmware volume,
- then this parameter specifies the GUID name of the originating firmware volume.
- Otherwise, this parameter must be NULL.
- @param ParentFileName If the new firmware volume originated from a file in a different firmware volume,
- then this parameter specifies the GUID file name of the originating firmware file.
- Otherwise, this parameter must be NULL.
-**/
-VOID
-EFIAPI
-PeiServicesInstallFvInfoPpi (
- IN CONST EFI_GUID *FvFormat, OPTIONAL
- IN CONST VOID *FvInfo,
- IN UINT32 FvInfoSize,
- IN CONST EFI_GUID *ParentFvName, OPTIONAL
- IN CONST EFI_GUID *ParentFileName OPTIONAL
- );
-
-/**
- Install a EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance so the PEI Core will be notified about a new firmware volume.
-
- This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI using
- the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance.
- If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI, then ASSERT().
- If the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI can not be installed, then ASSERT().
-
- @param FvFormat Unique identifier of the format of the memory-mapped
- firmware volume. This parameter is optional and
- may be NULL. If NULL is specified, the
- EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
- @param FvInfo Points to a buffer which allows the
- EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
- The format of this buffer is specific to the FvFormat.
- For memory-mapped firmware volumes, this typically
- points to the first byte of the firmware volume.
- @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
- firmware volumes, this is typically the size of
- the firmware volume.
- @param ParentFvName If the new firmware volume originated from a file
- in a different firmware volume, then this parameter
- specifies the GUID name of the originating firmware
- volume. Otherwise, this parameter must be NULL.
- @param ParentFileName If the new firmware volume originated from a file
- in a different firmware volume, then this parameter
- specifies the GUID file name of the originating
- firmware file. Otherwise, this parameter must be NULL.
- @param AuthenticationStatus Authentication Status
-**/
-VOID
-EFIAPI
-PeiServicesInstallFvInfo2Ppi (
- IN CONST EFI_GUID *FvFormat, OPTIONAL
- IN CONST VOID *FvInfo,
- IN UINT32 FvInfoSize,
- IN CONST EFI_GUID *ParentFvName, OPTIONAL
- IN CONST EFI_GUID *ParentFileName, OPTIONAL
- IN UINT32 AuthenticationStatus
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PeiServicesTablePointerLib.h b/Core/MdePkg/Include/Library/PeiServicesTablePointerLib.h
deleted file mode 100644
index 7ea6cc10c5..0000000000
--- a/Core/MdePkg/Include/Library/PeiServicesTablePointerLib.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
- Provides a service to retrieve a pointer to the PEI Services Table.
-
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PEI_SERVICES_TABLE_POINTER_LIB_H__
-#define __PEI_SERVICES_TABLE_POINTER_LIB_H__
-
-/**
- Retrieves the cached value of the PEI Services Table pointer.
-
- Returns the cached value of the PEI Services Table pointer in a CPU specific manner
- as specified in the CPU binding section of the Platform Initialization Pre-EFI
- Initialization Core Interface Specification.
-
- If the cached PEI Services Table pointer is NULL, then ASSERT().
-
- @return The pointer to PeiServices.
-
-**/
-CONST EFI_PEI_SERVICES **
-EFIAPI
-GetPeiServicesTablePointer (
- VOID
- );
-
-/**
- Caches a pointer PEI Services Table.
-
- Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer
- in a CPU specific manner as specified in the CPU binding section of the Platform Initialization
- Pre-EFI Initialization Core Interface Specification.
-
- If PeiServicesTablePointer is NULL, then ASSERT().
-
- @param PeiServicesTablePointer The address of PeiServices pointer.
-**/
-VOID
-EFIAPI
-SetPeiServicesTablePointer (
- IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
- );
-
-/**
- Perform CPU specific actions required to migrate the PEI Services Table
- pointer from temporary RAM to permanent RAM.
-
- For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
- immediately preceding the Interrupt Descriptor Table (IDT) in memory.
- For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
- immediately preceding the Interrupt Descriptor Table (IDT) in memory.
- For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
- a dedicated CPU register. This means that there is no memory storage
- associated with storing the PEI Services Table pointer, so no additional
- migration actions are required for Itanium or ARM CPUs.
-
-**/
-VOID
-EFIAPI
-MigratePeiServicesTablePointer (
- VOID
- );
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/PeimEntryPoint.h b/Core/MdePkg/Include/Library/PeimEntryPoint.h
deleted file mode 100644
index f4b752ef96..0000000000
--- a/Core/MdePkg/Include/Library/PeimEntryPoint.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/** @file
- Module entry point library for PEIM.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MODULE_ENTRY_POINT_H__
-#define __MODULE_ENTRY_POINT_H__
-
-///
-/// Declare the EFI/UEFI Specification Revision to which this driver is implemented
-///
-extern CONST UINT32 _gPeimRevision;
-
-
-/**
- The entry point of PE/COFF Image for a PEIM.
-
- This function is the entry point for a PEIM. This function must call ProcessLibraryConstructorList()
- and ProcessModuleEntryPointList(). The return value from ProcessModuleEntryPointList() is returned.
- If _gPeimRevision is not zero and PeiServices->Hdr.Revision is less than _gPeimRevison, then ASSERT().
-
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
-
- @retval EFI_SUCCESS The PEIM executed normally.
- @retval !EFI_SUCCESS The PEIM failed to execute normally.
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );
-
-
-/**
- Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
-
- This function is required to call _ModuleEntryPoint() passing in FileHandle and PeiServices.
-
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
-
- @retval EFI_SUCCESS The PEIM executed normally.
- @retval !EFI_SUCCESS The PEIM failed to execute normally.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );
-
-/**
- Autogenerated function that calls the library constructors for all of the module's
- dependent libraries.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of library constructors for the set of library instances that a
- module depends on. This includes library instances that a module depends on directly and library
- instances that a module depends on indirectly through other libraries.
- This function is autogenerated by build tools and those build tools are responsible for collecting
- the set of library instances, determine which ones have constructors, and calling the library
- constructors in the proper order based upon each of the library instances own dependencies.
-
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );
-
-/**
- Autogenerated function that calls a set of module entry points.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of module entry points.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the module entry points and calling them in a specified order.
-
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
-
- @retval EFI_SUCCESS The PEIM executed normally.
- @retval !EFI_SUCCESS The PEIM failed to execute normally.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PerformanceLib.h b/Core/MdePkg/Include/Library/PerformanceLib.h
deleted file mode 100644
index 3ecd62bd20..0000000000
--- a/Core/MdePkg/Include/Library/PerformanceLib.h
+++ /dev/null
@@ -1,366 +0,0 @@
-/** @file
- Provides services to log the execution times and retrieve them later.
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PERFORMANCE_LIB_H__
-#define __PERFORMANCE_LIB_H__
-
-///
-/// Performance library propery mask bits
-///
-#define PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED 0x00000001
-
-/**
- Creates a record for the beginning of a performance measurement.
-
- Creates a record that contains the Handle, Token, and Module.
- If TimeStamp is not zero, then TimeStamp is added to the record as the start time.
- If TimeStamp is zero, then this function reads the current time stamp
- and adds that time stamp value to the record as the start time.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
-
- @retval RETURN_SUCCESS The start of the measurement was recorded.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.
- @retval RETURN_DEVICE_ERROR A device error reading the time stamp.
-
-**/
-RETURN_STATUS
-EFIAPI
-StartPerformanceMeasurement (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp
- );
-
-/**
- Fills in the end time of a performance measurement.
-
- Looks up the record that matches Handle, Token, and Module.
- If the record can not be found then return RETURN_NOT_FOUND.
- If the record is found and TimeStamp is not zero,
- then TimeStamp is added to the record as the end time.
- If the record is found and TimeStamp is zero, then this function reads
- the current time stamp and adds that time stamp value to the record as the end time.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
-
- @retval RETURN_SUCCESS The end of the measurement was recorded.
- @retval RETURN_NOT_FOUND The specified measurement record could not be found.
- @retval RETURN_DEVICE_ERROR A device error reading the time stamp.
-
-**/
-RETURN_STATUS
-EFIAPI
-EndPerformanceMeasurement (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp
- );
-
-/**
- Attempts to retrieve a performance measurement log entry from the performance measurement log.
- It can also retrieve the log created by StartPerformanceMeasurementEx and EndPerformanceMeasurementEx,
- and then eliminate the Identifier.
-
- Attempts to retrieve the performance log entry specified by LogEntryKey. If LogEntryKey is
- zero on entry, then an attempt is made to retrieve the first entry from the performance log,
- and the key for the second entry in the log is returned. If the performance log is empty,
- then no entry is retrieved and zero is returned. If LogEntryKey is not zero, then the performance
- log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is
- returned. If LogEntryKey is the key for the last entry in the log, then the last log entry is
- retrieved and an implementation specific non-zero key value that specifies the end of the performance
- log is returned. If LogEntryKey is equal this implementation specific non-zero key value, then no entry
- is retrieved and zero is returned. In the cases where a performance log entry can be returned,
- the log entry is returned in Handle, Token, Module, StartTimeStamp, and EndTimeStamp.
- If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT().
- If Handle is NULL, then ASSERT().
- If Token is NULL, then ASSERT().
- If Module is NULL, then ASSERT().
- If StartTimeStamp is NULL, then ASSERT().
- If EndTimeStamp is NULL, then ASSERT().
-
- @param LogEntryKey On entry, the key of the performance measurement log entry to retrieve.
- 0, then the first performance measurement log entry is retrieved.
- On exit, the key of the next performance lof entry entry.
- @param Handle Pointer to environment specific context used to identify the component
- being measured.
- @param Token Pointer to a Null-terminated ASCII string that identifies the component
- being measured.
- @param Module Pointer to a Null-terminated ASCII string that identifies the module
- being measured.
- @param StartTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement
- was started.
- @param EndTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement
- was ended.
-
- @return The key for the next performance log entry (in general case).
-
-**/
-UINTN
-EFIAPI
-GetPerformanceMeasurement (
- IN UINTN LogEntryKey,
- OUT CONST VOID **Handle,
- OUT CONST CHAR8 **Token,
- OUT CONST CHAR8 **Module,
- OUT UINT64 *StartTimeStamp,
- OUT UINT64 *EndTimeStamp
- );
-
-/**
- Creates a record for the beginning of a performance measurement.
-
- Creates a record that contains the Handle, Token, Module and Identifier.
- If TimeStamp is not zero, then TimeStamp is added to the record as the start time.
- If TimeStamp is zero, then this function reads the current time stamp
- and adds that time stamp value to the record as the start time.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
- @param Identifier 32-bit identifier. If the value is 0, the created record
- is same as the one created by StartPerformanceMeasurement.
-
- @retval RETURN_SUCCESS The start of the measurement was recorded.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.
- @retval RETURN_DEVICE_ERROR A device error reading the time stamp.
-
-**/
-RETURN_STATUS
-EFIAPI
-StartPerformanceMeasurementEx (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp,
- IN UINT32 Identifier
- );
-
-/**
- Fills in the end time of a performance measurement.
-
- Looks up the record that matches Handle, Token and Module.
- If the record can not be found then return RETURN_NOT_FOUND.
- If the record is found and TimeStamp is not zero,
- then TimeStamp is added to the record as the end time.
- If the record is found and TimeStamp is zero, then this function reads
- the current time stamp and adds that time stamp value to the record as the end time.
-
- @param Handle Pointer to environment specific context used
- to identify the component being measured.
- @param Token Pointer to a Null-terminated ASCII string
- that identifies the component being measured.
- @param Module Pointer to a Null-terminated ASCII string
- that identifies the module being measured.
- @param TimeStamp 64-bit time stamp.
- @param Identifier 32-bit identifier. If the value is 0, the found record
- is same as the one found by EndPerformanceMeasurement.
-
- @retval RETURN_SUCCESS The end of the measurement was recorded.
- @retval RETURN_NOT_FOUND The specified measurement record could not be found.
- @retval RETURN_DEVICE_ERROR A device error reading the time stamp.
-
-**/
-RETURN_STATUS
-EFIAPI
-EndPerformanceMeasurementEx (
- IN CONST VOID *Handle, OPTIONAL
- IN CONST CHAR8 *Token, OPTIONAL
- IN CONST CHAR8 *Module, OPTIONAL
- IN UINT64 TimeStamp,
- IN UINT32 Identifier
- );
-
-/**
- Attempts to retrieve a performance measurement log entry from the performance measurement log.
- It can also retrieve the log created by StartPerformanceMeasurement and EndPerformanceMeasurement,
- and then assign the Identifier with 0.
-
- Attempts to retrieve the performance log entry specified by LogEntryKey. If LogEntryKey is
- zero on entry, then an attempt is made to retrieve the first entry from the performance log,
- and the key for the second entry in the log is returned. If the performance log is empty,
- then no entry is retrieved and zero is returned. If LogEntryKey is not zero, then the performance
- log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is
- returned. If LogEntryKey is the key for the last entry in the log, then the last log entry is
- retrieved and an implementation specific non-zero key value that specifies the end of the performance
- log is returned. If LogEntryKey is equal this implementation specific non-zero key value, then no entry
- is retrieved and zero is returned. In the cases where a performance log entry can be returned,
- the log entry is returned in Handle, Token, Module, StartTimeStamp, EndTimeStamp and Identifier.
- If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT().
- If Handle is NULL, then ASSERT().
- If Token is NULL, then ASSERT().
- If Module is NULL, then ASSERT().
- If StartTimeStamp is NULL, then ASSERT().
- If EndTimeStamp is NULL, then ASSERT().
- If Identifier is NULL, then ASSERT().
-
- @param LogEntryKey On entry, the key of the performance measurement log entry to retrieve.
- 0, then the first performance measurement log entry is retrieved.
- On exit, the key of the next performance of entry entry.
- @param Handle Pointer to environment specific context used to identify the component
- being measured.
- @param Token Pointer to a Null-terminated ASCII string that identifies the component
- being measured.
- @param Module Pointer to a Null-terminated ASCII string that identifies the module
- being measured.
- @param StartTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement
- was started.
- @param EndTimeStamp Pointer to the 64-bit time stamp that was recorded when the measurement
- was ended.
- @param Identifier Pointer to the 32-bit identifier that was recorded.
-
- @return The key for the next performance log entry (in general case).
-
-**/
-UINTN
-EFIAPI
-GetPerformanceMeasurementEx (
- IN UINTN LogEntryKey,
- OUT CONST VOID **Handle,
- OUT CONST CHAR8 **Token,
- OUT CONST CHAR8 **Module,
- OUT UINT64 *StartTimeStamp,
- OUT UINT64 *EndTimeStamp,
- OUT UINT32 *Identifier
- );
-
-/**
- Returns TRUE if the performance measurement macros are enabled.
-
- This function returns TRUE if the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
- PcdPerformanceLibraryPropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
- PcdPerformanceLibraryPropertyMask is set.
- @retval FALSE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
- PcdPerformanceLibraryPropertyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-PerformanceMeasurementEnabled (
- VOID
- );
-
-/**
- Macro that calls EndPerformanceMeasurement().
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then EndPerformanceMeasurement() is called.
-
-**/
-#define PERF_END(Handle, Token, Module, TimeStamp) \
- do { \
- if (PerformanceMeasurementEnabled ()) { \
- EndPerformanceMeasurement (Handle, Token, Module, TimeStamp); \
- } \
- } while (FALSE)
-
-/**
- Macro that calls StartPerformanceMeasurement().
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then StartPerformanceMeasurement() is called.
-
-**/
-#define PERF_START(Handle, Token, Module, TimeStamp) \
- do { \
- if (PerformanceMeasurementEnabled ()) { \
- StartPerformanceMeasurement (Handle, Token, Module, TimeStamp); \
- } \
- } while (FALSE)
-
-/**
- Macro that calls EndPerformanceMeasurementEx().
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then EndPerformanceMeasurementEx() is called.
-
-**/
-#define PERF_END_EX(Handle, Token, Module, TimeStamp, Identifier) \
- do { \
- if (PerformanceMeasurementEnabled ()) { \
- EndPerformanceMeasurementEx (Handle, Token, Module, TimeStamp, Identifier); \
- } \
- } while (FALSE)
-
-/**
- Macro that calls StartPerformanceMeasurementEx().
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then StartPerformanceMeasurementEx() is called.
-
-**/
-#define PERF_START_EX(Handle, Token, Module, TimeStamp, Identifier) \
- do { \
- if (PerformanceMeasurementEnabled ()) { \
- StartPerformanceMeasurementEx (Handle, Token, Module, TimeStamp, Identifier); \
- } \
- } while (FALSE)
-
-/**
- Macro that marks the beginning of performance measurement source code.
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then this macro marks the beginning of source code that is included in a module.
- Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module.
-
-**/
-#define PERF_CODE_BEGIN() do { if (PerformanceMeasurementEnabled ()) { UINT8 __PerformanceCodeLocal
-
-/**
- Macro that marks the end of performance measurement source code.
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then this macro marks the end of source code that is included in a module.
- Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module.
-
-**/
-#define PERF_CODE_END() __PerformanceCodeLocal = 0; __PerformanceCodeLocal++; } } while (FALSE)
-
-/**
- Macro that declares a section of performance measurement source code.
-
- If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
- then the source code specified by Expression is included in a module.
- Otherwise, the source specified by Expression is not included in a module.
-
- @param Expression Performance measurement source code to include in a module.
-
-**/
-#define PERF_CODE(Expression) \
- PERF_CODE_BEGIN (); \
- Expression \
- PERF_CODE_END ()
-
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PostCodeLib.h b/Core/MdePkg/Include/Library/PostCodeLib.h
deleted file mode 100644
index 9a7a9e6a99..0000000000
--- a/Core/MdePkg/Include/Library/PostCodeLib.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/** @file
- Provides services to send progress/error codes to a POST card.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __POST_CODE_LIB_H__
-#define __POST_CODE_LIB_H__
-
-#define POST_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008
-#define POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010
-
-/**
- Sends a 32-bit value to a POST card.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- Some implementations of this library function may perform I/O operations
- directly to a POST card device. Other implementations may send Value to
- ReportStatusCode(), and the status code reporting mechanism will eventually
- display the 32-bit value on the status reporting device.
-
- PostCode() must actively prevent recursion. If PostCode() is called while
- processing another Post Code Library function, then
- PostCode() must return Value immediately.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return The 32-bit value to write to the POST card.
-
-**/
-UINT32
-EFIAPI
-PostCode (
- IN UINT32 Value
- );
-
-
-/**
- Sends a 32-bit value to a POST and associated ASCII string.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- If Description is not NULL, then the ASCII string specified by Description is
- also passed to the handler that displays the POST card value. Some
- implementations of this library function may perform I/O operations directly
- to a POST card device. Other implementations may send Value to ReportStatusCode(),
- and the status code reporting mechanism will eventually display the 32-bit
- value on the status reporting device.
-
- PostCodeWithDescription()must actively prevent recursion. If
- PostCodeWithDescription() is called while processing another any other Post
- Code Library function, then PostCodeWithDescription() must return Value
- immediately.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value. This is an optional parameter that may
- be NULL.
-
- @return The 32-bit value to write to the POST card.
-
-**/
-UINT32
-EFIAPI
-PostCodeWithDescription (
- IN UINT32 Value,
- IN CONST CHAR8 *Description OPTIONAL
- );
-
-
-/**
- Returns TRUE if POST Codes are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-PostCodeEnabled (
- VOID
- );
-
-
-/**
- Returns TRUE if POST code descriptions are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-PostCodeDescriptionEnabled (
- VOID
- );
-
-
-/**
- Sends a 32-bit value to a POST card.
-
- If POST codes are enabled in PcdPostCodeProperyMask, then call PostCode()
- passing in Value. Value is returned.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return Value The 32-bit value to write to the POST card.
-
-**/
-#define POST_CODE(Value) PostCodeEnabled() ? PostCode(Value) : Value
-
-/**
- Sends a 32-bit value to a POST and associated ASCII string.
-
- If POST codes and POST code descriptions are enabled in
- PcdPostCodeProperyMask, then call PostCodeWithDescription() passing in
- Value and Description. If only POST codes are enabled, then call PostCode()
- passing in Value. Value is returned.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value.
-
- @return Value The 32-bit value to write to the POST card.
-**/
-#define POST_CODE_WITH_DESCRIPTION(Value,Description) \
- PostCodeEnabled() ? \
- (PostCodeDescriptionEnabled() ? \
- PostCodeWithDescription(Value,Description) : \
- PostCode(Value)) : \
- Value
-
-#endif
diff --git a/Core/MdePkg/Include/Library/PrintLib.h b/Core/MdePkg/Include/Library/PrintLib.h
deleted file mode 100644
index 80a4fd21d3..0000000000
--- a/Core/MdePkg/Include/Library/PrintLib.h
+++ /dev/null
@@ -1,1051 +0,0 @@
-/** @file
- Provides services to print a formatted string to a buffer. All combinations of
- Unicode and ASCII strings are supported.
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- The Print Library functions provide a simple means to produce formatted output
- strings. Many of the output functions use a format string to describe how to
- format the output of variable arguments. The format string consists of normal
- text and argument descriptors. There are no restrictions for how the normal
- text and argument descriptors can be mixed. The following end of line(EOL)
- translations must be performed on the contents of the format string:
-
- - '\\r' is translated to '\\r'
- - '\\r\\n' is translated to '\\r\\n'
- - '\\n' is translated to '\\r\\n'
- - '\\n\\r' is translated to '\\r\\n'
-
- This does not follow the ANSI C standard for sprint(). The format of argument
- descriptors is described below. The ANSI C standard for sprint() has been
- followed for some of the format types, and has not been followed for others.
- The exceptions are noted below.
-
- %[flags][width][.precision]type
-
- [flags]:
- - -
- - The field is left justified. If not flag is not specified, then the
- field is right justified.
- - space
- - Prefix a space character to a number. Only valid for types X, x, and d.
- - +
- - Prefix a plus character to a number. Only valid for types X, x, and d.
- If both space and + are specified, then space is ignored.
- - 0
- - Pad with 0 characters to the left of a number. Only valid for types
- X, x, and d.
- - ,
- - Place a comma every 3rd digit of the number. Only valid for type d.
- If 0 is also specified, then 0 is ignored.
- - L, l
- - The number being printed is size UINT64. Only valid for types X, x, and d.
- If this flag is not specified, then the number being printed is size int.
- - NOTE: All invalid flags are ignored.
-
- [width]:
-
- - *
- - The width of the field is specified by a UINTN argument in the
- argument list.
- - number
- - The number specified as a decimal value represents the width of
- the field.
- - NOTE: If [width] is not specified, then a field width of 0 is assumed.
-
- [.precision]:
-
- - *
- - The precision of the field is specified by a UINTN argument in the
- argument list.
- - number
- - The number specified as a decimal value represents the precision of
- the field.
- - NOTE: If [.precision] is not specified, then a precision of 0 is assumed.
-
- type:
-
- - %
- - Print a %%.
- - c
- - The argument is a Unicode character. ASCII characters can be printed
- using this type too by making sure bits 8..15 of the argument are set to 0.
- - x
- - The argument is an unsigned hexadecimal number. The characters used are 0..9 and
- A..F. If the flag 'L' is not specified, then the argument is assumed
- to be size int. This does not follow ANSI C.
- - X
- - The argument is an unsigned hexadecimal number and the number is padded with
- zeros. This is equivalent to a format string of "0x". If the flag
- 'L' is not specified, then the argument is assumed to be size int.
- This does not follow ANSI C.
- - d
- - The argument is a signed decimal number. If the flag 'L' is not specified,
- then the argument is assumed to be size int.
- - u
- - The argument is a unsigned decimal number. If the flag 'L' is not specified,
- then the argument is assumed to be size int.
- - p
- - The argument is a pointer that is a (VOID *), and it is printed as an
- unsigned hexadecimal number The characters used are 0..9 and A..F.
- - a
- - The argument is a pointer to an ASCII string.
- This does not follow ANSI C.
- - S, s
- - The argument is a pointer to a Unicode string.
- This does not follow ANSI C.
- - g
- - The argument is a pointer to a GUID structure. The GUID is printed
- in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
- This does not follow ANSI C.
- - t
- - The argument is a pointer to an EFI_TIME structure. The time and
- date are printed in the format "mm/dd/yyyy hh:mm" where mm is the
- month zero padded, dd is the day zero padded, yyyy is the year zero
- padded, hh is the hour zero padded, and mm is minutes zero padded.
- This does not follow ANSI C.
- - r
- - The argument is a RETURN_STATUS value. This value is converted to
- a string following the table below. This does not follow ANSI C.
- - RETURN_SUCCESS
- - "Success"
- - RETURN_LOAD_ERROR
- - "Load Error"
- - RETURN_INVALID_PARAMETER
- - "Invalid Parameter"
- - RETURN_UNSUPPORTED
- - "Unsupported"
- - RETURN_BAD_BUFFER_SIZE
- - "Bad Buffer Size"
- - RETURN_BUFFER_TOO_SMALL
- - "Buffer Too Small"
- - RETURN_NOT_READY
- - "Not Ready"
- - RETURN_DEVICE_ERROR
- - "Device Error"
- - RETURN_WRITE_PROTECTED
- - "Write Protected"
- - RETURN_OUT_OF_RESOURCES
- - "Out of Resources"
- - RETURN_VOLUME_CORRUPTED
- - "Volume Corrupt"
- - RETURN_VOLUME_FULL
- - "Volume Full"
- - RETURN_NO_MEDIA
- - "No Media"
- - RETURN_MEDIA_CHANGED
- - "Media changed"
- - RETURN_NOT_FOUND
- - "Not Found"
- - RETURN_ACCESS_DENIED
- - "Access Denied"
- - RETURN_NO_RESPONSE
- - "No Response"
- - RETURN_NO_MAPPING
- - "No mapping"
- - RETURN_TIMEOUT
- - "Time out"
- - RETURN_NOT_STARTED
- - "Not started"
- - RETURN_ALREADY_STARTED
- - "Already started"
- - RETURN_ABORTED
- - "Aborted"
- - RETURN_ICMP_ERROR
- - "ICMP Error"
- - RETURN_TFTP_ERROR
- - "TFTP Error"
- - RETURN_PROTOCOL_ERROR
- - "Protocol Error"
- - RETURN_WARN_UNKNOWN_GLYPH
- - "Warning Unknown Glyph"
- - RETURN_WARN_DELETE_FAILURE
- - "Warning Delete Failure"
- - RETURN_WARN_WRITE_FAILURE
- - "Warning Write Failure"
- - RETURN_WARN_BUFFER_TOO_SMALL
- - "Warning Buffer Too Small"
-
-**/
-
-#ifndef __PRINT_LIB_H__
-#define __PRINT_LIB_H__
-
-///
-/// Define the maximum number of characters that are required to
-/// encode with a NULL terminator a decimal, hexadecimal, GUID,
-/// or TIME value.
-///
-/// Maximum Length Decimal String = 28
-/// "-9,223,372,036,854,775,808"
-/// Maximum Length Hexadecimal String = 17
-/// "FFFFFFFFFFFFFFFF"
-/// Maximum Length GUID = 37
-/// "00000000-0000-0000-0000-000000000000"
-/// Maximum Length TIME = 18
-/// "12/12/2006 12:12"
-///
-#define MAXIMUM_VALUE_CHARACTERS 38
-
-///
-/// Flags bitmask values use in UnicodeValueToString() and
-/// AsciiValueToString()
-///
-#define LEFT_JUSTIFY 0x01
-#define COMMA_TYPE 0x08
-#define PREFIX_ZERO 0x20
-#define RADIX_HEX 0x80
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on
- a Null-terminated Unicode format string and a VA_LIST argument list.
-
- This function is similar as vsnprintf_s defined in C11.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
- (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
- buffer is unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeVSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on
- a Null-terminated Unicode format string and a BASE_LIST argument list.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
- (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
- buffer is unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated Unicode format string.
- @param Marker BASE_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeBSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN BASE_LIST Marker
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- Unicode format string and variable argument list.
-
- This function is similar as snprintf_s defined in C11.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
- (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
- buffer is unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0 or 1, then the output buffer is unmodified and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated Unicode format string.
- @param ... Variable argument list whose contents are accessed based on the
- format string specified by FormatString.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- ...
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list.
-
- This function is similar as vsnprintf_s defined in C11.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
- (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
- buffer is unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated ASCII format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeVSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and a BASE_LIST argument list.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
- (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
- buffer is unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated ASCII format string.
- @param Marker BASE_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeBSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN BASE_LIST Marker
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- This function is similar as snprintf_s defined in C11.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and BufferSize >
- (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1), then ASSERT(). Also, the output
- buffer is unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated ASCII format string.
- @param ... Variable argument list whose contents are accessed based on the
- format string specified by FormatString.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- ...
- );
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Converts a decimal value to a Null-terminated Unicode string.
-
- Converts the decimal number specified by Value to a Null-terminated Unicode
- string specified by Buffer containing at most Width characters. No padding of spaces
- is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of Unicode characters in Buffer is returned, not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first
- Width characters are returned, and the total number of characters
- required to perform the conversion is returned.
- Additional conversion parameters are specified in Flags.
-
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
- formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer The pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Unicode characters to place in Buffer, not including
- the Null-terminator.
-
- @return The number of Unicode characters in Buffer, not including the Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeValueToString (
- IN OUT CHAR16 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- );
-
-#endif
-
-/**
- Converts a decimal value to a Null-terminated Unicode string.
-
- Converts the decimal number specified by Value to a Null-terminated Unicode
- string specified by Buffer containing at most Width characters. No padding of
- spaces is ever performed. If Width is 0 then a width of
- MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
- Width characters, then only the first Width characters are placed in Buffer.
- Additional conversion parameters are specified in Flags.
-
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
- commas are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be formatted in
- hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
- Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
- Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the
- Null-terminator add up to Width characters.
-
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- @param Buffer The pointer to the output buffer for the produced
- Null-terminated Unicode string.
- @param BufferSize The size of Buffer in bytes, including the
- Null-terminator.
- @param Flags The bitmask of flags that specify left justification,
- zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Unicode characters to place in
- Buffer, not including the Null-terminator.
-
- @retval RETURN_SUCCESS The decimal value is converted.
- @retval RETURN_BUFFER_TOO_SMALL If BufferSize cannot hold the converted
- value.
- @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and BufferSize is greater than
- (PcdMaximumUnicodeStringLength *
- sizeof (CHAR16) + 1).
- If unsupported bits are set in Flags.
- If both COMMA_TYPE and RADIX_HEX are set in
- Flags.
- If Width >= MAXIMUM_VALUE_CHARACTERS.
-
-**/
-RETURN_STATUS
-EFIAPI
-UnicodeValueToStringS (
- IN OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list.
-
- This function is similar as vsnprintf_s defined in C11.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and BufferSize >
- (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
- is unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated ASCII format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiVSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and a BASE_LIST argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and BufferSize >
- (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
- is unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated ASCII format string.
- @param Marker BASE_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiBSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN BASE_LIST Marker
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- This function is similar as snprintf_s defined in C11.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and BufferSize >
- (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
- is unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength Ascii characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated ASCII format string.
- @param ... Variable argument list whose contents are accessed based on the
- format string specified by FormatString.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- ...
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- Unicode format string and a VA_LIST argument list.
-
- This function is similar as vsnprintf_s defined in C11.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and BufferSize >
- (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
- is unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiVSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- Unicode format string and a BASE_LIST argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and BufferSize >
- (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
- is unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated Unicode format string.
- @param Marker BASE_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiBSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN BASE_LIST Marker
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- Unicode format string and variable argument list.
-
- This function is similar as snprintf_s defined in C11.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
-
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If BufferSize > 0 and FormatString is NULL, then ASSERT(). Also, the output buffer is
- unmodified and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and BufferSize >
- (PcdMaximumAsciiStringLength * sizeof (CHAR8)), then ASSERT(). Also, the output buffer
- is unmodified and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT(). Also, the output buffer is unmodified and 0 is returned.
-
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString A Null-terminated Unicode format string.
- @param ... Variable argument list whose contents are accessed based on the
- format string specified by FormatString.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- ...
- );
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Converts a decimal value to a Null-terminated ASCII string.
-
- Converts the decimal number specified by Value to a Null-terminated ASCII string
- specified by Buffer containing at most Width characters. No padding of spaces
- is ever performed.
- If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of ASCII characters in Buffer is returned, not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first Width
- characters are returned, and the total number of characters required to perform
- the conversion is returned.
- Additional conversion parameters are specified in Flags.
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
- formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
-
- If Buffer is NULL, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of ASCII characters to place in Buffer, not including
- the Null-terminator.
-
- @return The number of ASCII characters in Buffer, not including the Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiValueToString (
- OUT CHAR8 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- );
-
-#endif
-
-/**
- Converts a decimal value to a Null-terminated Ascii string.
-
- Converts the decimal number specified by Value to a Null-terminated Ascii
- string specified by Buffer containing at most Width characters. No padding of
- spaces is ever performed. If Width is 0 then a width of
- MAXIMUM_VALUE_CHARACTERS is assumed. If the conversion contains more than
- Width characters, then only the first Width characters are placed in Buffer.
- Additional conversion parameters are specified in Flags.
-
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and
- commas are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be formatted in
- hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in
- Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then
- Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the
- Null-terminator add up to Width characters.
-
- If an error would be returned, then the function will ASSERT().
-
- @param Buffer The pointer to the output buffer for the produced
- Null-terminated Ascii string.
- @param BufferSize The size of Buffer in bytes, including the
- Null-terminator.
- @param Flags The bitmask of flags that specify left justification,
- zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Ascii characters to place in
- Buffer, not including the Null-terminator.
-
- @retval RETURN_SUCCESS The decimal value is converted.
- @retval RETURN_BUFFER_TOO_SMALL If BufferSize cannot hold the converted
- value.
- @retval RETURN_INVALID_PARAMETER If Buffer is NULL.
- If PcdMaximumAsciiStringLength is not
- zero, and BufferSize is greater than
- PcdMaximumAsciiStringLength.
- If unsupported bits are set in Flags.
- If both COMMA_TYPE and RADIX_HEX are set in
- Flags.
- If Width >= MAXIMUM_VALUE_CHARACTERS.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiValueToStringS (
- IN OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- );
-
-/**
- Returns the number of characters that would be produced by if the formatted
- output were produced not including the Null-terminator.
-
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- If FormatString is NULL, then ASSERT() and 0 is returned.
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT() and 0 is returned.
-
- @param[in] FormatString A Null-terminated Unicode format string.
- @param[in] Marker VA_LIST marker for the variable argument list.
-
- @return The number of characters that would be produced, not including the
- Null-terminator.
-**/
-UINTN
-EFIAPI
-SPrintLength (
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Returns the number of characters that would be produced by if the formatted
- output were produced not including the Null-terminator.
-
- If FormatString is NULL, then ASSERT() and 0 is returned.
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more
- than PcdMaximumAsciiStringLength Ascii characters not including the
- Null-terminator, then ASSERT() and 0 is returned.
-
- @param[in] FormatString A Null-terminated ASCII format string.
- @param[in] Marker VA_LIST marker for the variable argument list.
-
- @return The number of characters that would be produced, not including the
- Null-terminator.
-**/
-UINTN
-EFIAPI
-SPrintLengthAsciiFormat (
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/ReportStatusCodeLib.h b/Core/MdePkg/Include/Library/ReportStatusCodeLib.h
deleted file mode 100644
index 3924fa20e8..0000000000
--- a/Core/MdePkg/Include/Library/ReportStatusCodeLib.h
+++ /dev/null
@@ -1,492 +0,0 @@
-/** @file
- Provides services to log status code records.
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __REPORT_STATUS_CODE_LIB_H__
-#define __REPORT_STATUS_CODE_LIB_H__
-
-#include <Uefi/UefiBaseType.h>
-#include <Pi/PiStatusCode.h>
-#include <Protocol/DevicePath.h>
-
-//
-// Declare bits for PcdReportStatusCodePropertyMask
-//
-#define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001
-#define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002
-#define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004
-
-/**
- Converts a status code to an 8-bit POST code value.
-
- Converts the status code specified by CodeType and Value to an 8-bit POST code
- and returns the 8-bit POST code in PostCode. If CodeType is an
- EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
- are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
- 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
-
- If PostCode is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param PostCode A pointer to the 8-bit POST code value to return.
-
- @retval TRUE The status code specified by CodeType and Value was converted
- to an 8-bit POST code and returned in PostCode.
- @retval FALSE The status code specified by CodeType and Value could not be
- converted to an 8-bit POST code value.
-
-**/
-BOOLEAN
-EFIAPI
-CodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- );
-
-
-/**
- Extracts ASSERT() information from a status code structure.
-
- Converts the status code specified by CodeType, Value, and Data to the ASSERT()
- arguments specified by Filename, Description, and LineNumber. If CodeType is
- an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
- Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
- Filename, Description, and LineNumber from the optional data area of the
- status code buffer specified by Data. The optional data area of Data contains
- a Null-terminated ASCII string for the FileName, followed by a Null-terminated
- ASCII string for the Description, followed by a 32-bit LineNumber. If the
- ASSERT() information could be extracted from Data, then return TRUE.
- Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If Filename is NULL, then ASSERT().
- If Description is NULL, then ASSERT().
- If LineNumber is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param Data The pointer to status code data buffer.
- @param Filename The pointer to the source file name that generated the ASSERT().
- @param Description The pointer to the description of the ASSERT().
- @param LineNumber The pointer to source line number that generated the ASSERT().
-
- @retval TRUE The status code specified by CodeType, Value, and Data was
- converted ASSERT() arguments specified by Filename, Description,
- and LineNumber.
- @retval FALSE The status code specified by CodeType, Value, and Data could
- not be converted to ASSERT() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-ReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- );
-
-
-/**
- Extracts DEBUG() information from a status code structure.
-
- Converts the status code specified by Data to the DEBUG() arguments specified
- by ErrorLevel, Marker, and Format. If type GUID in Data is
- EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
- Format from the optional data area of the status code buffer specified by Data.
- The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
- which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
- the Format. If the DEBUG() information could be extracted from Data, then
- return TRUE. Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If ErrorLevel is NULL, then ASSERT().
- If Marker is NULL, then ASSERT().
- If Format is NULL, then ASSERT().
-
- @param Data The pointer to status code data buffer.
- @param ErrorLevel The pointer to error level mask for a debug message.
- @param Marker The pointer to the variable argument list associated with Format.
- @param Format The pointer to a Null-terminated ASCII format string of a
- debug message.
-
- @retval TRUE The status code specified by Data was converted DEBUG() arguments
- specified by ErrorLevel, Marker, and Format.
- @retval FALSE The status code specified by Data could not be converted to
- DEBUG() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-ReportStatusCodeExtractDebugInfo (
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT BASE_LIST *Marker,
- OUT CHAR8 **Format
- );
-
-
-/**
- Reports a status code.
-
- Reports the status code specified by the parameters Type and Value. Status
- code also require an instance, caller ID, and extended data. This function
- passed in a zero instance, NULL extended data, and a caller ID of
- gEfiCallerIdGuid, which is the GUID for the module.
-
- ReportStatusCode()must actively prevent recursion. If ReportStatusCode()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCode() must return immediately.
-
- @param Type Status code type.
- @param Value Status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a
- device error.
- @retval EFI_UNSUPPORTED The report status code is not supported.
-
-**/
-EFI_STATUS
-EFIAPI
-ReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value
- );
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data.
-
- Allocates and fills in the extended data section of a status code with the
- Device Path Protocol specified by DevicePath. This function is responsible
- for allocating a buffer large enough for the standard header and the device
- path. The standard header is filled in with an implementation dependent GUID.
- The status code is reported with a zero instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithDevicePath()must actively prevent recursion. If
- ReportStatusCodeWithDevicePath() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithDevicePath()
- must return EFI_DEVICE_ERROR immediately.
-
- If DevicePath is NULL, then ASSERT().
-
- @param Type The status code type.
- @param Value The status code value.
- @param DevicePath The pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED The report status code is not supported.
- @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function
- is already in progress.
-
-**/
-EFI_STATUS
-EFIAPI
-ReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-
-/**
- Reports a status code with an extended data buffer.
-
- Allocates and fills in the extended data section of a status code with the
- extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
- is assumed to be one of the data structures specified in Related Definitions.
- These data structure do not have the standard header, so this function is
- responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled
- in with an implementation dependent GUID. The status code is reported
- with a zero instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithExtendedData()must actively prevent recursion. If
- ReportStatusCodeWithExtendedData() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithExtendedData()
- must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL, then ASSERT().
- If ExtendedDataSize is 0, then ASSERT().
-
- @param Type The status code type.
- @param Value The status code value.
- @param ExtendedData The pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED The report status code is not supported.
- @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function
- is already in progress.
-
-**/
-EFI_STATUS
-EFIAPI
-ReportStatusCodeWithExtendedData (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST VOID *ExtendedData,
- IN UINTN ExtendedDataSize
- );
-
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDataGuid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type The status code type.
- @param Value The status code value.
- @param Instance The status code instance number.
- @param CallerId The pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid The pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with an implementation dependent GUID.
- @param ExtendedData The pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED The report status code is not supported.
- @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function
- is already in progress.
-
-**/
-EFI_STATUS
-EFIAPI
-ReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- );
-
-
-/**
- Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-ReportProgressCodeEnabled (
- VOID
- );
-
-
-/**
- Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise, FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-ReportErrorCodeEnabled (
- VOID
- );
-
-
-/**
- Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-ReportDebugCodeEnabled (
- VOID
- );
-
-
-/**
- Reports a status code with minimal parameters if the status code type is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type
- and Value.
-
- @param Type The status code type.
- @param Value The status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.
- @retval EFI_UNSUPPORTED Report status code is not supported.
-
-**/
-#define REPORT_STATUS_CODE(Type,Value) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCode(Type,Value) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCode(Type,Value) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCode(Type,Value) : \
- EFI_UNSUPPORTED
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data if the
- status code type is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()
- passing in Type, Value, and DevicePath.
-
- @param Type The status code type.
- @param Value The status code value.
- @param DevicePath Pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED The report status code is not supported.
- @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function
- is already in progress.
-
-**/
-#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
- EFI_UNSUPPORTED
-
-
-/**
- Reports a status code with an extended data buffer if the status code type
- is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData()
- passing in Type, Value, ExtendedData, and ExtendedDataSize.
-
- @param Type The status code type.
- @param Value The status code value.
- @param ExtendedData The pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED The report status code is not supported.
- @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function
- is already in progress.
-
-**/
-#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
- EFI_UNSUPPORTED
-
-/**
- Reports a status code specifying all parameters if the status code type is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type,
- Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.
-
- @param Type The status code type.
- @param Value The status code value.
- @param Instance The status code instance number.
- @param CallerId The pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with an implementation dependent GUID.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section if it was specified.
- @retval EFI_UNSUPPORTED The report status code is not supported.
- @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function
- is already in progress.
-
-**/
-#define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
- EFI_UNSUPPORTED
-
-#endif
diff --git a/Core/MdePkg/Include/Library/ResourcePublicationLib.h b/Core/MdePkg/Include/Library/ResourcePublicationLib.h
deleted file mode 100644
index cd51c7f65f..0000000000
--- a/Core/MdePkg/Include/Library/ResourcePublicationLib.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Provides a service to publish discovered system resources.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __RESOURCE_PUBLICATION_LIB__
-#define __RESOURCE_PUBLICATION_LIB__
-
-/**
- Declares the presence of permanent system memory in the platform.
-
- Declares that the system memory buffer specified by MemoryBegin and MemoryLength
- as permanent memory that may be used for general purpose use by software.
- The amount of memory available to software may be less than MemoryLength
- if published memory has alignment restrictions.
- If MemoryLength is 0, then ASSERT().
- If MemoryLength is greater than (MAX_ADDRESS - MemoryBegin + 1), then ASSERT().
-
- @param MemoryBegin The start address of the memory being declared.
- @param MemoryLength The number of bytes of memory being declared.
-
- @retval RETURN_SUCCESS The memory buffer was published.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer
-
-**/
-RETURN_STATUS
-EFIAPI
-PublishSystemMemory (
- IN PHYSICAL_ADDRESS MemoryBegin,
- IN UINT64 MemoryLength
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/RngLib.h b/Core/MdePkg/Include/Library/RngLib.h
deleted file mode 100644
index ece4394168..0000000000
--- a/Core/MdePkg/Include/Library/RngLib.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file
- Provides random number generator services.
-
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __RNG_LIB_H__
-#define __RNG_LIB_H__
-
-/**
- Generates a 16-bit random number.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the 16-bit random value.
-
- @retval TRUE Random number generated successfully.
- @retval FALSE Failed to generate the random number.
-
-**/
-BOOLEAN
-EFIAPI
-GetRandomNumber16 (
- OUT UINT16 *Rand
- );
-
-/**
- Generates a 32-bit random number.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the 32-bit random value.
-
- @retval TRUE Random number generated successfully.
- @retval FALSE Failed to generate the random number.
-
-**/
-BOOLEAN
-EFIAPI
-GetRandomNumber32 (
- OUT UINT32 *Rand
- );
-
-/**
- Generates a 64-bit random number.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the 64-bit random value.
-
- @retval TRUE Random number generated successfully.
- @retval FALSE Failed to generate the random number.
-
-**/
-BOOLEAN
-EFIAPI
-GetRandomNumber64 (
- OUT UINT64 *Rand
- );
-
-/**
- Generates a 128-bit random number.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the 128-bit random value.
-
- @retval TRUE Random number generated successfully.
- @retval FALSE Failed to generate the random number.
-
-**/
-BOOLEAN
-EFIAPI
-GetRandomNumber128 (
- OUT UINT64 *Rand
- );
-
-#endif // __RNG_LIB_H__
diff --git a/Core/MdePkg/Include/Library/S3BootScriptLib.h b/Core/MdePkg/Include/Library/S3BootScriptLib.h
deleted file mode 100644
index 3f43da8794..0000000000
--- a/Core/MdePkg/Include/Library/S3BootScriptLib.h
+++ /dev/null
@@ -1,602 +0,0 @@
-/** @file
- Defines library APIs used by modules to save EFI Boot Script Opcodes.
- These OpCode will be restored by S3 related modules.
- Note that some of the API defined in the Library class may not
- be provided in the Framework version library instance, which means some of these
- APIs cannot be used if the underlying firmware is Framework and not PI.
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions
- of the BSD License which accompanies this distribution. The
- full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _S3_BOOT_SCRIPT_LIB_H_
-#define _S3_BOOT_SCRIPT_LIB_H_
-
-#include <Library/BaseLib.h>
-#include <IndustryStandard/SmBus.h>
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the S3 Boot Script Library PCI functions.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..255 for PCI. Range 0..4095
- for PCI Express.
-
- @return The encoded PCI address.
-
-**/
-#define S3_BOOT_SCRIPT_LIB_PCI_ADDRESS(Bus,Device,Function,Register) \
- (UINT64) ( \
- (((UINTN) Bus) << 24) | \
- (((UINTN) Device) << 16) | \
- (((UINTN) Function) << 8) | \
- (((UINTN) (Register)) < 256 ? ((UINTN) (Register)) : (UINT64) (LShiftU64 ((UINT64) (Register), 32))))
-
-///
-/// S3 Boot Script Width.
-///
-typedef enum {
- S3BootScriptWidthUint8, ///< 8-bit operation.
- S3BootScriptWidthUint16, ///< 16-bit operation.
- S3BootScriptWidthUint32, ///< 32-bit operation.
- S3BootScriptWidthUint64, ///< 64-bit operation.
- S3BootScriptWidthFifoUint8, ///< 8-bit FIFO operation.
- S3BootScriptWidthFifoUint16, ///< 16-bit FIFO operation.
- S3BootScriptWidthFifoUint32, ///< 32-bit FIFO operation.
- S3BootScriptWidthFifoUint64, ///< 64-bit FIFO operation.
- S3BootScriptWidthFillUint8, ///< 8-bit Fill operation.
- S3BootScriptWidthFillUint16, ///< 16-bit Fill operation.
- S3BootScriptWidthFillUint32, ///< 32-bit Fill operation.
- S3BootScriptWidthFillUint64, ///< 64-bit Fill operation.
- S3BootScriptWidthMaximum
-} S3_BOOT_SCRIPT_LIB_WIDTH;
-
-/**
- Save I/O write to boot script.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Address The base address of the I/O operations.
- @param[in] Count The number of I/O operations to perform.
- @param[in] Buffer The source buffer from which to write data.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveIoWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Adds a record for an I/O modify operation into a S3 boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Address The base address of the I/O operations.
- @param[in] Data A pointer to the data to be OR-ed.
- @param[in] DataMask A pointer to the data mask to be AND-ed with the data
- read from the register.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveIoReadWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- );
-
-/**
- Adds a record for a memory write operation into a specified boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Address The base address of the memory operations
- @param[in] Count The number of memory operations to perform.
- @param[in] Buffer The source buffer from which to write the data.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveMemWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Adds a record for a memory modify operation into a specified boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Address The base address of the memory operations. Address needs
- alignment, if required
- @param[in] Data A pointer to the data to be OR-ed.
- @param[in] DataMask A pointer to the data mask to be AND-ed with the data
- read from the register.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveMemReadWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- );
-
-/**
- Adds a record for a PCI configuration space write operation into a specified boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Address The address within the PCI configuration space.
- @param[in] Count The number of PCI operations to perform.
- @param[in] Buffer The source buffer from which to write the data.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSavePciCfgWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Adds a record for a PCI configuration space modify operation into a specified boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Address The address within the PCI configuration space.
- @param[in] Data A pointer to the data to be OR-ed.The size depends on Width.
- @param[in] DataMask A pointer to the data mask to be AND-ed.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN__SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSavePciCfgReadWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- );
-
-/**
- Adds a record for a PCI configuration space modify operation into a specified boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Segment The PCI segment number for Address.
- @param[in] Address The address within the PCI configuration space.
- @param[in] Count The number of PCI operations to perform.
- @param[in] Buffer The source buffer from which to write the data.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSavePciCfg2Write (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT16 Segment,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- );
-
-/**
- Adds a record for a PCI configuration space modify operation into a specified boot script table.
-
- @param[in] Width The width of the I/O operations.
- @param[in] Segment The PCI segment number for Address.
- @param[in] Address The address within the PCI configuration space.
- @param[in] Data A pointer to the data to be OR-ed. The size depends on Width.
- @param[in] DataMask A pointer to the data mask to be AND-ed.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSavePciCfg2ReadWrite (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT16 Segment,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- );
-
-/**
- Adds a record for an SMBus command execution into a specified boot script table.
-
- @param[in] SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS
- Command, SMBUS Data Length, and PEC.
- @param[in] Operation Indicates which particular SMBus protocol it will use
- to execute the SMBus transactions.
- @param[in] Length A pointer to signify the number of bytes that this
- operation will do.
- @param[in] Buffer Contains the value of data to execute to the SMBUS
- slave device.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveSmbusExecute (
- IN UINTN SmBusAddress,
- IN EFI_SMBUS_OPERATION Operation,
- IN UINTN *Length,
- IN VOID *Buffer
- );
-
-/**
- Adds a record for an execution stall on the processor into a specified boot script table.
-
- @param[in] Duration The duration in microseconds of the stall.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveStall (
- IN UINTN Duration
- );
-
-/**
- Adds a record for dispatching specified arbitrary code into a specified boot script table.
-
- @param[in] EntryPoint The entry point of the code to be dispatched.
- @param[in] Context The argument to be passed into the EntryPoint of the code
- to be dispatched.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveDispatch2 (
- IN VOID *EntryPoint,
- IN VOID *Context
- );
-
-/**
- Adds a record for dispatching specified arbitrary code into a specified boot script table.
-
- @param[in] EntryPoint The entry point of the code to be dispatched.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveDispatch (
- IN VOID *EntryPoint
- );
-
-/**
- Adds a record for memory reads of the memory location and continues when the exit
- criteria is satisfied, or after a defined duration.
-
- Please aware, below interface is different with PI specification, Vol 5:
- EFI_S3_SAVE_STATE_PROTOCOL.Write() for EFI_BOOT_SCRIPT_MEM_POLL_OPCODE.
- "Duration" below is microseconds, while "Delay" in PI specification means
- the number of 100ns units to poll.
-
- @param[in] Width The width of the memory operations.
- @param[in] Address The base address of the memory operations.
- @param[in] BitMask A pointer to the bit mask to be AND-ed with the data read
- from the register.
- @param[in] BitValue A pointer to the data value after to be Masked.
- @param[in] Duration The duration in microseconds of the stall.
- @param[in] LoopTimes The times of the register polling.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveMemPoll (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN VOID *BitMask,
- IN VOID *BitValue,
- IN UINTN Duration,
- IN UINT64 LoopTimes
- );
-
-/**
- Store arbitrary information in the boot script table. This opcode is a no-op on
- dispatch and is only used for debugging script issues.
-
- @param[in] InformationLength Length of the data in bytes
- @param[in] Information Information to be logged in the boot scrpit
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveInformation (
- IN UINT32 InformationLength,
- IN VOID *Information
- );
-/**
- Adds a record for I/O reads the I/O location and continues when the exit criteria
- is satisfied, or after a defined duration.
-
- @param Width The width of the I/O operations.
- @param Address The base address of the I/O operations.
- @param Data The comparison value used for the polling exit criteria.
- @param DataMask The mask used for the polling criteria. The bits in
- the bytes below Width which are zero in Data are
- ignored when polling the memory address.
- @param Delay The number of 100ns units to poll. Note that timer
- available may be of insufficient granularity, so the
- delay may be longer.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the
- operation.
- @retval RETURN_SUCCESS The opcode was added.
- @note The FRAMEWORK version implementation does not support this API
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveIoPoll (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask,
- IN UINT64 Delay
- );
-
-/**
- Adds a record for PCI configuration space reads and continues when the exit
- criteria is satisfied ,or after a defined duration.
-
- @param Width The width of the I/O operations.
- @param Address The address within the PCI configuration space.
- @param Data The comparison value used for the polling exit
- criteria.
- @param DataMask Mask used for the polling criteria. The bits in
- the bytes below Width which are zero in Data are
- ignored when polling the memory address.
- @param Delay The number of 100ns units to poll. Note that timer
- available may be of insufficient granularity, so the
- delay may be longer.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the
- operation.
- @retval RETURN_SUCCESS The opcode was added.
- @note The FRAMEWORK version implementation does not support this API
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSavePciPoll (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask,
- IN UINT64 Delay
- );
-/**
- Adds a record for PCI configuration space reads and continues when the exit criteria
- is satisfied, or after a defined duration.
-
- @param Width The width of the I/O operations.
- @param Segment The PCI segment number for Address.
- @param Address The address within the PCI configuration space.
- @param Data The comparison value used for the polling exit
- criteria.
- @param DataMask Mask used for the polling criteria. The bits in
- the bytes below Width which are zero
- in Data are ignored when polling the memory address
- @param Delay The number of 100ns units to poll. Note that timer
- available may be of insufficient granularity so the delay
- may be longer.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the
- operation.
- @retval RETURN_SUCCESS The opcode was added.
- @note A known Limitations in the implementation: When interpreting the opcode
- EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE, EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE
- and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as
- Zero, or else, assert.
- The FRAMEWORK version implementation does not support this API.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSavePci2Poll (
- IN S3_BOOT_SCRIPT_LIB_WIDTH Width,
- IN UINT16 Segment,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask,
- IN UINT64 Delay
- );
-/**
- Save ASCII string information specified by Buffer to boot script with opcode
- EFI_BOOT_SCRIPT_INFORMATION_OPCODE.
-
- @param[in] String The Null-terminated ASCII string to store into the S3 boot
- script table.
-
- @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform
- the operation.
- @retval RETURN_SUCCESS The opcode was added.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptSaveInformationAsciiString (
- IN CONST CHAR8 *String
- );
-
-/**
- This is an function to close the S3 boot script table. The function could only
- be called in BOOT time phase. To comply with the Framework spec definition on
- EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things:
- 1. Closes the specified boot script table
- 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table.
- Once this function is called, the table maintained by the library will be destroyed
- after it is copied into the allocated pool.
- 3. Any attempts to add a script record after calling this function will cause a
- new table to be created by the library.
- 4. The base address of the allocated pool will be returned in Address. Note that
- after using the boot script table, the CALLER is responsible for freeing the
- pool that is allocated by this function.
-
- In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. This
- API is supplied here to meet the requirements of the Framework Spec.
-
- If anyone does call CloseTable() on a real platform, then the caller is responsible
- for figuring out how to get the script to run on an S3 resume because the boot script
- maintained by the lib will be destroyed.
-
- @return the base address of the new copy of the boot script table.
-
-**/
-UINT8*
-EFIAPI
-S3BootScriptCloseTable (
- VOID
- );
-
-/**
- Executes the S3 boot script table.
-
- @retval RETURN_SUCCESS The boot script table was executed successfully.
- @retval RETURN_UNSUPPORTED Invalid script table or opcode.
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptExecute (
- VOID
- );
-/**
- Move the last boot script entry to the position
-
- @param BeforeOrAfter Specifies whether the opcode is stored before
- (TRUE) or after (FALSE) the positionin the boot
- script table specified by Position. If Position
- is NULL or points to NULL then the new opcode is
- inserted at the beginning of the table (if TRUE)
- or end of the table (if FALSE).
- @param Position On entry, specifies the position in the boot script
- table where the opcode will be inserted, either
- before or after, depending on BeforeOrAfter. On
- exit, specifies the position of the inserted opcode
- in the boot script table.
-
- @retval RETURN_OUT_OF_RESOURCES The table is not available.
- @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the
- boot script table.
- @retval RETURN_SUCCESS The opcode was inserted.
- @note The FRAMEWORK version implementation does not support this API.
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptMoveLastOpcode (
- IN BOOLEAN BeforeOrAfter,
- IN OUT VOID **Position OPTIONAL
- );
-/**
- Find a label within the boot script table and, if not present, optionally create it.
-
- @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE)
- or after (FALSE) the position in the boot script table
- specified by Position.
- @param CreateIfNotFound Specifies whether the label will be created if the
- label does not exists (TRUE) or not (FALSE).
- @param Position On entry, specifies the position in the boot script
- table where the opcode will be inserted, either
- before or after, depending on BeforeOrAfter. On exit,
- specifies the positionof the inserted opcode in
- the boot script table.
- @param Label Points to the label which will be inserted in the
- boot script table.
- @retval EFI_SUCCESS The operation succeeded. A record was added into
- the specified script table.
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script
- is not supported. If the opcode is unknow or not
- supported because of the PCD Feature Flags.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
- @note The FRAMEWORK version implementation does not support this API
-
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptLabel (
- IN BOOLEAN BeforeOrAfter,
- IN BOOLEAN CreateIfNotFound,
- IN OUT VOID **Position OPTIONAL,
- IN CONST CHAR8 *Label
- );
-/**
- Compare two positions in the boot script table and return their relative position.
- @param Position1 The positions in the boot script table to compare
- @param Position2 The positions in the boot script table to compare
- @param RelativePosition On return, points to the result of the comparison
-
- @retval EFI_SUCCESS The operation succeeded. A record was added into the
- specified script table.
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script
- is not supported. If the opcode is unknow or not s
- upported because of the PCD Feature Flags.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
- @note The FRAMEWORK version implementation does not support this API
-**/
-RETURN_STATUS
-EFIAPI
-S3BootScriptCompare (
- IN UINT8 *Position1,
- IN UINT8 *Position2,
- OUT UINTN *RelativePosition
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/S3IoLib.h b/Core/MdePkg/Include/Library/S3IoLib.h
deleted file mode 100644
index 47c4ff96b5..0000000000
--- a/Core/MdePkg/Include/Library/S3IoLib.h
+++ /dev/null
@@ -1,2677 +0,0 @@
-/** @file
- I/O and MMIO Library Services that do I/O and also enable the I/O operation
- to be replayed during an S3 resume. This library class maps directly on top
- of the IoLib class.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions
- of the BSD License which accompanies this distribution. The
- full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __S3_IO_LIB_H__
-#define __S3_IO_LIB_H__
-
-/**
- Reads an 8-bit I/O port and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-S3IoRead8 (
- IN UINTN Port
- );
-
-/**
- Writes an 8-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise OR, writes the
- result back to the 8-bit I/O port, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoOr8 (
- IN UINTN Port,
- IN UINT8 OrData
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND, writes the result back
- to the 8-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoAnd8 (
- IN UINTN Port,
- IN UINT8 AndData
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 8-bit I/O port, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoAndThenOr8 (
- IN UINTN Port,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of an I/O register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the bit field in an 8-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Port The I/O port to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-S3IoBitFieldRead8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned.
- Remaining bits in Value are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoBitFieldWrite8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise OR, writes the
- result back to the bit field in the 8-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoBitFieldOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND, writes the
- result back to the bit field in the 8-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoBitFieldAnd8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, writes the result back to the bit field in the
- 8-bit port, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 8-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-S3IoBitFieldAndThenOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-S3IoRead16 (
- IN UINTN Port
- );
-
-/**
- Writes a 16-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise OR, writes the
- result back to the 16-bit I/O port, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoOr16 (
- IN UINTN Port,
- IN UINT16 OrData
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND, writes the result back
- to the 16-bit I/O port , and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoAnd16 (
- IN UINTN Port,
- IN UINT16 AndData
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 16-bit I/O port, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoAndThenOr16 (
- IN UINTN Port,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of an I/O register saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the bit field in a 16-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Port The I/O port to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-S3IoBitFieldRead16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoBitFieldWrite16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise OR, writes the
- result back to the bit field in the 16-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoBitFieldOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND, writes the
- result back to the bit field in the 16-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoBitFieldAnd16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, writes the result back to the bit field in the
- 16-bit port, and saves the value in the S3 script to be replayed on S3
- resume.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 16-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-S3IoBitFieldAndThenOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-S3IoRead32 (
- IN UINTN Port
- );
-
-/**
- Writes a 32-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise OR, writes the
- result back to the 32-bit I/O port, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoOr32 (
- IN UINTN Port,
- IN UINT32 OrData
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND, writes the result back
- to the 32-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoAnd32 (
- IN UINTN Port,
- IN UINT32 AndData
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 32-bit I/O port, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoAndThenOr32 (
- IN UINTN Port,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of an I/O register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the bit field in a 32-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Port The I/O port to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-S3IoBitFieldRead32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoBitFieldWrite32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise OR, writes the
- result back to the bit field in the 32-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoBitFieldOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND, writes the
- result back to the bit field in the 32-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoBitFieldAnd32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, writes the result back to the bit field in the
- 32-bit port, and saves the value in the S3 script to be replayed on S3
- resume.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 32-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-S3IoBitFieldAndThenOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a 64-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-S3IoRead64 (
- IN UINTN Port
- );
-
-/**
- Writes a 64-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise OR, writes the
- result back to the 64-bit I/O port, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoOr64 (
- IN UINTN Port,
- IN UINT64 OrData
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND, writes the result back
- to the 64-bit I/O port, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoAnd64 (
- IN UINTN Port,
- IN UINT64 AndData
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 64-bit I/O port, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoAndThenOr64 (
- IN UINTN Port,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field of an I/O register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the bit field in a 64-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Port The I/O port to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-S3IoBitFieldRead64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoBitFieldWrite64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise OR, writes the
- result back to the bit field in the 64-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoBitFieldOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND, writes the
- result back to the bit field in the 64-bit port, and saves the value in the
- S3 script to be replayed on S3 resume.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoBitFieldAnd64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
- bitwise OR, writes the result back to the bit field in the
- 64-bit port, and saves the value in the S3 script to be replayed on S3
- resume.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Port The I/O port to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] AndData The value to AND with the read value from the I/O port.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-S3IoBitFieldAndThenOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads an 8-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-S3MmioRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] Value The value to write to the MMIO register.
-
- @return The value written the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise OR, writes the
- result back to the 8-bit MMIO register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND, writes the result
- back to the 8-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 8-bit MMIO register, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 8-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a MMIO register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the bit field in an 8-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address MMIO register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-S3MmioBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an MMIO register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 8-bit register is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise OR,
- writes the result back to the bit field in the 8-bit MMIO register, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 8-bit MMIO register, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, writes the result back to the bit field in the
- 8-bit MMIO register, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 8-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-S3MmioBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit MMIO register, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-S3MmioRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit MMIO register, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] Value The value to write to the MMIO register.
-
- @return The value written the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise OR, writes the
- result back to the 16-bit MMIO register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND, writes the result
- back to the 16-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 16-bit MMIO register, and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 16-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a MMIO register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the bit field in a 16-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address MMIO register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-S3MmioBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 16-bit register is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise OR,
- writes the result back to the bit field in the 16-bit MMIO register, and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 16-bit MMIO register and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, writes the result back to the bit field in the
- 16-bit MMIO register, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 16-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-S3MmioBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit MMIO register saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-S3MmioRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] Value The value to write to the MMIO register.
-
- @return The value written the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise OR, writes the
- result back to the 32-bit MMIO register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND, writes the result
- back to the 32-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 32-bit MMIO register, and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 32-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a MMIO register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Reads the bit field in a 32-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address MMIO register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-S3MmioBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 32-bit register is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise OR,
- writes the result back to the bit field in the 32-bit MMIO register, and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 32-bit MMIO register and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, writes the result back to the bit field in the
- 32-bit MMIO register, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 32-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-S3MmioBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a 64-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-S3MmioRead64 (
- IN UINTN Address
- );
-
-/**
- Writes a 64-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] Value The value to write to the MMIO register.
-
- @return The value written the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise OR, writes the
- result back to the 64-bit MMIO register, and saves the value in the S3 script
- to be replayed on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioOr64 (
- IN UINTN Address,
- IN UINT64 OrData
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND, writes the result
- back to the 64-bit MMIO register, and saves the value in the S3 script to be
- replayed on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioAnd64 (
- IN UINTN Address,
- IN UINT64 AndData
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, writes the result back to the 64-bit MMIO register, and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 64-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioAndThenOr64 (
- IN UINTN Address,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field of a MMIO register saves the value in the S3 script to
- be replayed on S3 resume.
-
- Reads the bit field in a 64-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address MMIO register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-S3MmioBitFieldRead64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register, and saves the value in the S3 script to
- be replayed on S3 resume.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 64-bit register is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioBitFieldWrite64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise OR,
- writes the result back to the bit field in the 64-bit MMIO register, and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioBitFieldOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 64-bit MMIO register, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioBitFieldAnd64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, writes the result back to the bit field in the
- 64-bit MMIO register, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 64-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The MMIO register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param[in] AndData The value to AND with the read value from the MMIO register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-S3MmioBitFieldAndThenOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Copies data from MMIO region to system memory by using 8-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 8-bit access. The total
- number of bytes to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
-
- @param[in] StartAddress Starting address for the MMIO region to be copied from.
- @param[in] Length Size in bytes of the copy.
- @param[out] Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer.
-
-**/
-UINT8 *
-EFIAPI
-S3MmioReadBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT8 *Buffer
- );
-
-/**
- Copies data from MMIO region to system memory by using 16-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 16-bit access. The total
- number of bytes to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] StartAddress Starting address for the MMIO region to be copied from.
- @param[in] Length Size in bytes of the copy.
- @param[out] Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer.
-
-**/
-UINT16 *
-EFIAPI
-S3MmioReadBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT16 *Buffer
- );
-
-/**
- Copies data from MMIO region to system memory by using 32-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 32-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] StartAddress Starting address for the MMIO region to be copied from.
- @param[in] Length Size in bytes of the copy.
- @param[out] Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer.
-
-**/
-UINT32 *
-EFIAPI
-S3MmioReadBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT32 *Buffer
- );
-
-/**
- Copies data from MMIO region to system memory by using 64-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 64-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param[in] StartAddress Starting address for the MMIO region to be copied from.
- @param[in] Length Size in bytes of the copy.
- @param[out] Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer.
-
-**/
-UINT64 *
-EFIAPI
-S3MmioReadBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT64 *Buffer
- );
-
-/**
- Copies data from system memory to MMIO region by using 8-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 8-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
-
- @param[in] StartAddress Starting address for the MMIO region to be copied to.
- @param[in] Length Size in bytes of the copy.
- @param[in] Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer.
-
-**/
-UINT8 *
-EFIAPI
-S3MmioWriteBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT8 *Buffer
- );
-
-/**
- Copies data from system memory to MMIO region by using 16-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 16-bit access. The total number
- of bytes to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] StartAddress Starting address for the MMIO region to be copied to.
- @param[in] Length Size in bytes of the copy.
- @param[in] Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer.
-
-**/
-UINT16 *
-EFIAPI
-S3MmioWriteBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT16 *Buffer
- );
-
-/**
- Copies data from system memory to MMIO region by using 32-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 32-bit access. The total number
- of bytes to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] StartAddress Starting address for the MMIO region to be copied to.
- @param[in] Length Size in bytes of the copy.
- @param[in] Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer.
-
-**/
-UINT32 *
-EFIAPI
-S3MmioWriteBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT32 *Buffer
- );
-
-/**
- Copies data from system memory to MMIO region by using 64-bit access,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 64-bit access. The total number
- of bytes to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param[in] StartAddress Starting address for the MMIO region to be copied to.
- @param[in] Length Size in bytes of the copy.
- @param[in] Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Buffer.
-
-**/
-UINT64 *
-EFIAPI
-S3MmioWriteBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT64 *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/S3PciLib.h b/Core/MdePkg/Include/Library/S3PciLib.h
deleted file mode 100644
index bae12aba1e..0000000000
--- a/Core/MdePkg/Include/Library/S3PciLib.h
+++ /dev/null
@@ -1,1052 +0,0 @@
-/** @file
- The PCI configuration Library Services that carry out PCI configuration and enable
- the PCI operations to be replayed during an S3 resume. This library class
- maps directly on top of the PciLib class.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions
- of the BSD License which accompanies this distribution. The
- full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __S3_PCI_LIB_H__
-#define __S3_PCI_LIB_H__
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the S3 PCI Library functions.
-
- @param Bus The PCI Bus number. Range 0..255.
- @param Device The PCI Device number. Range 0..31.
- @param Function The PCI Function number. Range 0..7.
- @param Register The PCI Register number. Range 0..255 for PCI. Range 0..4095
- for PCI Express.
-
- @return The encoded PCI address.
-
-**/
-#define S3_PCI_LIB_ADDRESS(Bus,Device,Function,Register) \
- (((Register) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
-
- Reads and returns the 8-bit PCI configuration register specified by Address,
- and saves the value in the S3 script to be replayed on S3 resume.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The value read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register, and saves the value in the S3
- script to be replayed on S3 resume.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Performs a bitwise OR of an 8-bit PCI configuration register with
- an 8-bit value, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise OR with another 8-bit value, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] AndData The value to AND with the PCI configuration register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register, and saves the value in
- the S3 script to be replayed on S3 resume.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register, and saves the value in
- the S3 script to be replayed on S3 resume.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port, and saves the value
- in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit Address, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param[in] AndData The value to AND with the PCI configuration register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-S3PciBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register, and saves the value in the S3
- script to be replayed on S3 resume.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register, and saves the value in the S3
- script to be replayed on S3 resume.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Performs a bitwise OR of a 16-bit PCI configuration register with
- a 16-bit value, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise OR with another 16-bit value, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] AndData The value to AND with the PCI configuration register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register, and saves the value in
- the S3 script to be replayed on S3 resume.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register, and saves the value in
- the S3 script to be replayed on S3 resume.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port, and saves the value
- in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit Address, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param[in] AndData The value to AND with the PCI configuration register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-S3PciBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register, and saves the value in the S3
- script to be replayed on S3 resume.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register, and saves the value in the S3
- script to be replayed on S3 resume.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Performs a bitwise OR of a 32-bit PCI configuration register with
- a 32-bit value, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise OR with another 32-bit value, and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param[in] Address The address that encodes the PCI Bus, Device, Function and
- Register.
- @param[in] AndData The value to AND with the PCI configuration register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register, and saves the value in
- the S3 script to be replayed on S3 resume.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to read.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register, and saves the value in
- the S3 script to be replayed on S3 resume.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port, and saves the value
- in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register and
- saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit Address, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port, and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param[in] Address The PCI configuration register to write.
- @param[in] StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param[in] EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param[in] AndData The value to AND with the PCI configuration register.
- @param[in] OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-S3PciBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer,
- and saves the value in the S3 script to be replayed on S3 resume.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param[in] StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param[in] Size Size in bytes of the transfer.
- @param[out] Buffer The pointer to a buffer receiving the data read.
-
- @return Size.
-
-**/
-UINTN
-EFIAPI
-S3PciReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space, and saves the value in the S3 script to be replayed on S3
- resume.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param[in] StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param[in] Size Size in bytes of the transfer.
- @param[in] Buffer The pointer to a buffer containing the data to write.
-
- @return Size.
-
-**/
-UINTN
-EFIAPI
-S3PciWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/S3SmbusLib.h b/Core/MdePkg/Include/Library/S3SmbusLib.h
deleted file mode 100644
index f7a1e248f7..0000000000
--- a/Core/MdePkg/Include/Library/S3SmbusLib.h
+++ /dev/null
@@ -1,455 +0,0 @@
-/** @file
- Smbus Library Services that conduct SMBus transactions and enable the operatation
- to be replayed during an S3 resume. This library class maps directly on top
- of the SmbusLib class.
-
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions
- of the BSD License which accompanies this distribution. The
- full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __S3_SMBUS_LIB_H__
-#define __S3_SMBUS_LIB_H__
-
-/**
- Executes an SMBUS quick read command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
-**/
-VOID
-EFIAPI
-S3SmBusQuickRead (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS quick write command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
-**/
-VOID
-EFIAPI
-S3SmBusQuickWrite (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS receive byte command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- The byte received from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The byte received from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-S3SmBusReceiveByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS send byte command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.
- The byte specified by Value is sent.
- Only the SMBUS slave address field of SmBusAddress is required. Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[in] Value The 8-bit value to send.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-S3SmBusSendByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read data byte command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 8-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-S3SmBusReadDataByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write data byte command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.
- The 8-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[in] Value The 8-bit value to write.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-S3SmBusWriteDataByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read data word command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT16
-EFIAPI
-S3SmBusReadDataWord (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write data word command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[in] Value The 16-bit value to write.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The parameter of Value.
-
-**/
-UINT16
-EFIAPI
-S3SmBusWriteDataWord (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS process call command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value returned by the process call command is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[in] Value The 16-bit value to write.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The 16-bit value returned by the process call command.
-
-**/
-UINT16
-EFIAPI
-S3SmBusProcessCall (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read block command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Bytes are read from the SMBUS and stored in Buffer.
- The number of bytes read is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is not zero, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Buffer The pointer to the buffer to store the bytes read from the SMBUS.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The number of bytes read.
-
-**/
-UINTN
-EFIAPI
-S3SmBusReadBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write block command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from Buffer.
- The number of bytes written is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[out] Buffer The pointer to the buffer to store the bytes read from the SMBUS.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-S3SmBusWriteBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS block process call command, and saves the value in the S3 script to be replayed
- on S3 resume.
-
- Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from WriteBuffer. Bytes are then read from the SMBUS into ReadBuffer.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If WriteBuffer is NULL, then ASSERT().
- If ReadBuffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param[in] SmBusAddress The address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param[in] WriteBuffer The pointer to the buffer of bytes to write to the SMBUS.
- @param[out] ReadBuffer The pointer to the buffer of bytes to read from the SMBUS.
- @param[out] Status The return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- was recorded in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus error (collision).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-S3SmBusBlockProcessCall (
- IN UINTN SmBusAddress,
- IN VOID *WriteBuffer,
- OUT VOID *ReadBuffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/S3StallLib.h b/Core/MdePkg/Include/Library/S3StallLib.h
deleted file mode 100644
index 5fd55e16fe..0000000000
--- a/Core/MdePkg/Include/Library/S3StallLib.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- Stall Services that perform stalls and also enable the Stall operatation
- to be replayed during an S3 resume. This library class maps directly on top
- of the Timer class.
-
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions
- of the BSD License which accompanies this distribution. The
- full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __S3_STALL_LIB_H__
-#define __S3_STALL_LIB_H__
-
-/**
- Stalls the CPU for at least the given number of microseconds and saves
- the value in the S3 script to be replayed on S3 resume.
-
- Stalls the CPU for the number of microseconds specified by MicroSeconds.
-
- @param[in] MicroSeconds The minimum number of microseconds to delay.
-
- @return MicroSeconds.
-
-**/
-UINTN
-EFIAPI
-S3Stall (
- IN UINTN MicroSeconds
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SalLib.h b/Core/MdePkg/Include/Library/SalLib.h
deleted file mode 100644
index 412763fb31..0000000000
--- a/Core/MdePkg/Include/Library/SalLib.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file
- Provides library services to make SAL Calls.
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SAL_LIB__
-#define __SAL_LIB__
-
-#include <IndustryStandard/Sal.h>
-
-/**
- Makes a SAL procedure call.
-
- This is a wrapper function to make a SAL procedure call.
- No parameter checking is performed on the 8 input parameters,
- but there are some common rules that the caller should follow
- when making a SAL call. Any address passed to SAL as buffers
- for return parameters must be 8-byte aligned. Unaligned
- addresses may cause undefined results. For those parameters
- defined as reserved or some fields defined as reserved must be
- zero filled or the invalid argument return value may be returned
- or undefined result may occur during the execution of the procedure.
- This function is only available on Intel Itanium-based platforms.
-
- @param Index The SAL procedure Index number
- @param Arg2 The 2nd parameter for SAL procedure calls
- @param Arg3 The 3rd parameter for SAL procedure calls
- @param Arg4 The 4th parameter for SAL procedure calls
- @param Arg5 The 5th parameter for SAL procedure calls
- @param Arg6 The 6th parameter for SAL procedure calls
- @param Arg7 The 7th parameter for SAL procedure calls
- @param Arg8 The 8th parameter for SAL procedure calls
-
- @return SAL returned registers.
-
-**/
-SAL_RETURN_REGS
-EFIAPI
-SalCall (
- IN UINT64 Index,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SerialPortLib.h b/Core/MdePkg/Include/Library/SerialPortLib.h
deleted file mode 100644
index 965a2d964b..0000000000
--- a/Core/MdePkg/Include/Library/SerialPortLib.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/** @file
- This library class provides common serial I/O port functions.
-
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
-Copyright (c) 2012 - 2014, ARM Ltd. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SERIAL_PORT_LIB__
-#define __SERIAL_PORT_LIB__
-
-#include <Uefi/UefiBaseType.h>
-#include <Protocol/SerialIo.h>
-
-/**
- Initialize the serial device hardware.
-
- If no initialization is required, then return RETURN_SUCCESS.
- If the serial device was successfully initialized, then return RETURN_SUCCESS.
- If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.
-
- @retval RETURN_SUCCESS The serial device was initialized.
- @retval RETURN_DEVICE_ERROR The serial device could not be initialized.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortInitialize (
- VOID
- );
-
-/**
- Write data from buffer to serial device.
-
- Writes NumberOfBytes data bytes from Buffer to the serial device.
- The number of bytes actually written to the serial device is returned.
- If the return value is less than NumberOfBytes, then the write operation failed.
- If Buffer is NULL, then ASSERT().
- If NumberOfBytes is zero, then return 0.
-
- @param Buffer Pointer to the data buffer to be written.
- @param NumberOfBytes Number of bytes to written to the serial device.
-
- @retval 0 NumberOfBytes is 0.
- @retval >0 The number of bytes written to the serial device.
- If this value is less than NumberOfBytes, then the write operation failed.
-
-**/
-UINTN
-EFIAPI
-SerialPortWrite (
- IN UINT8 *Buffer,
- IN UINTN NumberOfBytes
- );
-
-
-/**
- Read data from serial device and save the datas in buffer.
-
- Reads NumberOfBytes data bytes from a serial device into the buffer
- specified by Buffer. The number of bytes actually read is returned.
- If the return value is less than NumberOfBytes, then the rest operation failed.
- If Buffer is NULL, then ASSERT().
- If NumberOfBytes is zero, then return 0.
-
- @param Buffer Pointer to the data buffer to store the data read from the serial device.
- @param NumberOfBytes Number of bytes which will be read.
-
- @retval 0 Read data failed, no data is to be read.
- @retval >0 Actual number of bytes read from serial device.
-
-**/
-UINTN
-EFIAPI
-SerialPortRead (
- OUT UINT8 *Buffer,
- IN UINTN NumberOfBytes
- );
-
-/**
- Polls a serial device to see if there is any data waiting to be read.
-
- Polls a serial device to see if there is any data waiting to be read.
- If there is data waiting to be read from the serial device, then TRUE is returned.
- If there is no data waiting to be read from the serial device, then FALSE is returned.
-
- @retval TRUE Data is waiting to be read from the serial device.
- @retval FALSE There is no data waiting to be read from the serial device.
-
-**/
-BOOLEAN
-EFIAPI
-SerialPortPoll (
- VOID
- );
-
-/**
- Sets the control bits on a serial device.
-
- @param Control Sets the bits of Control that are settable.
-
- @retval RETURN_SUCCESS The new control bits were set on the serial device.
- @retval RETURN_UNSUPPORTED The serial device does not support this operation.
- @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortSetControl (
- IN UINT32 Control
- );
-
-/**
- Retrieve the status of the control bits on a serial device.
-
- @param Control A pointer to return the current control signals from the serial device.
-
- @retval RETURN_SUCCESS The control bits were read from the serial device.
- @retval RETURN_UNSUPPORTED The serial device does not support this operation.
- @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortGetControl (
- OUT UINT32 *Control
- );
-
-/**
- Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
- data bits, and stop bits on a serial device.
-
- @param BaudRate The requested baud rate. A BaudRate value of 0 will use the
- device's default interface speed.
- On output, the value actually set.
- @param ReveiveFifoDepth The requested depth of the FIFO on the receive side of the
- serial interface. A ReceiveFifoDepth value of 0 will use
- the device's default FIFO depth.
- On output, the value actually set.
- @param Timeout The requested time out for a single character in microseconds.
- This timeout applies to both the transmit and receive side of the
- interface. A Timeout value of 0 will use the device's default time
- out value.
- On output, the value actually set.
- @param Parity The type of parity to use on this serial device. A Parity value of
- DefaultParity will use the device's default parity value.
- On output, the value actually set.
- @param DataBits The number of data bits to use on the serial device. A DataBits
- vaule of 0 will use the device's default data bit setting.
- On output, the value actually set.
- @param StopBits The number of stop bits to use on this serial device. A StopBits
- value of DefaultStopBits will use the device's default number of
- stop bits.
- On output, the value actually set.
-
- @retval RETURN_SUCCESS The new attributes were set on the serial device.
- @retval RETURN_UNSUPPORTED The serial device does not support this operation.
- @retval RETURN_INVALID_PARAMETER One or more of the attributes has an unsupported value.
- @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortSetAttributes (
- IN OUT UINT64 *BaudRate,
- IN OUT UINT32 *ReceiveFifoDepth,
- IN OUT UINT32 *Timeout,
- IN OUT EFI_PARITY_TYPE *Parity,
- IN OUT UINT8 *DataBits,
- IN OUT EFI_STOP_BITS_TYPE *StopBits
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SmbusLib.h b/Core/MdePkg/Include/Library/SmbusLib.h
deleted file mode 100644
index 8136fc522e..0000000000
--- a/Core/MdePkg/Include/Library/SmbusLib.h
+++ /dev/null
@@ -1,497 +0,0 @@
-/** @file
- Provides library functions to access SMBUS devices. Libraries of this class
- must be ported to a specific SMBUS controller.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SMBUS_LIB__
-#define __SMBUS_LIB__
-
-/**
- Macro that converts SMBUS slave address, SMBUS command, SMBUS data length,
- and PEC to a value that can be passed to the SMBUS Library functions.
-
- Computes an address that is compatible with the SMBUS Library functions.
- The unused upper bits of SlaveAddress, Command, and Length are stripped
- prior to the generation of the address.
-
- @param SlaveAddress SMBUS Slave Address. Range 0..127.
- @param Command SMBUS Command. Range 0..255.
- @param Length SMBUS Data Length. Range 0..32.
- @param Pec TRUE if Packet Error Checking is enabled. Otherwise FALSE.
-
-**/
-#define SMBUS_LIB_ADDRESS(SlaveAddress,Command,Length,Pec) \
- ( ((Pec) ? BIT22: 0) | \
- (((SlaveAddress) & 0x7f) << 1) | \
- (((Command) & 0xff) << 8) | \
- (((Length) & 0x3f) << 16) \
- )
-
-/**
- Macro that returns the SMBUS Slave Address value from an SmBusAddress Parameter value.
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, and PEC
-**/
-#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
-
-/**
- Macro that returns the SMBUS Command value from an SmBusAddress Parameter value.
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, and PEC
-**/
-#define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)
-
-/**
- Macro that returns the SMBUS Data Length value from an SmBusAddress Parameter value.
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, and PEC
-**/
-#define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)
-
-/**
- Macro that returns the SMBUS PEC value from an SmBusAddress Parameter value.
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, and PEC
-**/
-#define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & BIT22) != 0))
-
-/**
- Macro that returns the set of reserved bits from an SmBusAddress Parameter value.
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS Command, SMBUS Data Length, and PEC
-**/
-#define SMBUS_LIB_RESERVED(SmBusAddress) ((SmBusAddress) & ~(BIT23 - 2))
-
-/**
- Executes an SMBUS quick read command.
-
- Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
-**/
-VOID
-EFIAPI
-SmBusQuickRead (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS quick write command.
-
- Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
-**/
-VOID
-EFIAPI
-SmBusQuickWrite (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS receive byte command.
-
- Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- The byte received from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The byte received from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReceiveByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS send byte command.
-
- Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.
- The byte specified by Value is sent.
- Only the SMBUS slave address field of SmBusAddress is required. Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to send.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusSendByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read data byte command.
-
- Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 8-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReadDataByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write data byte command.
-
- Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.
- The 8-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusWriteDataByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read data word command.
-
- Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT16
-EFIAPI
-SmBusReadDataWord (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write data word command.
-
- Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The parameter of Value.
-
-**/
-UINT16
-EFIAPI
-SmBusWriteDataWord (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS process call command.
-
- Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value returned by the process call command is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The 16-bit value returned by the process call command.
-
-**/
-UINT16
-EFIAPI
-SmBusProcessCall (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read block command.
-
- Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Bytes are read from the SMBUS and stored in Buffer.
- The number of bytes read is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is not zero, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_SUCCESS The SMBUS command was executed.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The number of bytes read.
-
-**/
-UINTN
-EFIAPI
-SmBusReadBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write block command.
-
- Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from Buffer.
- The number of bytes written is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusWriteBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS block process call command.
-
- Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from WriteBuffer. Bytes are then read from the SMBUS into ReadBuffer.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If WriteBuffer is NULL, then ASSERT().
- If ReadBuffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS.
- @param ReadBuffer Pointer to the buffer of bytes to read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
- RETURN_TIMEOUT A timeout occurred while executing the SMBUS command.
- RETURN_DEVICE_ERROR The request was not completed because a failure
- reflected in the Host Status Register bit. Device errors are a result
- of a transaction collision, illegal command field, unclaimed cycle
- (host initiated), or bus errors (collisions).
- RETURN_CRC_ERROR The checksum is not correct (PEC is incorrect)
- RETURN_UNSUPPORTED The SMBus operation is not supported.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusBlockProcessCall (
- IN UINTN SmBusAddress,
- IN VOID *WriteBuffer,
- OUT VOID *ReadBuffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SmiHandlerProfileLib.h b/Core/MdePkg/Include/Library/SmiHandlerProfileLib.h
deleted file mode 100644
index 77d19f9a70..0000000000
--- a/Core/MdePkg/Include/Library/SmiHandlerProfileLib.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/** @file
- Provides services to log the SMI handler registration.
-
- This API provides services for the SMM Child Dispatch Protocols provider,
- to register SMI handler information to SmmCore.
-
- NOTE:
- There is no need to update the consumers of SMST->SmiHandlerRegister() or
- the consumers of SMM Child Dispatch Protocols.
- The SmmCore (who produces SMST) should have ability to register such
- information directly.
- The SmmChildDispatcher (who produces SMM Child Dispatch Protocols) should
- be responsible to call the services to register information to SMM Core.
-
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SMI_HANDLER_PROFILE_LIB_H__
-#define __SMI_HANDLER_PROFILE_LIB_H__
-
-#include <PiSmm.h>
-
-/**
- This function is called by SmmChildDispatcher module to report
- a new SMI handler is registered, to SmmCore.
-
- @param HandlerGuid The GUID to identify the type of the handler.
- For the SmmChildDispatch protocol, the HandlerGuid
- must be the GUID of SmmChildDispatch protocol.
- @param Handler The SMI handler.
- @param CallerAddress The address of the module who registers the SMI handler.
- @param Context The context of the SMI handler.
- For the SmmChildDispatch protocol, the Context
- must match the one defined for SmmChildDispatch protocol.
- @param ContextSize The size of the context in bytes.
- For the SmmChildDispatch protocol, the Context
- must match the one defined for SmmChildDispatch protocol.
-
- @retval EFI_SUCCESS The information is recorded.
- @retval EFI_UNSUPPORTED The feature is unsupported.
- @retval EFI_OUT_OF_RESOURCES There is no enough resource to record the information.
-**/
-EFI_STATUS
-EFIAPI
-SmiHandlerProfileRegisterHandler (
- IN EFI_GUID *HandlerGuid,
- IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
- IN PHYSICAL_ADDRESS CallerAddress,
- IN VOID *Context, OPTIONAL
- IN UINTN ContextSize OPTIONAL
- );
-
-/**
- This function is called by SmmChildDispatcher module to report
- an existing SMI handler is unregistered, to SmmCore.
-
- @param HandlerGuid The GUID to identify the type of the handler.
- For the SmmChildDispatch protocol, the HandlerGuid
- must be the GUID of SmmChildDispatch protocol.
- @param Handler The SMI handler.
- @param Context The context of the SMI handler.
- If it is NOT NULL, it will be used to check what is registered.
- @param ContextSize The size of the context in bytes.
- If Context is NOT NULL, it will be used to check what is registered.
-
- @retval EFI_SUCCESS The original record is removed.
- @retval EFI_UNSUPPORTED The feature is unsupported.
- @retval EFI_NOT_FOUND There is no record for the HandlerGuid and handler.
-**/
-EFI_STATUS
-EFIAPI
-SmiHandlerProfileUnregisterHandler (
- IN EFI_GUID *HandlerGuid,
- IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
- IN VOID *Context, OPTIONAL
- IN UINTN ContextSize OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SmmIoLib.h b/Core/MdePkg/Include/Library/SmmIoLib.h
deleted file mode 100644
index 7820f1ec10..0000000000
--- a/Core/MdePkg/Include/Library/SmmIoLib.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Provides services for SMM IO Operation.
-
- The SMM IO Library provides function for checking if IO resource is accessible inside of SMM.
-
- Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SMM_IO_LIB_H_
-#define _SMM_IO_LIB_H_
-
-/**
- This function check if the MMIO resource is valid per processor architecture and
- valid per platform design.
-
- @param BaseAddress The MMIO start address to be checked.
- @param Length The MMIO length to be checked.
- @param Owner A GUID representing the owner of the resource.
- This GUID may be used by producer to correlate the device ownership of the resource.
- NULL means no specific owner.
-
- @retval TRUE This MMIO resource is valid per processor architecture and valid per platform design.
- @retval FALSE This MMIO resource is not valid per processor architecture or valid per platform design.
-**/
-BOOLEAN
-EFIAPI
-SmmIsMmioValid (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *Owner OPTIONAL
- );
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/SmmLib.h b/Core/MdePkg/Include/Library/SmmLib.h
deleted file mode 100644
index d1241c1967..0000000000
--- a/Core/MdePkg/Include/Library/SmmLib.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
- Library class name: SmmLib
-
- SMM Library Services that abstracts both S/W SMI generation and detection.
-
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SMM_LIB_H__
-#define __SMM_LIB_H__
-
-
-/**
- Triggers an SMI at boot time.
-
- This function triggers a software SMM interrupt at boot time.
-
-**/
-VOID
-EFIAPI
-TriggerBootServiceSoftwareSmi (
- VOID
- );
-
-
-/**
- Triggers an SMI at run time.
-
- This function triggers a software SMM interrupt at run time.
-
-**/
-VOID
-EFIAPI
-TriggerRuntimeSoftwareSmi (
- VOID
- );
-
-
-/**
- Test if a boot time software SMI happened.
-
- This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and
- it was triggered at boot time, it returns TRUE. Otherwise, it returns FALSE.
-
- @retval TRUE A software SMI triggered at boot time happened.
- @retval FLASE No software SMI happened, or the software SMI was triggered at run time.
-
-**/
-BOOLEAN
-EFIAPI
-IsBootServiceSoftwareSmi (
- VOID
- );
-
-
-/**
- Test if a run time software SMI happened.
-
- This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and
- it was triggered at run time, it returns TRUE. Otherwise, it returns FALSE.
-
- @retval TRUE A software SMI triggered at run time happened.
- @retval FLASE No software SMI happened or the software SMI was triggered at boot time.
-
-**/
-BOOLEAN
-EFIAPI
-IsRuntimeSoftwareSmi (
- VOID
- );
-
-/**
- Clear APM SMI Status Bit; Set the EOS bit.
-
-**/
-VOID
-EFIAPI
-ClearSmi (
- VOID
- );
-#endif
diff --git a/Core/MdePkg/Include/Library/SmmMemLib.h b/Core/MdePkg/Include/Library/SmmMemLib.h
deleted file mode 100644
index 5186fd5d44..0000000000
--- a/Core/MdePkg/Include/Library/SmmMemLib.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/** @file
- Provides services for SMM Memory Operation.
-
- The SMM Mem Library provides function for checking if buffer is outside SMRAM and valid.
- It also provides functions for copy data from SMRAM to non-SMRAM, from non-SMRAM to SMRAM,
- from non-SMRAM to non-SMRAM, or set data in non-SMRAM.
-
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SMM_MEM_LIB_H_
-#define _SMM_MEM_LIB_H_
-
-/**
- This function check if the buffer is valid per processor architecture and not overlap with SMRAM.
-
- @param Buffer The buffer start address to be checked.
- @param Length The buffer length to be checked.
-
- @retval TRUE This buffer is valid per processor architecture and not overlap with SMRAM.
- @retval FALSE This buffer is not valid per processor architecture or overlap with SMRAM.
-**/
-BOOLEAN
-EFIAPI
-SmmIsBufferOutsideSmmValid (
- IN EFI_PHYSICAL_ADDRESS Buffer,
- IN UINT64 Length
- );
-
-/**
- Copies a source buffer (non-SMRAM) to a destination buffer (SMRAM).
-
- This function copies a source buffer (non-SMRAM) to a destination buffer (SMRAM).
- It checks if source buffer is valid per processor architecture and not overlap with SMRAM.
- If the check passes, it copies memory and returns EFI_SUCCESS.
- If the check fails, it return EFI_SECURITY_VIOLATION.
- The implementation must be reentrant.
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @retval EFI_SECURITY_VIOLATION The SourceBuffer is invalid per processor architecture or overlap with SMRAM.
- @retval EFI_SUCCESS Memory is copied.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmCopyMemToSmram (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Copies a source buffer (SMRAM) to a destination buffer (NON-SMRAM).
-
- This function copies a source buffer (non-SMRAM) to a destination buffer (SMRAM).
- It checks if destination buffer is valid per processor architecture and not overlap with SMRAM.
- If the check passes, it copies memory and returns EFI_SUCCESS.
- If the check fails, it returns EFI_SECURITY_VIOLATION.
- The implementation must be reentrant.
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @retval EFI_SECURITY_VIOLATION The DesinationBuffer is invalid per processor architecture or overlap with SMRAM.
- @retval EFI_SUCCESS Memory is copied.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmCopyMemFromSmram (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Copies a source buffer (NON-SMRAM) to a destination buffer (NON-SMRAM).
-
- This function copies a source buffer (non-SMRAM) to a destination buffer (SMRAM).
- It checks if source buffer and destination buffer are valid per processor architecture and not overlap with SMRAM.
- If the check passes, it copies memory and returns EFI_SUCCESS.
- If the check fails, it returns EFI_SECURITY_VIOLATION.
- The implementation must be reentrant, and it must handle the case where source buffer overlaps destination buffer.
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @retval EFI_SECURITY_VIOLATION The DesinationBuffer is invalid per processor architecture or overlap with SMRAM.
- @retval EFI_SECURITY_VIOLATION The SourceBuffer is invalid per processor architecture or overlap with SMRAM.
- @retval EFI_SUCCESS Memory is copied.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Fills a target buffer (NON-SMRAM) with a byte value.
-
- This function fills a target buffer (non-SMRAM) with a byte value.
- It checks if target buffer is valid per processor architecture and not overlap with SMRAM.
- If the check passes, it fills memory and returns EFI_SUCCESS.
- If the check fails, it returns EFI_SECURITY_VIOLATION.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @retval EFI_SECURITY_VIOLATION The Buffer is invalid per processor architecture or overlap with SMRAM.
- @retval EFI_SUCCESS Memory is set.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-#endif \ No newline at end of file
diff --git a/Core/MdePkg/Include/Library/SmmPeriodicSmiLib.h b/Core/MdePkg/Include/Library/SmmPeriodicSmiLib.h
deleted file mode 100644
index 2bad2b7af7..0000000000
--- a/Core/MdePkg/Include/Library/SmmPeriodicSmiLib.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/** @file
- Provides services to enable and disable periodic SMI handlers.
-
-Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PERIODIC_SMI_LIB_H__
-#define __PERIODIC_SMI_LIB_H__
-
-#define PERIODIC_SMI_LIBRARY_ANY_CPU 0xffffffff
-
-/**
- This function returns a pointer to a table of supported periodic
- SMI tick periods in 100 ns units sorted from largest to smallest.
- The table contains a array of UINT64 values terminated by a tick
- period value of 0. The returned table must be treated as read-only
- data and must not be freed.
-
- @return A pointer to a table of UINT64 tick period values in
- 100ns units sorted from largest to smallest terminated
- by a tick period of 0.
-
-**/
-UINT64 *
-EFIAPI
-PeriodicSmiSupportedTickPeriod (
- VOID
- );
-
-/**
- This function returns the time in 100ns units since the periodic SMI
- handler function was called. If the periodic SMI handler was resumed
- through PeriodicSmiYield(), then the time returned is the time in
- 100ns units since PeriodicSmiYield() returned.
-
- @return The actual time in 100ns units that the periodic SMI handler
- has been executing. If this function is not called from within
- an enabled periodic SMI handler, then 0 is returned.
-
-**/
-UINT64
-EFIAPI
-PeriodicSmiExecutionTime (
- VOID
- );
-
-/**
- This function returns control back to the SMM Foundation. When the next
- periodic SMI for the currently executing handler is triggered, the periodic
- SMI handler will restarted from its registered DispatchFunction entry point.
- If this function is not called from within an enabled periodic SMI handler,
- then control is returned to the calling function.
-
-**/
-VOID
-EFIAPI
-PeriodicSmiExit (
- VOID
- );
-
-/**
- This function yields control back to the SMM Foundation. When the next
- periodic SMI for the currently executing handler is triggered, the periodic
- SMI handler will be resumed and this function will return. Use of this
- function requires a seperate stack for the periodic SMI handler. A non zero
- stack size must be specified in PeriodicSmiEnable() for this function to be
- used.
-
- If the stack size passed into PeriodicSmiEnable() was zero, the 0 is returned.
-
- If this function is not called from within an enabled periodic SMI handler,
- then 0 is returned.
-
- @return The actual time in 100ns units elapsed since this function was
- called. A value of 0 indicates an unknown amount of time.
-
-**/
-UINT64
-EFIAPI
-PeriodicSmiYield (
- VOID
- );
-
-/**
- This function is a prototype for a periodic SMI handler function
- that may be enabled with PeriodicSmiEnable() and disabled with
- PeriodicSmiDisable().
-
- @param[in] Context Content registered with PeriodicSmiEnable().
- @param[in] ElapsedTime The actual time in 100ns units elapsed since
- this function was called. A value of 0 indicates
- an unknown amount of time.
-
-**/
-typedef
-VOID
-(EFIAPI *PERIODIC_SMI_LIBRARY_HANDLER) (
- IN CONST VOID *Context OPTIONAL,
- IN UINT64 ElapsedTime
- );
-
-/**
- This function enables a periodic SMI handler.
-
- @param[in, out] DispatchHandle A pointer to the handle associated with the
- enabled periodic SMI handler. This is an
- optional parameter that may be NULL. If it is
- NULL, then the handle will not be returned,
- which means that the periodic SMI handler can
- never be disabled.
- @param[in] DispatchFunction A pointer to a periodic SMI handler function.
- @param[in] Context Optional content to pass into DispatchFunction.
- @param[in] TickPeriod The requested tick period in 100ns units that
- control should be givien to the periodic SMI
- handler. Must be one of the supported values
- returned by PeriodicSmiSupportedPickPeriod().
- @param[in] Cpu Specifies the CPU that is required to execute
- the periodic SMI handler. If Cpu is
- PERIODIC_SMI_LIBRARY_ANY_CPU, then the periodic
- SMI handler will always be executed on the SMST
- CurrentlyExecutingCpu, which may vary across
- periodic SMIs. If Cpu is between 0 and the SMST
- NumberOfCpus, then the periodic SMI will always
- be executed on the requested CPU.
- @param[in] StackSize The size, in bytes, of the stack to allocate for
- use by the periodic SMI handler. If 0, then the
- default stack will be used.
-
- @retval EFI_INVALID_PARAMETER DispatchFunction is NULL.
- @retval EFI_UNSUPPORTED TickPeriod is not a supported tick period. The
- supported tick periods can be retrieved using
- PeriodicSmiSupportedTickPeriod().
- @retval EFI_INVALID_PARAMETER Cpu is not PERIODIC_SMI_LIBRARY_ANY_CPU or in
- the range 0 to SMST NumberOfCpus.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to enable the
- periodic SMI handler.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the
- stack speficied by StackSize.
- @retval EFI_SUCCESS The periodic SMI handler was enabled.
-
-**/
-EFI_STATUS
-EFIAPI
-PeriodicSmiEnable (
- IN OUT EFI_HANDLE *DispatchHandle, OPTIONAL
- IN PERIODIC_SMI_LIBRARY_HANDLER DispatchFunction,
- IN CONST VOID *Context, OPTIONAL
- IN UINT64 TickPeriod,
- IN UINTN Cpu,
- IN UINTN StackSize
- );
-
-/**
- This function disables a periodic SMI handler that has been previously
- enabled with PeriodicSmiEnable().
-
- @param[in] DispatchHandle A handle associated with a previously enabled periodic
- SMI handler. This is an optional parameter that may
- be NULL. If it is NULL, then the active periodic SMI
- handlers is disabled.
-
- @retval FALSE DispatchHandle is NULL and there is no active periodic SMI handler.
- @retval FALSE The periodic SMI handler specified by DispatchHandle has
- not been enabled with PeriodicSmiEnable().
- @retval TRUE The periodic SMI handler specified by DispatchHandle has
- been disabled. If DispatchHandle is NULL, then the active
- periodic SMI handler has been disabled.
-
-**/
-BOOLEAN
-EFIAPI
-PeriodicSmiDisable (
- IN EFI_HANDLE DispatchHandle OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SmmServicesTableLib.h b/Core/MdePkg/Include/Library/SmmServicesTableLib.h
deleted file mode 100644
index de2f57b789..0000000000
--- a/Core/MdePkg/Include/Library/SmmServicesTableLib.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- Provides a service to retrieve a pointer to the SMM Services Table.
- Only available to SMM module types.
-
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SMM_SERVICES_TABLE_LIB_H__
-#define __SMM_SERVICES_TABLE_LIB_H__
-
-#include <PiSmm.h>
-
-///
-/// Cache pointer to the SMM Services Table
-///
-extern EFI_SMM_SYSTEM_TABLE2 *gSmst;
-
-/**
- This function allows the caller to determine if the driver is executing in
- System Management Mode(SMM).
-
- This function returns TRUE if the driver is executing in SMM and FALSE if the
- driver is not executing in SMM.
-
- @retval TRUE The driver is executing in System Management Mode (SMM).
- @retval FALSE The driver is not executing in System Management Mode (SMM).
-
-**/
-BOOLEAN
-EFIAPI
-InSmm (
- VOID
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/SynchronizationLib.h b/Core/MdePkg/Include/Library/SynchronizationLib.h
deleted file mode 100644
index 6cf3d71770..0000000000
--- a/Core/MdePkg/Include/Library/SynchronizationLib.h
+++ /dev/null
@@ -1,295 +0,0 @@
-/** @file
- Provides synchronization functions.
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SYNCHRONIZATION_LIB__
-#define __SYNCHRONIZATION_LIB__
-
-///
-/// Definitions for SPIN_LOCK
-///
-typedef volatile UINTN SPIN_LOCK;
-
-
-/**
- Retrieves the architecture-specific spin lock alignment requirements for
- optimal spin lock performance.
-
- This function retrieves the spin lock alignment requirements for optimal
- performance on a given CPU architecture. The spin lock alignment is byte alignment.
- It must be a power of two and is returned by this function. If there are no alignment
- requirements, then 1 must be returned. The spin lock synchronization
- functions must function correctly if the spin lock size and alignment values
- returned by this function are not used at all. These values are hints to the
- consumers of the spin lock synchronization functions to obtain optimal spin
- lock performance.
-
- @return The architecture-specific spin lock alignment.
-
-**/
-UINTN
-EFIAPI
-GetSpinLockProperties (
- VOID
- );
-
-
-/**
- Initializes a spin lock to the released state and returns the spin lock.
-
- This function initializes the spin lock specified by SpinLock to the released
- state, and returns SpinLock. Optimal performance can be achieved by calling
- GetSpinLockProperties() to determine the size and alignment requirements for
- SpinLock.
-
- If SpinLock is NULL, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to initialize to the released
- state.
-
- @return SpinLock in release state.
-
-**/
-SPIN_LOCK *
-EFIAPI
-InitializeSpinLock (
- OUT SPIN_LOCK *SpinLock
- );
-
-
-/**
- Waits until a spin lock can be placed in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns SpinLock. Otherwise, this function waits
- indefinitely for the spin lock to be released, and then places it in the
- acquired state and returns SpinLock. All state transitions of SpinLock must
- be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
- If PcdSpinLockTimeout is not zero, and SpinLock is can not be acquired in
- PcdSpinLockTimeout microseconds, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @return SpinLock acquired lock.
-
-**/
-SPIN_LOCK *
-EFIAPI
-AcquireSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- );
-
-
-/**
- Attempts to place a spin lock in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns TRUE. Otherwise, FALSE is returned. All state
- transitions of SpinLock must be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @retval TRUE SpinLock was placed in the acquired state.
- @retval FALSE SpinLock could not be acquired.
-
-**/
-BOOLEAN
-EFIAPI
-AcquireSpinLockOrFail (
- IN OUT SPIN_LOCK *SpinLock
- );
-
-
-/**
- Releases a spin lock.
-
- This function places the spin lock specified by SpinLock in the release state
- and returns SpinLock.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to release.
-
- @return SpinLock released lock.
-
-**/
-SPIN_LOCK *
-EFIAPI
-ReleaseSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- );
-
-
-/**
- Performs an atomic increment of a 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedIncrement (
- IN volatile UINT32 *Value
- );
-
-
-/**
- Performs an atomic decrement of a 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decremented value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedDecrement (
- IN volatile UINT32 *Value
- );
-
-
-/**
- Performs an atomic compare exchange operation on a 16-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 16-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 16-bit value for the compare exchange
- operation.
- @param CompareValue 16-bit value used in compare operation.
- @param ExchangeValue 16-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-**/
-UINT16
-EFIAPI
-InterlockedCompareExchange16 (
- IN OUT volatile UINT16 *Value,
- IN UINT16 CompareValue,
- IN UINT16 ExchangeValue
- );
-
-/**
- Performs an atomic compare exchange operation on a 32-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 32-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value for the compare exchange
- operation.
- @param CompareValue 32-bit value used in compare operation.
- @param ExchangeValue 32-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT32
-EFIAPI
-InterlockedCompareExchange32 (
- IN OUT volatile UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- );
-
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InterlockedCompareExchange64 (
- IN OUT volatile UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- );
-
-
-/**
- Performs an atomic compare exchange operation on a pointer value.
-
- Performs an atomic compare exchange operation on the pointer value specified
- by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to
- CompareValue, then Value is returned. The compare exchange operation must be
- performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the pointer value for the compare exchange
- operation.
- @param CompareValue Pointer value used in compare operation.
- @param ExchangeValue Pointer value used in exchange operation.
-
- @return The original *Value before exchange.
-**/
-VOID *
-EFIAPI
-InterlockedCompareExchangePointer (
- IN OUT VOID * volatile *Value,
- IN VOID *CompareValue,
- IN VOID *ExchangeValue
- );
-
-#endif
-
-
diff --git a/Core/MdePkg/Include/Library/TimerLib.h b/Core/MdePkg/Include/Library/TimerLib.h
deleted file mode 100644
index ecc3ad3ff7..0000000000
--- a/Core/MdePkg/Include/Library/TimerLib.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/** @file
- Provides calibrated delay and performance counter services.
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __TIMER_LIB__
-#define __TIMER_LIB__
-
-/**
- Stalls the CPU for at least the given number of microseconds.
-
- Stalls the CPU for the number of microseconds specified by MicroSeconds.
-
- @param MicroSeconds The minimum number of microseconds to delay.
-
- @return The value of MicroSeconds inputted.
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN MicroSeconds
- );
-
-/**
- Stalls the CPU for at least the given number of nanoseconds.
-
- Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
-
- @param NanoSeconds The minimum number of nanoseconds to delay.
-
- @return The value of NanoSeconds inputted.
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- );
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- The counter can either count up by 1 or count down by 1. If the physical
- performance counter counts by a larger increment, then the counter values
- must be translated. The properties of the counter can be retrieved from
- GetPerformanceCounterProperties().
-
- @return The current value of the free running performance counter.
-
-**/
-UINT64
-EFIAPI
-GetPerformanceCounter (
- VOID
- );
-
-/**
- Retrieves the 64-bit frequency in Hz and the range of performance counter
- values.
-
- If StartValue is not NULL, then the value that the performance counter starts
- with immediately after is it rolls over is returned in StartValue. If
- EndValue is not NULL, then the value that the performance counter end with
- immediately before it rolls over is returned in EndValue. The 64-bit
- frequency of the performance counter in Hz is always returned. If StartValue
- is less than EndValue, then the performance counter counts up. If StartValue
- is greater than EndValue, then the performance counter counts down. For
- example, a 64-bit free running counter that counts up would have a StartValue
- of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
- that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
-
- @param StartValue The value the performance counter starts with when it
- rolls over.
- @param EndValue The value that the performance counter ends with before
- it rolls over.
-
- @return The frequency in Hz.
-
-**/
-UINT64
-EFIAPI
-GetPerformanceCounterProperties (
- OUT UINT64 *StartValue, OPTIONAL
- OUT UINT64 *EndValue OPTIONAL
- );
-
-/**
- Converts elapsed ticks of performance counter to time in nanoseconds.
-
- This function converts the elapsed ticks of running performance counter to
- time value in unit of nanoseconds.
-
- @param Ticks The number of elapsed ticks of running performance counter.
-
- @return The elapsed time in nanoseconds.
-
-**/
-UINT64
-EFIAPI
-GetTimeInNanoSecond (
- IN UINT64 Ticks
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiApplicationEntryPoint.h b/Core/MdePkg/Include/Library/UefiApplicationEntryPoint.h
deleted file mode 100644
index ec568ab6c5..0000000000
--- a/Core/MdePkg/Include/Library/UefiApplicationEntryPoint.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/** @file
- Module entry point library for UEFI Applications.
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __UEFI_APPLICATION_ENTRY_POINT_H__
-#define __UEFI_APPLICATION_ENTRY_POINT_H__
-
-///
-/// Declare the EFI/UEFI Specification Revision to which this driver is implemented
-///
-extern CONST UINT32 _gUefiDriverRevision;
-
-
-/**
- Entry point to UEFI Application.
-
- This function is the entry point for a UEFI Application. This function must call
- ProcessLibraryConstructorList(), ProcessModuleEntryPointList(), and ProcessLibraryDestructorList().
- The return value from ProcessModuleEntryPointList() is returned.
- If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
- then return EFI_INCOMPATIBLE_VERSION.
-
- @param ImageHandle The image handle of the UEFI Application.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The UEFI Application exited normally.
- @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
- @retval Other Return value from ProcessModuleEntryPointList().
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
-
- @param ImageHandle The image handle of the UEFI Application.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The UEFI Application exited normally.
- @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
- @retval Other Return value from ProcessModuleEntryPointList().
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Invokes the library destructors for all dependent libraries and terminates
- the UEFI Application.
-
- This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
- with a status specified by Status.
-
- @param Status Status returned by the application that is exiting.
-
-**/
-VOID
-EFIAPI
-Exit (
- IN EFI_STATUS Status
- );
-
-
-/**
- Autogenerated function that calls the library constructors for all of the module's
- dependent libraries.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of library constructors for the set of library instances
- that a module depends on. This includes library instances that a module depends on
- directly and library instances that a module depends on indirectly through other libraries.
- This function is autogenerated by build tools and those build tools are responsible for
- collecting the set of library instances, determine which ones have constructors, and
- calling the library constructors in the proper order based upon each of the library
- instances own dependencies.
-
- @param ImageHandle The image handle of the UEFI Application.
- @param SystemTable A pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Autogenerated function that calls the library descructors for all of the module's
- dependent libraries.
-
- This function may be called by _ModuleEntryPoint()or Exit().
- This function calls the set of library destructors for the set of library instances
- that a module depends on. This includes library instances that a module depends on
- directly and library instances that a module depends on indirectly through other libraries.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the set of library instances, determine which ones have destructors,
- and calling the library destructors in the proper order based upon each of the library
- instances own dependencies.
-
- @param ImageHandle The image handle of the UEFI Application.
- @param SystemTable A pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- This function calls the set of module entry points. It must be called by _ModuleEntryPoint().
-
- This function is autogenerated by build tools and those build tools are
- responsible for collecting the module entry points and calling them in a specified order.
-
- @param ImageHandle The image handle of the UEFI Application.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The UEFI Application executed normally.
- @retval !EFI_SUCCESS The UEFI Application failed to execute normally.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiBootServicesTableLib.h b/Core/MdePkg/Include/Library/UefiBootServicesTableLib.h
deleted file mode 100644
index 3e979be23b..0000000000
--- a/Core/MdePkg/Include/Library/UefiBootServicesTableLib.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/** @file
- Provides a service to retrieve a pointer to the EFI Boot Services Table.
- Only available to DXE and UEFI module types.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __UEFI_BOOT_SERVICES_TABLE_LIB_H__
-#define __UEFI_BOOT_SERVICES_TABLE_LIB_H__
-
-///
-/// Cache the Image Handle
-///
-extern EFI_HANDLE gImageHandle;
-
-///
-/// Cache pointer to the EFI System Table
-///
-extern EFI_SYSTEM_TABLE *gST;
-
-///
-/// Cache pointer to the EFI Boot Services Table
-///
-extern EFI_BOOT_SERVICES *gBS;
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiDecompressLib.h b/Core/MdePkg/Include/Library/UefiDecompressLib.h
deleted file mode 100644
index de4e888644..0000000000
--- a/Core/MdePkg/Include/Library/UefiDecompressLib.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/** @file
- Provides services to decompress a buffer using the UEFI Decompress algorithm.
-
- The UEFI Decompress Library enables the decompression of objects that
- were compressed using the UEFI compression scheme. The UEFI Decompress
- Library is independent of environment and requires the caller to allocate
- all required memory buffers.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __UEFI_DECPOMPRESS_LIB_H__
-#define __UEFI_DECPOMPRESS_LIB_H__
-
-/**
- Given a compressed source buffer, this function retrieves the size of
- the uncompressed buffer and the size of the scratch buffer required
- to decompress the compressed source buffer.
-
- Retrieves the size of the uncompressed buffer and the temporary scratch buffer
- required to decompress the buffer specified by Source and SourceSize.
- If the size of the uncompressed buffer or the size of the scratch buffer cannot
- be determined from the compressed data specified by Source and SourceData,
- then RETURN_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
- buffer is returned in DestinationSize, the size of the scratch buffer is returned
- in ScratchSize, and RETURN_SUCCESS is returned.
- This function does not have scratch buffer available to perform a thorough
- checking of the validity of the source data. It just retrieves the "Original Size"
- field from the beginning bytes of the source data and output it as DestinationSize.
- And ScratchSize is specific to the decompression implementation.
-
- If Source is NULL, then ASSERT().
- If DestinationSize is NULL, then ASSERT().
- If ScratchSize is NULL, then ASSERT().
-
- @param Source The source buffer containing the compressed data.
- @param SourceSize The size, in bytes, of the source buffer.
- @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer
- that will be generated when the compressed buffer specified
- by Source and SourceSize is decompressed.
- @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that
- is required to decompress the compressed buffer specified
- by Source and SourceSize.
-
- @retval RETURN_SUCCESS The size of the uncompressed data was returned
- in DestinationSize and the size of the scratch
- buffer was returned in ScratchSize.
- @retval RETURN_INVALID_PARAMETER
- The size of the uncompressed data or the size of
- the scratch buffer cannot be determined from
- the compressed data specified by Source
- and SourceSize.
-**/
-RETURN_STATUS
-EFIAPI
-UefiDecompressGetInfo (
- IN CONST VOID *Source,
- IN UINT32 SourceSize,
- OUT UINT32 *DestinationSize,
- OUT UINT32 *ScratchSize
- );
-
-/**
- Decompresses a compressed source buffer.
-
- Extracts decompressed data to its original form.
- This function is designed so that the decompression algorithm can be implemented
- without using any memory services. As a result, this function is not allowed to
- call any memory allocation services in its implementation. It is the caller's
- responsibility to allocate and free the Destination and Scratch buffers.
- If the compressed source data specified by Source is successfully decompressed
- into Destination, then RETURN_SUCCESS is returned. If the compressed source data
- specified by Source is not in a valid compressed data format,
- then RETURN_INVALID_PARAMETER is returned.
-
- If Source is NULL, then ASSERT().
- If Destination is NULL, then ASSERT().
- If the required scratch buffer size > 0 and Scratch is NULL, then ASSERT().
-
- @param Source The source buffer containing the compressed data.
- @param Destination The destination buffer to store the decompressed data
- @param Scratch A temporary scratch buffer that is used to perform the decompression.
- This is an optional parameter that may be NULL if the
- required scratch buffer size is 0.
-
- @retval RETURN_SUCCESS Decompression completed successfully, and
- the uncompressed buffer is returned in Destination.
- @retval RETURN_INVALID_PARAMETER
- The source buffer specified by Source is corrupted
- (not in a valid compressed format).
-**/
-RETURN_STATUS
-EFIAPI
-UefiDecompress (
- IN CONST VOID *Source,
- IN OUT VOID *Destination,
- IN OUT VOID *Scratch OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiDriverEntryPoint.h b/Core/MdePkg/Include/Library/UefiDriverEntryPoint.h
deleted file mode 100644
index f9d9befb9c..0000000000
--- a/Core/MdePkg/Include/Library/UefiDriverEntryPoint.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,
- and DXE SMM Drivers.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MODULE_ENTRY_POINT_H__
-#define __MODULE_ENTRY_POINT_H__
-
-///
-///Declare the PI Specification Revision that this driver requires to execute correctly.
-///
-extern CONST UINT32 _gDxeRevision;
-
-///
-/// Declare the EFI/UEFI Specification Revision to which this driver is implemented
-///
-extern CONST UINT32 _gUefiDriverRevision;
-
-///
-/// Declare the number of unload handler in the image.
-///
-extern CONST UINT8 _gDriverUnloadImageCount;
-
-
-/**
- The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
-
- This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver,
- or UEFI Driver. This function must call ProcessLibraryConstructorList() and
- ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList()
- is an error status, then ProcessLibraryDestructorList() must be called. The return value
- from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount is greater
- than zero, then an unload handler must be registered for this image and the unload handler
- must invoke ProcessModuleUnloadList().
- If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,
- then return EFI_INCOMPATIBLE_VERSION.
-
-
- @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
- or UEFI Driver exited normally.
- @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
- @retval Other Return value from ProcessModuleEntryPointList().
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
-
- This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.
-
- @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
- or UEFI Driver exited normally.
- @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.
- @retval Other Return value from ProcessModuleEntryPointList().
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Invokes the library destructors for all dependent libraries and terminates the
- DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
-
- This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()
- with a status specified by Status.
-
- @param Status Status returned by the driver that is exiting.
-
-**/
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- );
-
-
-/**
- Autogenerated function that calls the library constructors for all of the module's
- dependent libraries.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of library constructors for the set of library instances
- that a module depends on. This includes library instances that a module depends on
- directly and library instances that a module depends on indirectly through other libraries.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the set of library instances, determine which ones have constructors,
- and calling the library constructors in the proper order based upon each of the library
- instances own dependencies.
-
- @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
- @param SystemTable A pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Autogenerated function that calls the library descructors for all of the module's
- dependent libraries.
-
- This function may be called by _ModuleEntryPoint() or ExitDriver().
- This function calls the set of library destructors for the set of library instances
- that a module depends on. This includes library instances that a module depends on
- directly and library instances that a module depends on indirectly through other libraries.
- This function is autogenerated by build tools and those build tools are responsible for
- collecting the set of library instances, determine which ones have destructors, and calling
- the library destructors in the proper order based upon each of the library instances own dependencies.
-
- @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
- @param SystemTable A pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Autogenerated function that calls a set of module entry points.
-
- This function must be called by _ModuleEntryPoint().
- This function calls the set of module entry points.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the module entry points and calling them in a specified order.
-
- @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver executed normally.
- @retval !EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver failed to execute normally.
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Autogenerated function that calls a set of module unload handlers.
-
- This function must be called from the unload handler registered by _ModuleEntryPoint().
- This function calls the set of module unload handlers.
- This function is autogenerated by build tools and those build tools are responsible
- for collecting the module unload handlers and calling them in a specified order.
-
- @param ImageHandle The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.
-
- @retval EFI_SUCCESS The unload handlers executed normally.
- @retval !EFI_SUCCESS The unload handlers failed to execute normally.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- IN EFI_HANDLE ImageHandle
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiLib.h b/Core/MdePkg/Include/Library/UefiLib.h
deleted file mode 100644
index 0b14792a0a..0000000000
--- a/Core/MdePkg/Include/Library/UefiLib.h
+++ /dev/null
@@ -1,1493 +0,0 @@
-/** @file
- Provides library functions for common UEFI operations. Only available to DXE
- and UEFI module types.
-
- The UEFI Library provides functions and macros that simplify the development of
- UEFI Drivers and UEFI Applications. These functions and macros help manage EFI
- events, build simple locks utilizing EFI Task Priority Levels (TPLs), install
- EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
- and print messages on the console output and standard error devices.
-
- Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention
- of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
- defined, then debug and assert related macros wrapped by it are the NULL implementations.
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __UEFI_LIB_H__
-#define __UEFI_LIB_H__
-
-#include <Protocol/DriverBinding.h>
-#include <Protocol/DriverConfiguration.h>
-#include <Protocol/ComponentName.h>
-#include <Protocol/ComponentName2.h>
-#include <Protocol/DriverDiagnostics.h>
-#include <Protocol/DriverDiagnostics2.h>
-#include <Protocol/GraphicsOutput.h>
-
-#include <Library/BaseLib.h>
-
-///
-/// Unicode String Table
-///
-typedef struct {
- CHAR8 *Language;
- CHAR16 *UnicodeString;
-} EFI_UNICODE_STRING_TABLE;
-
-///
-/// EFI Lock Status
-///
-typedef enum {
- EfiLockUninitialized = 0,
- EfiLockReleased = 1,
- EfiLockAcquired = 2
-} EFI_LOCK_STATE;
-
-///
-/// EFI Lock
-///
-typedef struct {
- EFI_TPL Tpl;
- EFI_TPL OwnerTpl;
- EFI_LOCK_STATE Lock;
-} EFI_LOCK;
-
-/**
- Macro that returns the number of 100 ns units for a specified number of microseconds.
- This is useful for managing EFI timer events.
-
- @param Microseconds The number of microseconds.
-
- @return The number of 100 ns units equivalent to the number of microseconds specified
- by Microseconds.
-
-**/
-#define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10)
-
-/**
- Macro that returns the number of 100 ns units for a specified number of milliseconds.
- This is useful for managing EFI timer events.
-
- @param Milliseconds The number of milliseconds.
-
- @return The number of 100 ns units equivalent to the number of milliseconds specified
- by Milliseconds.
-
-**/
-#define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)
-
-/**
- Macro that returns the number of 100 ns units for a specified number of seconds.
- This is useful for managing EFI timer events.
-
- @param Seconds The number of seconds.
-
- @return The number of 100 ns units equivalent to the number of seconds specified
- by Seconds.
-
-**/
-#define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
-
-/**
- Macro that returns the a pointer to the next EFI_MEMORY_DESCRIPTOR in an array
- returned from GetMemoryMap().
-
- @param MemoryDescriptor A pointer to an EFI_MEMORY_DESCRIPTOR.
-
- @param Size The size, in bytes, of the current EFI_MEMORY_DESCRIPTOR.
-
- @return A pointer to the next EFI_MEMORY_DESCRIPTOR.
-
-**/
-#define NEXT_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) \
- ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))
-
-/**
- Retrieves a pointer to the system configuration table from the EFI System Table
- based on a specified GUID.
-
- This function searches the list of configuration tables stored in the EFI System Table
- for a table with a GUID that matches TableGuid. If a match is found, then a pointer to
- the configuration table is returned in Table, and EFI_SUCCESS is returned. If a matching GUID
- is not found, then EFI_NOT_FOUND is returned.
- If TableGuid is NULL, then ASSERT().
- If Table is NULL, then ASSERT().
-
- @param TableGuid The pointer to table's GUID type..
- @param Table The pointer to the table associated with TableGuid in the EFI System Table.
-
- @retval EFI_SUCCESS A configuration table matching TableGuid was found.
- @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- OUT VOID **Table
- );
-
-/**
- Creates and returns a notification event and registers that event with all the protocol
- instances specified by ProtocolGuid.
-
- This function causes the notification function to be executed for every protocol of type
- ProtocolGuid instance that exists in the system when this function is invoked. If there are
- no instances of ProtocolGuid in the handle database at the time this function is invoked,
- then the notification function is still executed one time. In addition, every time a protocol
- of type ProtocolGuid instance is installed or reinstalled, the notification function is also
- executed. This function returns the notification event that was created.
- If ProtocolGuid is NULL, then ASSERT().
- If NotifyTpl is not a legal TPL value, then ASSERT().
- If NotifyFunction is NULL, then ASSERT().
- If Registration is NULL, then ASSERT().
-
-
- @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
- @param NotifyTpl Supplies the task priority level of the event notifications.
- @param NotifyFunction Supplies the function to notify when the event is signaled.
- @param NotifyContext The context parameter to pass to NotifyFunction.
- @param Registration A pointer to a memory location to receive the registration value.
- This value is passed to LocateHandle() to obtain new handles that
- have been added that support the ProtocolGuid-specified protocol.
-
- @return The notification event that was created.
-
-**/
-EFI_EVENT
-EFIAPI
-EfiCreateProtocolNotifyEvent(
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext, OPTIONAL
- OUT VOID **Registration
- );
-
-/**
- Creates a named event that can be signaled with EfiNamedEventSignal().
-
- This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
- This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more
- listeners on the same event named by the GUID specified by Name.
- If Name is NULL, then ASSERT().
- If NotifyTpl is not a legal TPL value, then ASSERT().
- If NotifyFunction is NULL, then ASSERT().
-
- @param Name Supplies GUID name of the event.
- @param NotifyTpl Supplies the task priority level of the event notifications.
- @param NotifyFunction Supplies the function to notify when the event is signaled.
- @param NotifyContext The context parameter to pass to NotifyFunction.
- @param Registration A pointer to a memory location to receive the registration value.
-
- @retval EFI_SUCCESS A named event was created.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to create the named event.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiNamedEventListen (
- IN CONST EFI_GUID *Name,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN CONST VOID *NotifyContext, OPTIONAL
- OUT VOID *Registration OPTIONAL
- );
-
-/**
- Signals a named event created with EfiNamedEventListen().
-
- This function signals the named event specified by Name. The named event must have been
- created with EfiNamedEventListen().
- If Name is NULL, then ASSERT().
-
- @param Name Supplies the GUID name of the event.
-
- @retval EFI_SUCCESS A named event was signaled.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to signal the named event.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiNamedEventSignal (
- IN CONST EFI_GUID *Name
- );
-
-/**
- Signals an event group by placing a new event in the group temporarily and
- signaling it.
-
- @param[in] EventGroup Supplies the unique identifier of the event
- group to signal.
-
- @retval EFI_SUCCESS The event group was signaled successfully.
- @retval EFI_INVALID_PARAMETER EventGroup is NULL.
- @return Error codes that report problems about event
- creation or signaling.
-**/
-EFI_STATUS
-EFIAPI
-EfiEventGroupSignal (
- IN CONST EFI_GUID *EventGroup
- );
-
-/**
- An empty function that can be used as NotifyFunction parameter of
- CreateEvent() or CreateEventEx().
-
- @param Event Event whose notification function is being invoked.
- @param Context The pointer to the notification function's context,
- which is implementation-dependent.
-
-**/
-VOID
-EFIAPI
-EfiEventEmptyFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-/**
- Returns the current TPL.
-
- This function returns the current TPL. There is no EFI service to directly
- retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
- the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
- can then immediately be restored back to the current TPL level with a call
- to RestoreTPL().
-
- @return The current TPL.
-
-**/
-EFI_TPL
-EFIAPI
-EfiGetCurrentTpl (
- VOID
- );
-
-/**
- Initializes a basic mutual exclusion lock.
-
- This function initializes a basic mutual exclusion lock to the released state
- and returns the lock. Each lock provides mutual exclusion access at its task
- priority level. Since there is no preemption or multiprocessor support in EFI,
- acquiring the lock only consists of raising to the locks TPL.
- If Lock is NULL, then ASSERT().
- If Priority is not a valid TPL value, then ASSERT().
-
- @param Lock A pointer to the lock data structure to initialize.
- @param Priority The EFI TPL associated with the lock.
-
- @return The lock.
-
-**/
-EFI_LOCK *
-EFIAPI
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- );
-
-/**
- Initializes a basic mutual exclusion lock.
-
- This macro initializes the contents of a basic mutual exclusion lock to the
- released state. Each lock provides mutual exclusion access at its task
- priority level. Since there is no preemption or multiprocessor support in EFI,
- acquiring the lock only consists of raising to the locks TPL.
-
- @param Priority The task priority level of the lock.
-
- @return The lock.
-
-**/
-#define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
- {Priority, TPL_APPLICATION, EfiLockReleased }
-
-
-/**
- Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
-
- If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED
- bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_LOCK
- structure specified by Lock. If Lock is not in the locked state, then
- DebugAssert() is called passing in the source filename, source line number,
- and Lock.
-
- If Lock is NULL, then ASSERT().
-
- @param LockParameter A pointer to the lock to acquire.
-
-**/
-#if !defined(MDEPKG_NDEBUG)
- #define ASSERT_LOCKED(LockParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- ASSERT (LockParameter != NULL); \
- if ((LockParameter)->Lock != EfiLockAcquired) { \
- _ASSERT (LockParameter not locked); \
- } \
- } \
- } while (FALSE)
-#else
- #define ASSERT_LOCKED(LockParameter)
-#endif
-
-
-/**
- Acquires ownership of a lock.
-
- This function raises the system's current task priority level to the task
- priority level of the mutual exclusion lock. Then, it places the lock in the
- acquired state.
- If Lock is NULL, then ASSERT().
- If Lock is not initialized, then ASSERT().
- If Lock is already in the acquired state, then ASSERT().
-
- @param Lock A pointer to the lock to acquire.
-
-**/
-VOID
-EFIAPI
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- );
-
-/**
- Acquires ownership of a lock.
-
- This function raises the system's current task priority level to the task priority
- level of the mutual exclusion lock. Then, it attempts to place the lock in the acquired state.
- If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned.
- Otherwise, EFI_SUCCESS is returned.
- If Lock is NULL, then ASSERT().
- If Lock is not initialized, then ASSERT().
-
- @param Lock A pointer to the lock to acquire.
-
- @retval EFI_SUCCESS The lock was acquired.
- @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- );
-
-/**
- Releases ownership of a lock.
-
- This function transitions a mutual exclusion lock from the acquired state to
- the released state, and restores the system's task priority level to its
- previous level.
- If Lock is NULL, then ASSERT().
- If Lock is not initialized, then ASSERT().
- If Lock is already in the released state, then ASSERT().
-
- @param Lock A pointer to the lock to release.
-
-**/
-VOID
-EFIAPI
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- );
-
-/**
- Tests whether a controller handle is being managed by a specific driver.
-
- This function tests whether the driver specified by DriverBindingHandle is
- currently managing the controller specified by ControllerHandle. This test
- is performed by evaluating if the the protocol specified by ProtocolGuid is
- present on ControllerHandle and is was opened by DriverBindingHandle with an
- attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
- If ProtocolGuid is NULL, then ASSERT().
-
- @param ControllerHandle A handle for a controller to test.
- @param DriverBindingHandle Specifies the driver binding handle for the
- driver.
- @param ProtocolGuid Specifies the protocol that the driver specified
- by DriverBindingHandle opens in its Start()
- function.
-
- @retval EFI_SUCCESS ControllerHandle is managed by the driver
- specified by DriverBindingHandle.
- @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
- specified by DriverBindingHandle.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiTestManagedDevice (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_GUID *ProtocolGuid
- );
-
-/**
- Tests whether a child handle is a child device of the controller.
-
- This function tests whether ChildHandle is one of the children of
- ControllerHandle. This test is performed by checking to see if the protocol
- specified by ProtocolGuid is present on ControllerHandle and opened by
- ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
- If ProtocolGuid is NULL, then ASSERT().
-
- @param ControllerHandle A handle for a (parent) controller to test.
- @param ChildHandle A child handle to test.
- @param ProtocolGuid Supplies the protocol that the child controller
- opens on its parent controller.
-
- @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
- @retval EFI_UNSUPPORTED ChildHandle is not a child of the
- ControllerHandle.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiTestChildHandle (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE ChildHandle,
- IN CONST EFI_GUID *ProtocolGuid
- );
-
-/**
- This function looks up a Unicode string in UnicodeStringTable.
-
- If Language is a member of SupportedLanguages and a Unicode string is found in
- UnicodeStringTable that matches the language code specified by Language, then it
- is returned in UnicodeString.
-
- @param Language A pointer to the ISO 639-2 language code for the
- Unicode string to look up and return.
- @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
- that the Unicode string table supports. Language
- must be a member of this set.
- @param UnicodeStringTable A pointer to the table of Unicode strings.
- @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
- that matches the language specified by Language.
-
- @retval EFI_SUCCESS The Unicode string that matches the language
- specified by Language was found
- in the table of Unicode strings UnicodeStringTable,
- and it was returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
- @retval EFI_UNSUPPORTED The language specified by Language is not a
- member of SupportedLanguages.
- @retval EFI_UNSUPPORTED The language specified by Language is not
- supported by UnicodeStringTable.
-
-**/
-EFI_STATUS
-EFIAPI
-LookupUnicodeString (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
- OUT CHAR16 **UnicodeString
- );
-
-/**
- This function looks up a Unicode string in UnicodeStringTable.
-
- If Language is a member of SupportedLanguages and a Unicode string is found in
- UnicodeStringTable that matches the language code specified by Language, then
- it is returned in UnicodeString.
-
- @param Language A pointer to an ASCII string containing the ISO 639-2 or the
- RFC 4646 language code for the Unicode string to look up and
- return. If Iso639Language is TRUE, then this ASCII string is
- not assumed to be Null-terminated, and only the first three
- characters are used. If Iso639Language is FALSE, then this ASCII
- string must be Null-terminated.
- @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains a
- set of ISO 639-2 or RFC 4646 language codes that the Unicode
- string table supports. Language must be a member of this set.
- If Iso639Language is TRUE, then this string contains one or more
- ISO 639-2 language codes with no separator characters. If Iso639Language
- is FALSE, then is string contains one or more RFC 4646 language
- codes separated by ';'.
- @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE
- is defined in "Related Definitions".
- @param UnicodeString A pointer to the Null-terminated Unicode string from UnicodeStringTable
- that matches the language specified by Language.
- @param Iso639Language Specifies the supported language code format. If it is TRUE, then
- Language and SupportedLanguages follow ISO 639-2 language code format.
- Otherwise, they follow the RFC 4646 language code format.
-
-
- @retval EFI_SUCCESS The Unicode string that matches the language specified by Language
- was found in the table of Unicode strings UnicodeStringTable, and
- it was returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
- @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.
- @retval EFI_UNSUPPORTED The language specified by Language is not supported by UnicodeStringTable.
-
-**/
-EFI_STATUS
-EFIAPI
-LookupUnicodeString2 (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
- OUT CHAR16 **UnicodeString,
- IN BOOLEAN Iso639Language
- );
-
-/**
- This function adds a Unicode string to UnicodeStringTable.
-
- If Language is a member of SupportedLanguages then UnicodeString is added to
- UnicodeStringTable. New buffers are allocated for both Language and
- UnicodeString. The contents of Language and UnicodeString are copied into
- these new buffers. These buffers are automatically freed when
- FreeUnicodeStringTable() is called.
-
- @param Language A pointer to the ISO 639-2 language code for the Unicode
- string to add.
- @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
- that the Unicode string table supports.
- Language must be a member of this set.
- @param UnicodeStringTable A pointer to the table of Unicode strings.
- @param UnicodeString A pointer to the Unicode string to add.
-
- @retval EFI_SUCCESS The Unicode string that matches the language
- specified by Language was found in the table of
- Unicode strings UnicodeStringTable, and it was
- returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_ALREADY_STARTED A Unicode string with language Language is
- already present in UnicodeStringTable.
- @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
- Unicode string to UnicodeStringTable.
- @retval EFI_UNSUPPORTED The language specified by Language is not a
- member of SupportedLanguages.
-
-**/
-EFI_STATUS
-EFIAPI
-AddUnicodeString (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
- IN CONST CHAR16 *UnicodeString
- );
-
-/**
- This function adds the Null-terminated Unicode string specified by UnicodeString
- to UnicodeStringTable.
-
- If Language is a member of SupportedLanguages then UnicodeString is added to
- UnicodeStringTable. New buffers are allocated for both Language and UnicodeString.
- The contents of Language and UnicodeString are copied into these new buffers.
- These buffers are automatically freed when EfiLibFreeUnicodeStringTable() is called.
-
- @param Language A pointer to an ASCII string containing the ISO 639-2 or
- the RFC 4646 language code for the Unicode string to add.
- If Iso639Language is TRUE, then this ASCII string is not
- assumed to be Null-terminated, and only the first three
- chacters are used. If Iso639Language is FALSE, then this
- ASCII string must be Null-terminated.
- @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains
- a set of ISO 639-2 or RFC 4646 language codes that the Unicode
- string table supports. Language must be a member of this set.
- If Iso639Language is TRUE, then this string contains one or more
- ISO 639-2 language codes with no separator characters.
- If Iso639Language is FALSE, then is string contains one or more
- RFC 4646 language codes separated by ';'.
- @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE
- is defined in "Related Definitions".
- @param UnicodeString A pointer to the Unicode string to add.
- @param Iso639Language Specifies the supported language code format. If it is TRUE,
- then Language and SupportedLanguages follow ISO 639-2 language code format.
- Otherwise, they follow RFC 4646 language code format.
-
- @retval EFI_SUCCESS The Unicode string that matches the language specified by
- Language was found in the table of Unicode strings UnicodeStringTable,
- and it was returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_ALREADY_STARTED A Unicode string with language Language is already present in
- UnicodeStringTable.
- @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable.
- @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.
-
-**/
-EFI_STATUS
-EFIAPI
-AddUnicodeString2 (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
- IN CONST CHAR16 *UnicodeString,
- IN BOOLEAN Iso639Language
- );
-
-/**
- This function frees the table of Unicode strings in UnicodeStringTable.
-
- If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
- Otherwise, each language code, and each Unicode string in the Unicode string
- table are freed, and EFI_SUCCESS is returned.
-
- @param UnicodeStringTable A pointer to the table of Unicode strings.
-
- @retval EFI_SUCCESS The Unicode string table was freed.
-
-**/
-EFI_STATUS
-EFIAPI
-FreeUnicodeStringTable (
- IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
- );
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Returns a pointer to an allocated buffer that contains the contents of a
- variable retrieved through the UEFI Runtime Service GetVariable(). The
- returned buffer is allocated using AllocatePool(). The caller is responsible
- for freeing this buffer with FreePool().
-
- If Name is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
-
- @param[in] Name The pointer to a Null-terminated Unicode string.
- @param[in] Guid The pointer to an EFI_GUID structure.
-
- @retval NULL The variable could not be retrieved.
- @retval NULL There are not enough resources available for the variable contents.
- @retval Other A pointer to allocated buffer containing the variable contents.
-
-**/
-VOID *
-EFIAPI
-GetVariable (
- IN CONST CHAR16 *Name,
- IN CONST EFI_GUID *Guid
- );
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Returns a pointer to an allocated buffer that contains the contents of a
- variable retrieved through the UEFI Runtime Service GetVariable(). This
- function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
- The returned buffer is allocated using AllocatePool(). The caller is
- responsible for freeing this buffer with FreePool().
-
- If Name is NULL, then ASSERT().
-
- @param[in] Name The pointer to a Null-terminated Unicode string.
-
- @retval NULL The variable could not be retrieved.
- @retval NULL There are not enough resources available for the variable contents.
- @retval Other A pointer to allocated buffer containing the variable contents.
-
-**/
-VOID *
-EFIAPI
-GetEfiGlobalVariable (
- IN CONST CHAR16 *Name
- );
-#endif
-
-
-/**
- Returns the status whether get the variable success. The function retrieves
- variable through the UEFI Runtime Service GetVariable(). The
- returned buffer is allocated using AllocatePool(). The caller is responsible
- for freeing this buffer with FreePool().
-
- If Name is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
- If Value is NULL, then ASSERT().
-
- @param[in] Name The pointer to a Null-terminated Unicode string.
- @param[in] Guid The pointer to an EFI_GUID structure
- @param[out] Value The buffer point saved the variable info.
- @param[out] Size The buffer size of the variable.
-
- @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
- @return EFI_SUCCESS Find the specified variable.
- @return Others Errors Return errors from call to gRT->GetVariable.
-
-**/
-EFI_STATUS
-EFIAPI
-GetVariable2 (
- IN CONST CHAR16 *Name,
- IN CONST EFI_GUID *Guid,
- OUT VOID **Value,
- OUT UINTN *Size OPTIONAL
- );
-
-/**
- Returns a pointer to an allocated buffer that contains the contents of a
- variable retrieved through the UEFI Runtime Service GetVariable(). This
- function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
- The returned buffer is allocated using AllocatePool(). The caller is
- responsible for freeing this buffer with FreePool().
-
- If Name is NULL, then ASSERT().
- If Value is NULL, then ASSERT().
-
- @param[in] Name The pointer to a Null-terminated Unicode string.
- @param[out] Value The buffer point saved the variable info.
- @param[out] Size The buffer size of the variable.
-
- @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
- @return EFI_SUCCESS Find the specified variable.
- @return Others Errors Return errors from call to gRT->GetVariable.
-
-**/
-EFI_STATUS
-EFIAPI
-GetEfiGlobalVariable2 (
- IN CONST CHAR16 *Name,
- OUT VOID **Value,
- OUT UINTN *Size OPTIONAL
- );
-
-/**
- Returns a pointer to an allocated buffer that contains the best matching language
- from a set of supported languages.
-
- This function supports both ISO 639-2 and RFC 4646 language codes, but language
- code types may not be mixed in a single call to this function. The language
- code returned is allocated using AllocatePool(). The caller is responsible for
- freeing the allocated buffer using FreePool(). This function supports a variable
- argument list that allows the caller to pass in a prioritized list of language
- codes to test against all the language codes in SupportedLanguages.
-
- If SupportedLanguages is NULL, then ASSERT().
-
- @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that
- contains a set of language codes in the format
- specified by Iso639Language.
- @param[in] Iso639Language If TRUE, then all language codes are assumed to be
- in ISO 639-2 format. If FALSE, then all language
- codes are assumed to be in RFC 4646 language format
- @param[in] ... A variable argument list that contains pointers to
- Null-terminated ASCII strings that contain one or more
- language codes in the format specified by Iso639Language.
- The first language code from each of these language
- code lists is used to determine if it is an exact or
- close match to any of the language codes in
- SupportedLanguages. Close matches only apply to RFC 4646
- language codes, and the matching algorithm from RFC 4647
- is used to determine if a close match is present. If
- an exact or close match is found, then the matching
- language code from SupportedLanguages is returned. If
- no matches are found, then the next variable argument
- parameter is evaluated. The variable argument list
- is terminated by a NULL.
-
- @retval NULL The best matching language could not be found in SupportedLanguages.
- @retval NULL There are not enough resources available to return the best matching
- language.
- @retval Other A pointer to a Null-terminated ASCII string that is the best matching
- language in SupportedLanguages.
-
-**/
-CHAR8 *
-EFIAPI
-GetBestLanguage (
- IN CONST CHAR8 *SupportedLanguages,
- IN BOOLEAN Iso639Language,
- ...
- );
-
-/**
- Draws a dialog box to the console output device specified by
- ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke
- from the console input device specified by ConIn defined in the
- EFI_SYSTEM_TABLE.
-
- If there are no strings in the variable argument list, then ASSERT().
- If all the strings in the variable argument list are empty, then ASSERT().
-
- @param[in] Attribute Specifies the foreground and background color of the popup.
- @param[out] Key A pointer to the EFI_KEY value of the key that was
- pressed. This is an optional parameter that may be NULL.
- If it is NULL then no wait for a keypress will be performed.
- @param[in] ... The variable argument list that contains pointers to Null-
- terminated Unicode strings to display in the dialog box.
- The variable argument list is terminated by a NULL.
-
-**/
-VOID
-EFIAPI
-CreatePopUp (
- IN UINTN Attribute,
- OUT EFI_INPUT_KEY *Key, OPTIONAL
- ...
- );
-
-/**
- Retrieves the width of a Unicode character.
-
- This function computes and returns the width of the Unicode character specified
- by UnicodeChar.
-
- @param UnicodeChar A Unicode character.
-
- @retval 0 The width if UnicodeChar could not be determined.
- @retval 1 UnicodeChar is a narrow glyph.
- @retval 2 UnicodeChar is a wide glyph.
-
-**/
-UINTN
-EFIAPI
-GetGlyphWidth (
- IN CHAR16 UnicodeChar
- );
-
-/**
- Computes the display length of a Null-terminated Unicode String.
-
- This function computes and returns the display length of the Null-terminated Unicode
- string specified by String. If String is NULL then 0 is returned. If any of the widths
- of the Unicode characters in String can not be determined, then 0 is returned. The display
- width of String can be computed by summing the display widths of each Unicode character
- in String. Unicode characters that are narrow glyphs have a width of 1, and Unicode
- characters that are width glyphs have a width of 2.
- If String is not aligned on a 16-bit boundary, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @return The display length of the Null-terminated Unicode string specified by String.
-
-**/
-UINTN
-EFIAPI
-UnicodeStringDisplayLength (
- IN CONST CHAR16 *String
- );
-
-//
-// Functions that abstract early Framework contamination of UEFI.
-//
-/**
- Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().
-
- This function abstracts the signaling of the Ready to Boot Event. The Framework moved
- from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller
- from how this event is created to prevent to code form having to change with the
- version of the specification supported.
-
-**/
-VOID
-EFIAPI
-EfiSignalEventReadyToBoot (
- VOID
- );
-
-/**
- Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().
-
- This function abstracts the signaling of the Legacy Boot Event. The Framework moved from
- a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how
- this event is created to prevent to code form having to change with the version of the
- specification supported.
-
-**/
-VOID
-EFIAPI
-EfiSignalEventLegacyBoot (
- VOID
- );
-
-/**
- Creates an EFI event in the Legacy Boot Event Group.
-
- Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library
- abstracts the implementation mechanism of this event from the caller. This function
- abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary
- to UEFI 2.0 based mechanism. This library abstracts the caller from how this event
- is created to prevent to code form having to change with the version of the
- specification supported.
- If LegacyBootEvent is NULL, then ASSERT().
-
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS The event was created.
- @retval Other The event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventLegacyBoot (
- OUT EFI_EVENT *LegacyBootEvent
- );
-
-/**
- Create an EFI event in the Legacy Boot Event Group and allows
- the caller to specify a notification function.
-
- This function abstracts the creation of the Legacy Boot Event.
- The Framework moved from a proprietary to UEFI 2.0 based mechanism.
- This library abstracts the caller from how this event is created to prevent
- to code form having to change with the version of the specification supported.
- If LegacyBootEvent is NULL, then ASSERT().
-
- @param NotifyTpl The task priority level of the event.
- @param NotifyFunction The notification function to call when the event is signaled.
- @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS The event was created.
- @retval Other The event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventLegacyBootEx (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
- IN VOID *NotifyContext, OPTIONAL
- OUT EFI_EVENT *LegacyBootEvent
- );
-
-/**
- Create an EFI event in the Ready To Boot Event Group.
-
- Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library
- abstracts the implementation mechanism of this event from the caller.
- This function abstracts the creation of the Ready to Boot Event. The Framework
- moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts
- the caller from how this event is created to prevent the code form having to
- change with the version of the specification supported.
- If ReadyToBootEvent is NULL, then ASSERT().
-
- @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS The event was created.
- @retval Other The event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventReadyToBoot (
- OUT EFI_EVENT *ReadyToBootEvent
- );
-
-/**
- Create an EFI event in the Ready To Boot Event Group and allows
- the caller to specify a notification function.
-
- This function abstracts the creation of the Ready to Boot Event.
- The Framework moved from a proprietary to UEFI 2.0 based mechanism.
- This library abstracts the caller from how this event is created to prevent
- to code form having to change with the version of the specification supported.
- If ReadyToBootEvent is NULL, then ASSERT().
-
- @param NotifyTpl The task priority level of the event.
- @param NotifyFunction The notification function to call when the event is signaled.
- @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
- @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS The event was created.
- @retval Other The event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventReadyToBootEx (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
- IN VOID *NotifyContext, OPTIONAL
- OUT EFI_EVENT *ReadyToBootEvent
- );
-
-/**
- Initialize a Firmware Volume (FV) Media Device Path node.
-
- The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
- This library function abstracts initializing a device path node.
- Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device
- path changed in the DXE CIS version 0.92 in a non back ward compatible way to
- not conflict with the UEFI 2.0 specification. This function abstracts the
- differences from the caller.
- If FvDevicePathNode is NULL, then ASSERT().
- If NameGuid is NULL, then ASSERT().
-
- @param FvDevicePathNode The pointer to a FV device path node to initialize
- @param NameGuid FV file name to use in FvDevicePathNode
-
-**/
-VOID
-EFIAPI
-EfiInitializeFwVolDevicepathNode (
- IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
- IN CONST EFI_GUID *NameGuid
- );
-
-/**
- Check to see if the Firmware Volume (FV) Media Device Path is valid
-
- The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
- This library function abstracts validating a device path node.
- Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.
- If it is valid, then return the GUID file name from the device path node. Otherwise,
- return NULL. This device path changed in the DXE CIS version 0.92 in a non backward
- compatible way to not conflict with the UEFI 2.0 specification. This function abstracts
- the differences from the caller.
- If FvDevicePathNode is NULL, then ASSERT().
-
- @param FvDevicePathNode The pointer to FV device path to check.
-
- @retval NULL FvDevicePathNode is not valid.
- @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
-
-**/
-EFI_GUID *
-EFIAPI
-EfiGetNameGuidFromFwVolDevicePathNode (
- IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
- );
-
-/**
- Prints a formatted Unicode string to the console output device specified by
- ConOut defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted Unicode string to the console output device
- specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
- characters that printed to ConOut. If the length of the formatted Unicode
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
- If gST->ConOut is NULL, then ASSERT().
-
- @param Format A null-terminated Unicode format string.
- @param ... The variable argument list whose contents are accessed based
- on the format string specified by Format.
-
- @return Number of Unicode characters printed to ConOut.
-
-**/
-UINTN
-EFIAPI
-Print (
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Prints a formatted Unicode string to the console output device specified by
- StdErr defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted Unicode string to the console output device
- specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
- characters that printed to StdErr. If the length of the formatted Unicode
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
- If gST->StdErr is NULL, then ASSERT().
-
- @param Format A null-terminated Unicode format string.
- @param ... The variable argument list whose contents are accessed based
- on the format string specified by Format.
-
- @return Number of Unicode characters printed to StdErr.
-
-**/
-UINTN
-EFIAPI
-ErrorPrint (
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Prints a formatted ASCII string to the console output device specified by
- ConOut defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted ASCII string to the console output device
- specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
- characters that printed to ConOut. If the length of the formatted ASCII
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
- If Format is NULL, then ASSERT().
- If gST->ConOut is NULL, then ASSERT().
-
- @param Format A null-terminated ASCII format string.
- @param ... The variable argument list whose contents are accessed based
- on the format string specified by Format.
-
- @return Number of ASCII characters printed to ConOut.
-
-**/
-UINTN
-EFIAPI
-AsciiPrint (
- IN CONST CHAR8 *Format,
- ...
- );
-
-/**
- Prints a formatted ASCII string to the console output device specified by
- StdErr defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted ASCII string to the console output device
- specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
- characters that printed to StdErr. If the length of the formatted ASCII
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
- If Format is NULL, then ASSERT().
- If gST->StdErr is NULL, then ASSERT().
-
- @param Format A null-terminated ASCII format string.
- @param ... The variable argument list whose contents are accessed based
- on the format string specified by Format.
-
- @return Number of ASCII characters printed to ConErr.
-
-**/
-UINTN
-EFIAPI
-AsciiErrorPrint (
- IN CONST CHAR8 *Format,
- ...
- );
-
-
-/**
- Prints a formatted Unicode string to a graphics console device specified by
- ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
-
- This function prints a formatted Unicode string to the graphics console device
- specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
- Unicode characters displayed, not including partial characters that may be clipped
- by the right edge of the display. If the length of the formatted Unicode string is
- greater than PcdUefiLibMaxPrintBufferSize, then at most the first
- PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
- is used to convert the string to a bitmap using the glyphs registered with the
- HII database. No wrapping is performed, so any portions of the string the fall
- outside the active display region will not be displayed.
-
- If a graphics console device is not associated with the ConsoleOutputHandle
- defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
- If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
- string is printed, and 0 is returned.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
- If gST->ConsoleOutputHandle is NULL, then ASSERT().
-
- @param PointX X coordinate to print the string.
- @param PointY Y coordinate to print the string.
- @param ForeGround The foreground color of the string being printed. This is
- an optional parameter that may be NULL. If it is NULL,
- then the foreground color of the current ConOut device
- in the EFI_SYSTEM_TABLE is used.
- @param BackGround The background color of the string being printed. This is
- an optional parameter that may be NULL. If it is NULL,
- then the background color of the current ConOut device
- in the EFI_SYSTEM_TABLE is used.
- @param Format A null-terminated Unicode format string. See Print Library
- for the supported format string syntax.
- @param ... Variable argument list whose contents are accessed based on
- the format string specified by Format.
-
- @return The number of Unicode characters printed.
-
-**/
-UINTN
-EFIAPI
-PrintXY (
- IN UINTN PointX,
- IN UINTN PointY,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Prints a formatted ASCII string to a graphics console device specified by
- ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
-
- This function prints a formatted ASCII string to the graphics console device
- specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
- ASCII characters displayed, not including partial characters that may be clipped
- by the right edge of the display. If the length of the formatted ASCII string is
- greater than PcdUefiLibMaxPrintBufferSize, then at most the first
- PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
- is used to convert the string to a bitmap using the glyphs registered with the
- HII database. No wrapping is performed, so any portions of the string the fall
- outside the active display region will not be displayed.
-
- If a graphics console device is not associated with the ConsoleOutputHandle
- defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
- If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
- string is printed, and 0 is returned.
- If Format is NULL, then ASSERT().
- If gST->ConsoleOutputHandle is NULL, then ASSERT().
-
- @param PointX X coordinate to print the string.
- @param PointY Y coordinate to print the string.
- @param ForeGround The foreground color of the string being printed. This is
- an optional parameter that may be NULL. If it is NULL,
- then the foreground color of the current ConOut device
- in the EFI_SYSTEM_TABLE is used.
- @param BackGround The background color of the string being printed. This is
- an optional parameter that may be NULL. If it is NULL,
- then the background color of the current ConOut device
- in the EFI_SYSTEM_TABLE is used.
- @param Format A null-terminated ASCII format string. See Print Library
- for the supported format string syntax.
- @param ... The variable argument list whose contents are accessed based on
- the format string specified by Format.
-
- @return The number of ASCII characters printed.
-
-**/
-UINTN
-EFIAPI
-AsciiPrintXY (
- IN UINTN PointX,
- IN UINTN PointY,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL
- IN CONST CHAR8 *Format,
- ...
- );
-
-/**
- Installs and completes the initialization of a Driver Binding Protocol instance.
-
- Installs the Driver Binding Protocol specified by DriverBinding onto the handle
- specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding
- is installed onto a newly created handle. DriverBindingHandle is typically the same
- as the driver's ImageHandle, but it can be different if the driver produces multiple
- Driver Binding Protocols.
- If DriverBinding is NULL, then ASSERT().
- If DriverBinding can not be installed onto a handle, then ASSERT().
-
- @param ImageHandle The image handle of the driver.
- @param SystemTable The EFI System Table that was passed to the driver's entry point.
- @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
- @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
- parameter is NULL, then a new handle is created.
-
- @retval EFI_SUCCESS The protocol installation completed successfully.
- @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.
- @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
-
-**/
-EFI_STATUS
-EFIAPI
-EfiLibInstallDriverBinding (
- IN CONST EFI_HANDLE ImageHandle,
- IN CONST EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle
- );
-
-
-/**
- Installs and completes the initialization of a Driver Binding Protocol instance and
- optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
-
- Initializes a driver by installing the Driver Binding Protocol together with the
- optional Component Name, optional Driver Configure and optional Driver Diagnostic
- Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,
- then the protocols are installed onto a newly created handle. DriverBindingHandle
- is typically the same as the driver's ImageHandle, but it can be different if the
- driver produces multiple Driver Binding Protocols.
- If DriverBinding is NULL, then ASSERT().
- If the installation fails, then ASSERT().
-
- @param ImageHandle The image handle of the driver.
- @param SystemTable The EFI System Table that was passed to the driver's entry point.
- @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
- @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
- parameter is NULL, then a new handle is created.
- @param ComponentName A Component Name Protocol instance that this driver is producing.
- @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
- @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
-
- @retval EFI_SUCCESS The protocol installation completed successfully.
- @retval EFI_OUT_OF_RESOURCES There was not enough memory in the pool to install all the protocols.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiLibInstallAllDriverProtocols (
- IN CONST EFI_HANDLE ImageHandle,
- IN CONST EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
- IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
- IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL
- );
-
-
-
-/**
- Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
-
- Initializes a driver by installing the Driver Binding Protocol together with the
- optional Component Name and optional Component Name 2 protocols onto the driver's
- DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed
- onto a newly created handle. DriverBindingHandle is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols.
- If DriverBinding is NULL, then ASSERT().
- If the installation fails, then ASSERT().
-
- @param ImageHandle The image handle of the driver.
- @param SystemTable The EFI System Table that was passed to the driver's entry point.
- @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
- @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
- parameter is NULL, then a new handle is created.
- @param ComponentName A Component Name Protocol instance that this driver is producing.
- @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
-
- @retval EFI_SUCCESS The protocol installation completed successfully.
- @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiLibInstallDriverBindingComponentName2 (
- IN CONST EFI_HANDLE ImageHandle,
- IN CONST EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
- IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL
- );
-
-
-/**
- Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver
- Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
-
- Initializes a driver by installing the Driver Binding Protocol together with the optional
- Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2,
- optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle.
- DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver
- produces multiple Driver Binding Protocols.
- If DriverBinding is NULL, then ASSERT().
- If the installation fails, then ASSERT().
-
-
- @param ImageHandle The image handle of the driver.
- @param SystemTable The EFI System Table that was passed to the driver's entry point.
- @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
- @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
- parameter is NULL, then a new handle is created.
- @param ComponentName A Component Name Protocol instance that this driver is producing.
- @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
- @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
- @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.
- @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
- @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
-
- @retval EFI_SUCCESS The protocol installation completed successfully.
- @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiLibInstallAllDriverProtocols2 (
- IN CONST EFI_HANDLE ImageHandle,
- IN CONST EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
- IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL
- IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
- IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL
- IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL
- IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL
- );
-
-/**
- Appends a formatted Unicode string to a Null-terminated Unicode string
-
- This function appends a formatted Unicode string to the Null-terminated
- Unicode string specified by String. String is optional and may be NULL.
- Storage for the formatted Unicode string returned is allocated using
- AllocatePool(). The pointer to the appended string is returned. The caller
- is responsible for freeing the returned string.
-
- If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
- If FormatString is NULL, then ASSERT().
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] String A Null-terminated Unicode string.
- @param[in] FormatString A Null-terminated Unicode format string.
- @param[in] Marker VA_LIST marker for the variable argument list.
-
- @retval NULL There was not enough available memory.
- @return Null-terminated Unicode string is that is the formatted
- string appended to String.
-**/
-CHAR16*
-EFIAPI
-CatVSPrint (
- IN CHAR16 *String, OPTIONAL
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Appends a formatted Unicode string to a Null-terminated Unicode string
-
- This function appends a formatted Unicode string to the Null-terminated
- Unicode string specified by String. String is optional and may be NULL.
- Storage for the formatted Unicode string returned is allocated using
- AllocatePool(). The pointer to the appended string is returned. The caller
- is responsible for freeing the returned string.
-
- If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
- If FormatString is NULL, then ASSERT().
- If FormatString is not aligned on a 16-bit boundary, then ASSERT().
-
- @param[in] String A Null-terminated Unicode string.
- @param[in] FormatString A Null-terminated Unicode format string.
- @param[in] ... The variable argument list whose contents are
- accessed based on the format string specified by
- FormatString.
-
- @retval NULL There was not enough available memory.
- @return Null-terminated Unicode string is that is the formatted
- string appended to String.
-**/
-CHAR16 *
-EFIAPI
-CatSPrint (
- IN CHAR16 *String, OPTIONAL
- IN CONST CHAR16 *FormatString,
- ...
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiRuntimeLib.h b/Core/MdePkg/Include/Library/UefiRuntimeLib.h
deleted file mode 100644
index 99ca824fba..0000000000
--- a/Core/MdePkg/Include/Library/UefiRuntimeLib.h
+++ /dev/null
@@ -1,588 +0,0 @@
-/** @file
- Provides library functions for each of the UEFI Runtime Services.
- Only available to DXE and UEFI module types.
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef __UEFI_RUNTIME_LIB__
-#define __UEFI_RUNTIME_LIB__
-
-/**
- This function allows the caller to determine if UEFI ExitBootServices() has been called.
-
- This function returns TRUE after all the EVT_SIGNAL_EXIT_BOOT_SERVICES functions have
- executed as a result of the OS calling ExitBootServices(). Prior to this time FALSE
- is returned. This function is used by runtime code to decide it is legal to access
- services that go away after ExitBootServices().
-
- @retval TRUE The system has finished executing the EVT_SIGNAL_EXIT_BOOT_SERVICES event.
- @retval FALSE The system has not finished executing the EVT_SIGNAL_EXIT_BOOT_SERVICES event.
-
-**/
-BOOLEAN
-EFIAPI
-EfiAtRuntime (
- VOID
- );
-
-/**
- This function allows the caller to determine if UEFI SetVirtualAddressMap() has been called.
-
- This function returns TRUE after all the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE functions have
- executed as a result of the OS calling SetVirtualAddressMap(). Prior to this time FALSE
- is returned. This function is used by runtime code to decide it is legal to access services
- that go away after SetVirtualAddressMap().
-
- @retval TRUE The system has finished executing the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
- @retval FALSE The system has not finished executing the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
-
-**/
-BOOLEAN
-EFIAPI
-EfiGoneVirtual (
- VOID
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service GetTime().
-
- The GetTime() function returns a time that was valid sometime during the call to the function.
- While the returned EFI_TIME structure contains TimeZone and Daylight savings time information,
- the actual clock does not maintain these values. The current time zone and daylight saving time
- information returned by GetTime() are the values that were last set via SetTime().
- The GetTime() function should take approximately the same amount of time to read the time each
- time it is called. All reported device capabilities are to be rounded up.
- During runtime, if a PC-AT CMOS device is present in the platform, the caller must synchronize
- access to the device before calling GetTime().
-
- @param Time A pointer to storage to receive a snapshot of the current time.
- @param Capabilities An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_INVALID_PARAMETER Time is NULL.
- @retval EFI_DEVICE_ERROR The time could not be retrieved due to a hardware error.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service SetTime().
-
- The SetTime() function sets the real time clock device to the supplied time, and records the
- current time zone and daylight savings time information. The SetTime() function is not allowed
- to loop based on the current time. For example, if the device does not support a hardware reset
- for the sub-resolution time, the code is not to implement the feature by waiting for the time to
- wrap.
- During runtime, if a PC-AT CMOS device is present in the platform, the caller must synchronize
- access to the device before calling SetTime().
-
- @param Time A pointer to the current time. Type EFI_TIME is defined in the GetTime()
- function description. Full error checking is performed on the different
- fields of the EFI_TIME structure (refer to the EFI_TIME definition in the
- GetTime() function description for full details), and EFI_INVALID_PARAMETER
- is returned if any field is out of range.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_INVALID_PARAMETER A time field is out of range.
- @retval EFI_DEVICE_ERROR The time could not be set due to a hardware error.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiSetTime (
- IN EFI_TIME *Time
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service GetWakeupTime().
-
- The alarm clock time may be rounded from the set alarm clock time to be within the resolution
- of the alarm clock device. The resolution of the alarm clock device is defined to be one second.
- During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize
- access to the device before calling GetWakeupTime().
-
- @param Enabled Indicates if the alarm is currently enabled or disabled.
- @param Pending Indicates if the alarm signal is pending and requires acknowledgement.
- @param Time The current alarm setting. Type EFI_TIME is defined in the GetTime()
- function description.
-
- @retval EFI_SUCCESS The alarm settings were returned.
- @retval EFI_INVALID_PARAMETER Enabled is NULL.
- @retval EFI_INVALID_PARAMETER Pending is NULL.
- @retval EFI_INVALID_PARAMETER Time is NULL.
- @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
- @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service SetWakeupTime()
-
- Setting a system wakeup alarm causes the system to wake up or power on at the set time.
- When the alarm fires, the alarm signal is latched until it is acknowledged by calling SetWakeupTime()
- to disable the alarm. If the alarm fires before the system is put into a sleeping or off state,
- since the alarm signal is latched the system will immediately wake up. If the alarm fires while
- the system is off and there is insufficient power to power on the system, the system is powered
- on when power is restored.
-
- @param Enable Enable or disable the wakeup alarm.
- @param Time If Enable is TRUE, the time to set the wakeup alarm for. Type EFI_TIME
- is defined in the GetTime() function description. If Enable is FALSE,
- then this parameter is optional, and may be NULL.
-
- @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled.
- If Enable is FALSE, then the wakeup alarm was disabled.
- @retval EFI_INVALID_PARAMETER A time field is out of range.
- @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
- @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time OPTIONAL
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service GetVariable().
-
- Each vendor may create and manage its own variables without the risk of name conflicts by
- using a unique VendorGuid. When a variable is set, its Attributes are supplied to indicate
- how the data variable should be stored and maintained by the system. The attributes affect
- when the variable may be accessed and volatility of the data. Any attempts to access a variable
- that does not have the attribute set for runtime access will yield the EFI_NOT_FOUND error.
- If the Data buffer is too small to hold the contents of the variable, the error EFI_BUFFER_TOO_SMALL
- is returned and DataSize is set to the required buffer size to obtain the data.
-
- @param VariableName the name of the vendor's variable, it's a Null-Terminated Unicode String
- @param VendorGuid Unify identifier for vendor.
- @param Attributes Point to memory location to return the attributes of variable. If the point
- is NULL, the parameter would be ignored.
- @param DataSize As input, point to the maximum size of return Data-Buffer.
- As output, point to the actual size of the returned Data-Buffer.
- @param Data Point to return Data-Buffer.
-
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_FOUND The variable was not found.
- @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. DataSize has
- been updated with the size needed to complete the request.
- @retval EFI_INVALID_PARAMETER VariableName is NULL.
- @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
- @retval EFI_INVALID_PARAMETER DataSize is NULL.
- @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.
- @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
- @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
-**/
-EFI_STATUS
-EFIAPI
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service GetNextVariableName().
-
- GetNextVariableName() is called multiple times to retrieve the VariableName and VendorGuid of
- all variables currently available in the system. On each call to GetNextVariableName() the
- previous results are passed into the interface, and on output the interface returns the next
- variable name data. When the entire variable list has been returned, the error EFI_NOT_FOUND
- is returned.
-
- @param VariableNameSize As input, point to maximum size of variable name.
- As output, point to actual size of variable name.
- @param VariableName As input, supplies the last VariableName that was returned by
- GetNextVariableName().
- As output, returns the name of variable. The name
- string is Null-Terminated Unicode string.
- @param VendorGuid As input, supplies the last VendorGuid that was returned by
- GetNextVriableName().
- As output, returns the VendorGuid of the current variable.
-
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_FOUND The next variable was not found.
- @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
- VariableNameSize has been updated with the size needed
- to complete the request.
- @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.
- @retval EFI_INVALID_PARAMETER VariableName is NULL.
- @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
- @retval EFI_DEVICE_ERROR The variable name could not be retrieved due to a hardware error.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service GetNextVariableName()
-
- Variables are stored by the firmware and may maintain their values across power cycles. Each vendor
- may create and manage its own variables without the risk of name conflicts by using a unique VendorGuid.
-
- @param VariableName the name of the vendor's variable, as a
- Null-Terminated Unicode String
- @param VendorGuid Unify identifier for vendor.
- @param Attributes Point to memory location to return the attributes of variable. If the point
- is NULL, the parameter would be ignored.
- @param DataSize The size in bytes of Data-Buffer.
- @param Data Point to the content of the variable.
-
- @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
- defined by the Attributes.
- @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the
- DataSize exceeds the maximum allowed.
- @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string.
- @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
- @retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
- @retval EFI_WRITE_PROTECTED The variable in question is read-only.
- @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
- @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
- set but the AuthInfo does NOT pass the validation check carried
- out by the firmware.
- @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service GetNextHighMonotonicCount().
-
- The platform's monotonic counter is comprised of two 32-bit quantities: the high 32 bits and
- the low 32 bits. During boot service time the low 32-bit value is volatile: it is reset to zero
- on every system reset and is increased by 1 on every call to GetNextMonotonicCount(). The high
- 32-bit value is nonvolatile and is increased by 1 whenever the system resets or whenever the low
- 32-bit count (returned by GetNextMonoticCount()) overflows.
-
- @param HighCount Pointer to returned value.
-
- @retval EFI_SUCCESS The next high monotonic count was returned.
- @retval EFI_DEVICE_ERROR The device is not functioning properly.
- @retval EFI_INVALID_PARAMETER HighCount is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service ResetSystem().
-
- The ResetSystem()function resets the entire platform, including all processors and devices,and reboots the system.
- Calling this interface with ResetType of EfiResetCold causes a system-wide reset. This sets all circuitry within
- the system to its initial state. This type of reset is asynchronous to system operation and operates without regard
- to cycle boundaries. EfiResetCold is tantamount to a system power cycle.
- Calling this interface with ResetType of EfiResetWarm causes a system-wide initialization. The processors are set to
- their initial state, and pending cycles are not corrupted. If the system does not support this reset type, then an
- EfiResetCold must be performed.
- Calling this interface with ResetType of EfiResetShutdown causes the system to enter a power state equivalent to the
- ACPI G2/S5 or G3 states. If the system does not support this reset type, then when the system is rebooted, it should
- exhibit the EfiResetCold attributes.
- The platform may optionally log the parameters from any non-normal reset that occurs.
- The ResetSystem() function does not return.
-
- @param ResetType The type of reset to perform.
- @param ResetStatus The status code for the reset. If the system reset is part of a normal operation, the status code
- would be EFI_SUCCESS. If the system reset is due to some type of failure the most appropriate EFI
- Status code would be used.
- @param DataSizeThe size, in bytes, of ResetData.
- @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown the data buffer starts with a
- Null-terminated Unicode string, optionally followed by additional binary data. The string is a
- description that the caller may use to further indicate the reason for the system reset. ResetData
- is only valid if ResetStatus is something other then EFI_SUCCESS. This pointer must be a physical
- address. For a ResetType of EfiRestUpdate the data buffer also starts with a Null-terminated string
- that is followed by a physical VOID * to an EFI_CAPSULE_HEADER.
-
-**/
-VOID
-EFIAPI
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN VOID *ResetData OPTIONAL
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service ConvertPointer().
-
- The ConvertPointer() function is used by an EFI component during the SetVirtualAddressMap() operation.
- ConvertPointer()must be called using physical address pointers during the execution of SetVirtualAddressMap().
-
- @param DebugDisposition Supplies type information for the pointer being converted.
- @param Address The pointer to a pointer that is to be fixed to be the
- value needed for the new virtual address mapping being
- applied.
-
- @retval EFI_SUCCESS The pointer pointed to by Address was modified.
- @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part of
- the current memory map. This is normally fatal.
- @retval EFI_INVALID_PARAMETER Address is NULL.
- @retval EFI_INVALID_PARAMETER *Address is NULL and DebugDispositio
-
-**/
-EFI_STATUS
-EFIAPI
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID **Address
- );
-
-/**
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
- For IA32, x64, and EBC, this service is a wrapper for the UEFI Runtime Service
- ConvertPointer(). See the UEFI Specification for details.
- For IPF, this function interprets Address as a pointer to an EFI_PLABEL structure
- and both the EntryPoint and GP fields of an EFI_PLABEL are converted from physical
- to virtiual addressing. Since IPF allows the GP to point to an address outside
- a PE/COFF image, the physical to virtual offset for the EntryPoint field is used
- to adjust the GP field. The UEFI Runtime Service ConvertPointer() is used to convert
- EntryPoint and the status code for this conversion is always returned. If the convertion
- of EntryPoint fails, then neither EntryPoint nor GP are modified. See the UEFI
- Specification for details on the UEFI Runtime Service ConvertPointer().
-
- @param DebugDisposition Supplies type information for the pointer being converted.
- @param Address The pointer to a pointer that is to be fixed to be the
- value needed for the new virtual address mapping being
- applied.
-
- @return EFI_STATUS value from EfiConvertPointer().
-
-**/
-EFI_STATUS
-EFIAPI
-EfiConvertFunctionPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID **Address
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service SetVirtualAddressMap().
-
- The SetVirtualAddressMap() function is used by the OS loader. The function can only be called
- at runtime, and is called by the owner of the system's memory map. I.e., the component which
- called ExitBootServices(). All events of type EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE must be signaled
- before SetVirtualAddressMap() returns.
-
- @param MemoryMapSize The size in bytes of VirtualMap.
- @param DescriptorSize The size in bytes of an entry in the VirtualMap.
- @param DescriptorVersion The version of the structure entries in VirtualMap.
- @param VirtualMap An array of memory descriptors which contain new virtual
- address mapping information for all runtime ranges. Type
- EFI_MEMORY_DESCRIPTOR is defined in the
- GetMemoryMap() function description.
-
- @retval EFI_SUCCESS The virtual address map has been applied.
- @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
- virtual address mapped mode.
- @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
- invalid.
- @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
- map that requires a mapping.
- @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
- in the memory map.
-**/
-EFI_STATUS
-EFIAPI
-EfiSetVirtualAddressMap (
- IN UINTN MemoryMapSize,
- IN UINTN DescriptorSize,
- IN UINT32 DescriptorVersion,
- IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
- );
-
-
-/**
- Convert the standard Lib double linked list to a virtual mapping.
-
- This service uses EfiConvertPointer() to walk a double linked list and convert all the link
- pointers to their virtual mappings. This function is only guaranteed to work during the
- EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event and calling it at other times has undefined results.
-
- @param DebugDisposition Supplies type information for the pointer being converted.
- @param ListHead Head of linked list to convert.
-
- @retval EFI_SUCCESS Successfully executed the function.
- @retval !EFI_SUCCESS Failed to execute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiConvertList (
- IN UINTN DebugDisposition,
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This service is a wrapper for the UEFI Runtime Service UpdateCapsule().
-
- Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
- consumption, the firmware may process the capsule immediately. If the payload should persist across a
- system reset, the reset value returned from EFI_QueryCapsuleCapabilities must be passed into ResetSystem()
- and will cause the capsule to be processed by the firmware as part of the reset process.
-
- @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
- being passed into update capsule. Each capsules is assumed to
- stored in contiguous virtual memory. The capsules in the
- CapsuleHeaderArray must be the same capsules as the
- ScatterGatherList. The CapsuleHeaderArray must
- have the capsules in the same order as the ScatterGatherList.
- @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
- CaspuleHeaderArray.
- @param ScatterGatherList Physical pointer to a set of
- EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
- location in physical memory of a set of capsules. See Related
- Definitions for an explanation of how more than one capsule is
- passed via this interface. The capsules in the
- ScatterGatherList must be in the same order as the
- CapsuleHeaderArray. This parameter is only referenced if
- the capsules are defined to persist across system reset.
-
- @retval EFI_SUCCESS A valid capsule was passed. If CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set,
- the capsule has been successfully processed by the firmware.
- @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
- set in the capsule header.
- @retval EFI_INVALID_PARAMETER CapsuleCount is 0
- @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.
- @retval EFI_UNSUPPORTED The capsule type is not supported on this platform.
- @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the capsule.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiUpdateCapsule (
- IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
- );
-
-
-/**
- This service is a wrapper for the UEFI Runtime Service QueryCapsuleCapabilities().
-
- The QueryCapsuleCapabilities() function allows a caller to test to see if a capsule or
- capsules can be updated via UpdateCapsule(). The Flags values in the capsule header and
- size of the entire capsule is checked.
- If the caller needs to query for generic capsule capability a fake EFI_CAPSULE_HEADER can be
- constructed where CapsuleImageSize is equal to HeaderSize that is equal to sizeof
- (EFI_CAPSULE_HEADER). To determine reset requirements,
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET should be set in the Flags field of the
- EFI_CAPSULE_HEADER.
- The firmware must support any capsule that has the
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set in EFI_CAPSULE_HEADER. The
- firmware sets the policy for what capsules are supported that do not have the
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set.
-
- @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
- being passed into update capsule. The capsules are assumed to
- stored in contiguous virtual memory.
- @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
- CaspuleHeaderArray.
- @param MaximumCapsuleSize On output the maximum size that UpdateCapsule() can
- support as an argument to UpdateCapsule() via
- CapsuleHeaderArray and ScatterGatherList.
- Undefined on input.
- @param ResetType Returns the type of reset required for the capsule update.
-
- @retval EFI_SUCCESS A valid answer was returned.
- @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
- @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and
- MaximumCapsuleSize and ResetType are undefined.
- @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the query request.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiQueryCapsuleCapabilities (
- IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- OUT UINT64 *MaximumCapsuleSize,
- OUT EFI_RESET_TYPE *ResetType
- );
-
-
-/**
- This service is a wrapper for the UEFI Runtime Service QueryVariableInfo().
-
- The QueryVariableInfo() function allows a caller to obtain the information about the
- maximum size of the storage space available for the EFI variables, the remaining size of the storage
- space available for the EFI variables and the maximum size of each individual EFI variable,
- associated with the attributes specified.
- The returned MaximumVariableStorageSize, RemainingVariableStorageSize,
- MaximumVariableSize information may change immediately after the call based on other
- runtime activities including asynchronous error events. Also, these values associated with different
- attributes are not additive in nature.
-
- @param Attributes Attributes bitmask to specify the type of variables on
- which to return information. Refer to the
- GetVariable() function description.
- @param MaximumVariableStorageSize
- On output the maximum size of the storage space
- available for the EFI variables associated with the
- attributes specified.
- @param RemainingVariableStorageSize
- Returns the remaining size of the storage space
- available for the EFI variables associated with the
- attributes specified.
- @param MaximumVariableSize Returns the maximum size of the individual EFI
- variables associated with the attributes specified.
-
- @retval EFI_SUCCESS A valid answer was returned.
- @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied.
- @retval EFI_UNSUPPORTED EFI_UNSUPPORTED The attribute is not supported on this platform, and the
- MaximumVariableStorageSize,
- RemainingVariableStorageSize, MaximumVariableSize
- are undefined.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- );
-
-#endif
-
diff --git a/Core/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h b/Core/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h
deleted file mode 100644
index f667d220e9..0000000000
--- a/Core/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- Provides a service to retrieve a pointer to the EFI Runtime Services Table.
-
- This library does not contain any functions or macros. It simply exports the
- global variable gRT that is a pointer to the EFI Runtime Services Table as defined
- in the UEFI Specification. The global variable gRT must be preinitialized to NULL.
- The library constructor must set gRT to point at the EFI Runtime Services Table so
- it is available at the module's entry point. Since there is overhead in initializing
- this global variable, only those modules that actually require access to the EFI
- Runtime Services Table should use this library.
- Only available to DXE and UEFI module types.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __UEFI_RUNTIME_SERVICES_TABLE_LIB_H__
-#define __UEFI_RUNTIME_SERVICES_TABLE_LIB_H__
-
-///
-/// Cached copy of the EFI Runtime Services Table
-///
-extern EFI_RUNTIME_SERVICES *gRT;
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiScsiLib.h b/Core/MdePkg/Include/Library/UefiScsiLib.h
deleted file mode 100644
index 067acfdb43..0000000000
--- a/Core/MdePkg/Include/Library/UefiScsiLib.h
+++ /dev/null
@@ -1,1181 +0,0 @@
-/** @file
- Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.
-
- This library class provides the functions to submit SCSI commands defined in SCSI-2 specification
- for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms.
- This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard.
-
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SCSI_LIB_H__
-#define __SCSI_LIB_H__
-
-#include <Protocol/ScsiIo.h>
-
-/**
- Execute Test Unit Ready SCSI command on a specific SCSI target.
-
- Executes the Test Unit Ready command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
- for the specific SCSI target.
- @param[in] Timeout The timeout in 100 ns units to use for the execution
- of this SCSI Request Packet. A Timeout value of
- zero means that this function will wait indefinitely
- for the SCSI Request Packet to execute. If Timeout
- is greater than zero, then this function will return
- EFI_TIMEOUT if the time required to execute the SCSI
- Request Packet is greater than Timeout.
- @param[in, out] SenseData A pointer to sense data that was generated by
- the execution of the SCSI Request Packet. This
- buffer must be allocated by the caller.
- If SenseDataLength is 0, then this parameter is
- optional and may be NULL.
- @param[in, out] SenseDataLength On input, a pointer to the length in bytes of
- the SenseData buffer. On output, a pointer to
- the number of bytes written to the SenseData buffer.
- @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces
- the SCSI bus containing the SCSI target specified by
- ScsiIo when the SCSI Request Packet was executed.
- See the EFI SCSI I/O Protocol in the UEFI Specification
- for details on the possible return values.
- @param[out] TargetStatus The status returned by the SCSI target specified
- by ScsiIo when the SCSI Request Packet was executed
- on the SCSI Host Controller. See the EFI SCSI I/O
- Protocol in the UEFI Specification for details on
- the possible return values.
-
- @retval EFI_SUCCESS The command was executed successfully.
- See HostAdapterStatus, TargetStatus, SenseDataLength,
- and SenseData in that order for additional status
- information.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
- there are too many SCSI Command Packets already
- queued. The SCSI Request Packet was not sent, so
- no additional status information is available.
- The caller may retry again later.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
- SCSI Request Packet. See HostAdapterStatus,
- TargetStatus, SenseDataLength, and SenseData in that
- order for additional status information.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
- is not supported by the SCSI initiator(i.e., SCSI
- Host Controller). The SCSI Request Packet was not
- sent, so no additional status information is available.
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
- Packet to execute. See HostAdapterStatus, TargetStatus,
- SenseDataLength, and SenseData in that order for
- additional status information.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiTestUnitReadyCommand (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus
- );
-
-
-/**
- Execute Inquiry SCSI command on a specific SCSI target.
-
- Executes the Inquiry command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If InquiryDataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer
- must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
- for the specific SCSI target.
- @param[in] Timeout The timeout in 100 ns units to use for the
- execution of this SCSI Request Packet. A Timeout
- value of zero means that this function will wait
- indefinitely for the SCSI Request Packet to execute.
- If Timeout is greater than zero, then this function
- will return EFI_TIMEOUT if the time required to
- execute the SCSI Request Packet is greater than Timeout.
- @param[in, out] SenseData A pointer to sense data that was generated
- by the execution of the SCSI Request Packet.
- This buffer must be allocated by the caller.
- If SenseDataLength is 0, then this parameter
- is optional and may be NULL.
- @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
- On output, the number of bytes written to the SenseData buffer.
- @param[out] HostAdapterStatus The status of the SCSI Host Controller that
- produces the SCSI bus containing the SCSI
- target specified by ScsiIo when the SCSI
- Request Packet was executed. See the EFI
- SCSI I/O Protocol in the UEFI Specification
- for details on the possible return values.
- @param[out] TargetStatus The status returned by the SCSI target specified
- by ScsiIo when the SCSI Request Packet was
- executed on the SCSI Host Controller.
- See the EFI SCSI I/O Protocol in the UEFI
- Specification for details on the possible
- return values.
- @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated
- by the execution of the SCSI Request Packet.
- This buffer must be allocated by the caller.
- If InquiryDataLength is 0, then this parameter
- is optional and may be NULL.
- @param[in, out] InquiryDataLength On input, a pointer to the length in bytes
- of the InquiryDataBuffer buffer.
- On output, a pointer to the number of bytes
- written to the InquiryDataBuffer buffer.
- @param[in] EnableVitalProductData If TRUE, then the supported vital product
- data is returned in InquiryDataBuffer.
- If FALSE, then the standard inquiry data is
- returned in InquiryDataBuffer.
-
- @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,
- TargetStatus, SenseDataLength, and SenseData in that order
- for additional status information.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
- InquiryDataBuffer could not be transferred. The actual
- number of bytes transferred is returned in InquiryDataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there
- are too many SCSI Command Packets already queued.
- The SCSI Request Packet was not sent, so no additional
- status information is available. The caller may retry again later.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI
- Request Packet. See HostAdapterStatus, TargetStatus,
- SenseDataLength, and SenseData in that order for additional
- status information.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not
- supported by the SCSI initiator(i.e., SCSI Host Controller).
- The SCSI Request Packet was not sent, so no additional
- status information is available.
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
- Packet to execute. See HostAdapterStatus, TargetStatus,
- SenseDataLength, and SenseData in that order for
- additional status information.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiInquiryCommand (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *InquiryDataBuffer, OPTIONAL
- IN OUT UINT32 *InquiryDataLength,
- IN BOOLEAN EnableVitalProductData
- );
-
-
-/**
- Execute Inquiry SCSI command on a specific SCSI target.
-
- Executes the Inquiry command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If InquiryDataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer
- must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
- for the specific SCSI target.
- @param[in] Timeout The timeout in 100 ns units to use for the
- execution of this SCSI Request Packet. A Timeout
- value of zero means that this function will wait
- indefinitely for the SCSI Request Packet to execute.
- If Timeout is greater than zero, then this function
- will return EFI_TIMEOUT if the time required to
- execute the SCSI Request Packet is greater than Timeout.
- @param[in, out] SenseData A pointer to sense data that was generated
- by the execution of the SCSI Request Packet.
- This buffer must be allocated by the caller.
- If SenseDataLength is 0, then this parameter
- is optional and may be NULL.
- @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
- On output, the number of bytes written to the SenseData buffer.
- @param[out] HostAdapterStatus The status of the SCSI Host Controller that
- produces the SCSI bus containing the SCSI
- target specified by ScsiIo when the SCSI
- Request Packet was executed. See the EFI
- SCSI I/O Protocol in the UEFI Specification
- for details on the possible return values.
- @param[out] TargetStatus The status returned by the SCSI target specified
- by ScsiIo when the SCSI Request Packet was
- executed on the SCSI Host Controller.
- See the EFI SCSI I/O Protocol in the UEFI
- Specification for details on the possible
- return values.
- @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated
- by the execution of the SCSI Request Packet.
- This buffer must be allocated by the caller.
- If InquiryDataLength is 0, then this parameter
- is optional and may be NULL.
- @param[in, out] InquiryDataLength On input, a pointer to the length in bytes
- of the InquiryDataBuffer buffer.
- On output, a pointer to the number of bytes
- written to the InquiryDataBuffer buffer.
- @param[in] EnableVitalProductData If TRUE, then the supported vital product
- data for the PageCode is returned in InquiryDataBuffer.
- If FALSE, then the standard inquiry data is
- returned in InquiryDataBuffer and PageCode is ignored.
- @param[in] PageCode The page code of the vital product data.
- It's ignored if EnableVitalProductData is FALSE.
-
- @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus,
- TargetStatus, SenseDataLength, and SenseData in that order
- for additional status information.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
- InquiryDataBuffer could not be transferred. The actual
- number of bytes transferred is returned in InquiryDataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there
- are too many SCSI Command Packets already queued.
- The SCSI Request Packet was not sent, so no additional
- status information is available. The caller may retry again later.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI
- Request Packet. See HostAdapterStatus, TargetStatus,
- SenseDataLength, and SenseData in that order for additional
- status information.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not
- supported by the SCSI initiator(i.e., SCSI Host Controller).
- The SCSI Request Packet was not sent, so no additional
- status information is available.
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
- Packet to execute. See HostAdapterStatus, TargetStatus,
- SenseDataLength, and SenseData in that order for
- additional status information.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiInquiryCommandEx (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *InquiryDataBuffer, OPTIONAL
- IN OUT UINT32 *InquiryDataLength,
- IN BOOLEAN EnableVitalProductData,
- IN UINT8 PageCode
- );
-
-
-/**
- Execute Mode Sense(10) SCSI command on a specific SCSI target.
-
- Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout
- after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters
- are used to construct the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
- for the specific SCSI target.
- @param[in] Timeout The timeout in 100 ns units to use for the
- execution of this SCSI Request Packet. A Timeout
- value of zero means that this function will wait
- indefinitely for the SCSI Request Packet to execute.
- If Timeout is greater than zero, then this function
- will return EFI_TIMEOUT if the time required to
- execute the SCSI Request Packet is greater than Timeout.
- @param[in, out] SenseData A pointer to sense data that was generated
- by the execution of the SCSI Request Packet.
- This buffer must be allocated by the caller.
- If SenseDataLength is 0, then this parameter
- is optional and may be NULL.
- @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
- On output, the number of bytes written to the SenseData buffer.
- @param[out] HostAdapterStatus The status of the SCSI Host Controller that
- produces the SCSI bus containing the SCSI target
- specified by ScsiIo when the SCSI Request Packet
- was executed. See the EFI SCSI I/O Protocol in the
- UEFI Specification for details on the possible
- return values.
- @param[out] TargetStatus The status returned by the SCSI target specified
- by ScsiIo when the SCSI Request Packet was executed
- on the SCSI Host Controller. See the EFI SCSI
- I/O Protocol in the UEFI Specification for details
- on the possible return values.
- @param[in, out] DataBuffer A pointer to data that was generated by the
- execution of the SCSI Request Packet. This
- buffer must be allocated by the caller. If
- DataLength is 0, then this parameter is optional
- and may be NULL.
- @param[in, out] DataLength On input, a pointer to the length in bytes of
- the DataBuffer buffer. On output, a pointer
- to the number of bytes written to the DataBuffer
- buffer.
- @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.
- @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command.
- @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command.
-
- @retval EFI_SUCCESS The command was executed successfully.
- See HostAdapterStatus, TargetStatus, SenseDataLength,
- and SenseData in that order for additional status information.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the
- entire DataBuffer could not be transferred.
- The actual number of bytes transferred is returned
- in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
- there are too many SCSI Command Packets already queued.
- The SCSI Request Packet was not sent, so no additional
- status information is available. The caller may retry
- again later.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
- SCSI Request Packet. See HostAdapterStatus, TargetStatus,
- SenseDataLength, and SenseData in that order for
- additional status information.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
- is not supported by the SCSI initiator(i.e., SCSI
- Host Controller). The SCSI Request Packet was not
- sent, so no additional status information is available.
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
- Request Packet to execute. See HostAdapterStatus,
- TargetStatus, SenseDataLength, and SenseData in that
- order for additional status information.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiModeSense10Command (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT8 DBDField, OPTIONAL
- IN UINT8 PageControl,
- IN UINT8 PageCode
- );
-
-
-
-/**
- Execute Request Sense SCSI command on a specific SCSI target.
-
- Executes the Request Sense command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are
- too many SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
- the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiRequestSenseCommand (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus
- );
-
-
-/**
- Execute Read Capacity SCSI command on a specific SCSI target.
-
- Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after
- Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer A pointer to a data buffer.
- @param[in, out] DataLength The length of data buffer.
- @param[in] Pmi Partial medium indicator.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
- DataBuffer could not be transferred. The actual
- number of bytes transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
- there are too many SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
- is not supported by the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiReadCapacityCommand (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN BOOLEAN Pmi
- );
-
-
-/**
- Execute Read Capacity SCSI 16 command on a specific SCSI target.
-
- Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after
- Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer A pointer to a data buffer.
- @param[in, out] DataLength The length of data buffer.
- @param[in] Pmi Partial medium indicator.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
- DataBuffer could not be transferred. The actual
- number of bytes transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
- there are too many SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
- is not supported by the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiReadCapacity16Command (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN BOOLEAN Pmi
- );
-
-
-/**
- Execute Read(10) SCSI command on a specific SCSI target.
-
- Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout
- after Timeout 100 ns units. The StartLba and SectorSize parameters are used to
- construct the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer Read 10 command data.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
- not be transferred. The actual number of bytes transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
- SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
- the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiRead10Command (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT32 StartLba,
- IN UINT32 SectorSize
- );
-
-
-/**
- Execute Write(10) SCSI command on a specific SCSI target.
-
- Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after
- Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct
- the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo SCSI IO Protocol to use
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer A pointer to a data buffer.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
- not be transferred. The actual number of bytes transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
- SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
- the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiWrite10Command (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT32 StartLba,
- IN UINT32 SectorSize
- );
-
-/**
- Execute Read(16) SCSI command on a specific SCSI target.
-
- Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout
- after Timeout 100 ns units. The StartLba and SectorSize parameters are used to
- construct the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer Read 16 command data.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
- not be transferred. The actual number of bytes transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
- SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
- the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiRead16Command (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT64 StartLba,
- IN UINT32 SectorSize
- );
-
-
-/**
- Execute Write(16) SCSI command on a specific SCSI target.
-
- Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.
- If Timeout is zero, then this function waits indefinitely for the command to complete.
- If Timeout is greater than zero, then the command is executed and will timeout after
- Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct
- the CDB for this SCSI command.
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
- alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
- gets returned.
-
- @param[in] ScsiIo SCSI IO Protocol to use
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer A pointer to a data buffer.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
- not be transferred. The actual number of bytes transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
- SCSI Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
- the SCSI initiator(i.e., SCSI Host Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiWrite16Command (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT64 StartLba,
- IN UINT32 SectorSize
- );
-
-
-/**
- Execute blocking/non-blocking Read(10) SCSI command on a specific SCSI
- target.
-
- Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.
- When Event is NULL, blocking command will be executed. Otherwise non-blocking
- command will be executed.
- For blocking I/O, if Timeout is zero, this function will wait indefinitely
- for the command to complete. If Timeout is greater than zero, then the
- command is executed and will timeout after Timeout 100 ns units.
- For non-blocking I/O, if Timeout is zero, Event will be signaled only after
- the command to completes. If Timeout is greater than zero, Event will also be
- signaled after Timeout 100 ns units.
- The StartLba and SectorSize parameters are used to construct the CDB for this
- SCSI command.
-
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer Read 16 command data.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks
- of data that shall be transferred.
- @param[in] Event If the SCSI target does not support
- non-blocking I/O, then Event is ignored,
- and blocking I/O is performed. If Event
- is NULL, then blocking I/O is performed.
- If Event is not NULL and non-blocking
- I/O is supported, then non-blocking I/O
- is performed, and Event will be signaled
- when the SCSI Read(10) command
- completes.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
- but the entire DataBuffer could not be
- transferred. The actual number of bytes
- transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be
- sent because there are too many SCSI
- Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting
- to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI
- Request Packet is not supported by the
- SCSI initiator(i.e., SCSI Host
- Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the
- SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
- are invalid.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due
- to a lack of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiRead10CommandEx (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT32 StartLba,
- IN UINT32 SectorSize,
- IN EFI_EVENT Event OPTIONAL
- );
-
-
-/**
- Execute blocking/non-blocking Write(10) SCSI command on a specific SCSI
- target.
-
- Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.
- When Event is NULL, blocking command will be executed. Otherwise non-blocking
- command will be executed.
- For blocking I/O, if Timeout is zero, this function will wait indefinitely
- for the command to complete. If Timeout is greater than zero, then the
- command is executed and will timeout after Timeout 100 ns units.
- For non-blocking I/O, if Timeout is zero, Event will be signaled only after
- the command to completes. If Timeout is greater than zero, Event will also be
- signaled after Timeout 100 ns units.
- The StartLba and SectorSize parameters are used to construct the CDB for this
- SCSI command.
-
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- @param[in] ScsiIo SCSI IO Protocol to use
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer A pointer to a data buffer.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks
- of data that shall be transferred.
- @param[in] Event If the SCSI target does not support
- non-blocking I/O, then Event is ignored,
- and blocking I/O is performed. If Event
- is NULL, then blocking I/O is performed.
- If Event is not NULL and non-blocking
- I/O is supported, then non-blocking I/O
- is performed, and Event will be signaled
- when the SCSI Write(10) command
- completes.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
- but the entire DataBuffer could not be
- transferred. The actual number of bytes
- transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be
- sent because there are too many SCSI
- Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting
- to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI
- Request Packet is not supported by the
- SCSI initiator(i.e., SCSI Host
- Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the
- SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
- are invalid.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due
- to a lack of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiWrite10CommandEx (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT32 StartLba,
- IN UINT32 SectorSize,
- IN EFI_EVENT Event OPTIONAL
- );
-
-
-/**
- Execute blocking/non-blocking Read(16) SCSI command on a specific SCSI
- target.
-
- Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.
- When Event is NULL, blocking command will be executed. Otherwise non-blocking
- command will be executed.
- For blocking I/O, if Timeout is zero, this function will wait indefinitely
- for the command to complete. If Timeout is greater than zero, then the
- command is executed and will timeout after Timeout 100 ns units.
- For non-blocking I/O, if Timeout is zero, Event will be signaled only after
- the command to completes. If Timeout is greater than zero, Event will also be
- signaled after Timeout 100 ns units.
- The StartLba and SectorSize parameters are used to construct the CDB for this
- SCSI command.
-
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- @param[in] ScsiIo A pointer to SCSI IO protocol.
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer Read 16 command data.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks
- of data that shall be transferred.
- @param[in] Event If the SCSI target does not support
- non-blocking I/O, then Event is ignored,
- and blocking I/O is performed. If Event
- is NULL, then blocking I/O is performed.
- If Event is not NULL and non-blocking
- I/O is supported, then non-blocking I/O
- is performed, and Event will be signaled
- when the SCSI Read(16) command
- completes.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
- but the entire DataBuffer could not be
- transferred. The actual number of bytes
- transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be
- sent because there are too many SCSI
- Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting
- to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI
- Request Packet is not supported by the
- SCSI initiator(i.e., SCSI Host
- Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the
- SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
- are invalid.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due
- to a lack of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiRead16CommandEx (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT64 StartLba,
- IN UINT32 SectorSize,
- IN EFI_EVENT Event OPTIONAL
- );
-
-
-/**
- Execute blocking/non-blocking Write(16) SCSI command on a specific SCSI
- target.
-
- Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.
- When Event is NULL, blocking command will be executed. Otherwise non-blocking
- command will be executed.
- For blocking I/O, if Timeout is zero, this function will wait indefinitely
- for the command to complete. If Timeout is greater than zero, then the
- command is executed and will timeout after Timeout 100 ns units.
- For non-blocking I/O, if Timeout is zero, Event will be signaled only after
- the command to completes. If Timeout is greater than zero, Event will also be
- signaled after Timeout 100 ns units.
- The StartLba and SectorSize parameters are used to construct the CDB for this
- SCSI command.
-
- If ScsiIo is NULL, then ASSERT().
- If SenseDataLength is NULL, then ASSERT().
- If HostAdapterStatus is NULL, then ASSERT().
- If TargetStatus is NULL, then ASSERT().
- If DataLength is NULL, then ASSERT().
-
- If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
- buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
- EFI_INVALID_PARAMETER gets returned.
-
- @param[in] ScsiIo SCSI IO Protocol to use
- @param[in] Timeout The length of timeout period.
- @param[in, out] SenseData A pointer to output sense data.
- @param[in, out] SenseDataLength The length of output sense data.
- @param[out] HostAdapterStatus The status of Host Adapter.
- @param[out] TargetStatus The status of the target.
- @param[in, out] DataBuffer A pointer to a data buffer.
- @param[in, out] DataLength The length of data buffer.
- @param[in] StartLba The start address of LBA.
- @param[in] SectorSize The number of contiguous logical blocks
- of data that shall be transferred.
- @param[in] Event If the SCSI target does not support
- non-blocking I/O, then Event is ignored,
- and blocking I/O is performed. If Event
- is NULL, then blocking I/O is performed.
- If Event is not NULL and non-blocking
- I/O is supported, then non-blocking I/O
- is performed, and Event will be signaled
- when the SCSI Write(16) command
- completes.
-
- @retval EFI_SUCCESS Command is executed successfully.
- @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
- but the entire DataBuffer could not be
- transferred. The actual number of bytes
- transferred is returned in DataLength.
- @retval EFI_NOT_READY The SCSI Request Packet could not be
- sent because there are too many SCSI
- Command Packets already queued.
- @retval EFI_DEVICE_ERROR A device error occurred while attempting
- to send SCSI Request Packet.
- @retval EFI_UNSUPPORTED The command described by the SCSI
- Request Packet is not supported by the
- SCSI initiator(i.e., SCSI Host
- Controller)
- @retval EFI_TIMEOUT A timeout occurred while waiting for the
- SCSI Request Packet to execute.
- @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
- are invalid.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due
- to a lack of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ScsiWrite16CommandEx (
- IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
- IN UINT64 Timeout,
- IN OUT VOID *SenseData, OPTIONAL
- IN OUT UINT8 *SenseDataLength,
- OUT UINT8 *HostAdapterStatus,
- OUT UINT8 *TargetStatus,
- IN OUT VOID *DataBuffer, OPTIONAL
- IN OUT UINT32 *DataLength,
- IN UINT64 StartLba,
- IN UINT32 SectorSize,
- IN EFI_EVENT Event OPTIONAL
- );
-
-#endif
diff --git a/Core/MdePkg/Include/Library/UefiUsbLib.h b/Core/MdePkg/Include/Library/UefiUsbLib.h
deleted file mode 100644
index 6f625a0448..0000000000
--- a/Core/MdePkg/Include/Library/UefiUsbLib.h
+++ /dev/null
@@ -1,563 +0,0 @@
-/** @file
- Provides most USB APIs to support the Hid requests defined in USB Hid 1.1 spec
- and the standard requests defined in USB 1.1 spec.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#ifndef __USB_DXE_LIB_H__
-#define __USB_DXE_LIB_H__
-
-#include <Protocol/UsbIo.h>
-
-/**
- Get the descriptor of the specified USB HID interface.
-
- Submit a UsbGetHidDescriptor() request for the USB device specified by UsbIo
- and Interface, and return the HID descriptor in HidDescriptor.
- If UsbIo is NULL, then ASSERT().
- If HidDescriptor is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the HID interface on the USB target.
- @param HidDescriptor Pointer to the USB HID descriptor that was retrieved from
- the specified USB target and interface. Type EFI_USB_HID_DESCRIPTOR
- is defined in the MDE Package Industry Standard include file Usb.h.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetHidDescriptor (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor
- );
-
-
-/**
- Get the report descriptor of the specified USB HID interface.
-
- Submit a USB get HID report descriptor request for the USB device specified by
- UsbIo and Interface, and return the report descriptor in DescriptorBuffer.
- If UsbIo is NULL, then ASSERT().
- If DescriptorBuffer is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param DescriptorLength The size, in bytes, of DescriptorBuffer.
- @param DescriptorBuffer A pointer to the buffer to store the report class descriptor.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed because the
- buffer specified by DescriptorLength and DescriptorBuffer
- is not large enough to hold the result of the request.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetReportDescriptor (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- IN UINT16 DescriptorLength,
- OUT UINT8 *DescriptorBuffer
- );
-
-/**
- Get the HID protocol of the specified USB HID interface.
-
- Submit a USB get HID protocol request for the USB device specified by UsbIo
- and Interface, and return the protocol retrieved in Protocol.
- If UsbIo is NULL, then ASSERT().
- If Protocol is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param Protocol A pointer to the protocol for the specified USB target.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetProtocolRequest (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- OUT UINT8 *Protocol
- );
-
-/**
- Set the HID protocol of the specified USB HID interface.
-
- Submit a USB set HID protocol request for the USB device specified by UsbIo
- and Interface, and set the protocol to the value specified by Protocol.
- If UsbIo is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param Protocol The protocol value to set for the specified USB target.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetProtocolRequest (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- IN UINT8 Protocol
- );
-
-/**
- Set the idle rate of the specified USB HID report.
-
- Submit a USB set HID report idle request for the USB device specified by UsbIo,
- Interface, and ReportId, and set the idle rate to the value specified by Duration.
- If UsbIo is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param ReportId The identifier of the report to retrieve.
- @param Duration The idle rate to set for the specified USB target.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetIdleRequest (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- IN UINT8 ReportId,
- IN UINT8 Duration
- );
-
-/**
- Get the idle rate of the specified USB HID report.
-
- Submit a USB get HID report idle request for the USB device specified by UsbIo,
- Interface, and ReportId, and return the ide rate in Duration.
- If UsbIo is NULL, then ASSERT().
- If Duration is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param ReportId The identifier of the report to retrieve.
- @param Duration A pointer to the idle rate retrieved from the specified USB target.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetIdleRequest (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- IN UINT8 ReportId,
- OUT UINT8 *Duration
- );
-
-/**
- Set the report descriptor of the specified USB HID interface.
-
- Submit a USB set HID report request for the USB device specified by UsbIo,
- Interface, ReportId, and ReportType, and set the report descriptor using the
- buffer specified by ReportLength and Report.
- If UsbIo is NULL, then ASSERT().
- If Report is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param ReportId The identifier of the report to retrieve.
- @param ReportType The type of report to retrieve.
- @param ReportLength The size, in bytes, of Report.
- @param Report A pointer to the report descriptor buffer to set.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetReportRequest (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- IN UINT8 ReportId,
- IN UINT8 ReportType,
- IN UINT16 ReportLen,
- IN UINT8 *Report
- );
-
-/**
- Get the report descriptor of the specified USB HID interface.
-
- Submit a USB get HID report request for the USB device specified by UsbIo,
- Interface, ReportId, and ReportType, and return the report in the buffer
- specified by Report.
- If UsbIo is NULL, then ASSERT().
- If Report is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The index of the report interface on the USB target.
- @param ReportId The identifier of the report to retrieve.
- @param ReportType The type of report to retrieve.
- @param ReportLength The size, in bytes, of Report.
- @param Report A pointer to the buffer to store the report descriptor.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed because the
- buffer specified by ReportLength and Report is not
- large enough to hold the result of the request.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetReportRequest (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Interface,
- IN UINT8 ReportId,
- IN UINT8 ReportType,
- IN UINT16 ReportLen,
- OUT UINT8 *Report
- );
-
-/**
- Get the descriptor of the specified USB device.
-
- Submit a USB get descriptor request for the USB device specified by UsbIo, Value,
- and Index, and return the descriptor in the buffer specified by Descriptor.
- The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Descriptor is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Value The device request value.
- @param Index The device request index.
- @param DescriptorLength The size, in bytes, of Descriptor.
- @param Descriptor A pointer to the descriptor buffer to get.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed because the
- buffer specified by DescriptorLength and Descriptor
- is not large enough to hold the result of the request.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error. The transfer
- status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetDescriptor (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT16 Value,
- IN UINT16 Index,
- IN UINT16 DescriptorLength,
- OUT VOID *Descriptor,
- OUT UINT32 *Status
- );
-
-/**
- Set the descriptor of the specified USB device.
-
- Submit a USB set descriptor request for the USB device specified by UsbIo,
- Value, and Index, and set the descriptor using the buffer specified by DesriptorLength
- and Descriptor. The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Descriptor is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Value The device request value.
- @param Index The device request index.
- @param DescriptorLength The size, in bytes, of Descriptor.
- @param Descriptor A pointer to the descriptor buffer to set.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetDescriptor (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT16 Value,
- IN UINT16 Index,
- IN UINT16 DescriptorLength,
- IN VOID *Descriptor,
- OUT UINT32 *Status
- );
-
-/**
- Get the interface setting of the specified USB device.
-
- Submit a USB get interface request for the USB device specified by UsbIo,
- and Interface, and place the result in the buffer specified by AlternateSetting.
- The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If AlternateSetting is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The interface index value.
- @param AlternateSetting A pointer to the alternate setting to be retrieved.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetInterface (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT16 Interface,
- OUT UINT16 *AlternateSetting,
- OUT UINT32 *Status
- );
-
-/**
- Set the interface setting of the specified USB device.
-
- Submit a USB set interface request for the USB device specified by UsbIo, and
- Interface, and set the alternate setting to the value specified by AlternateSetting.
- The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Interface The interface index value.
- @param AlternateSetting The alternate setting to be set.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_SUCCESS The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetInterface (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT16 Interface,
- IN UINT16 AlternateSetting,
- OUT UINT32 *Status
- );
-
-/**
- Get the device configuration.
-
- Submit a USB get configuration request for the USB device specified by UsbIo
- and place the result in the buffer specified by ConfigurationValue. The status
- of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If ConfigurationValue is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param ConfigurationValue A pointer to the device configuration to be retrieved.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetConfiguration (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- OUT UINT16 *ConfigurationValue,
- OUT UINT32 *Status
- );
-
-/**
- Set the device configuration.
-
- Submit a USB set configuration request for the USB device specified by UsbIo
- and set the device configuration to the value specified by ConfigurationValue.
- The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param ConfigurationValue The device configuration value to be set.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetConfiguration (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT16 ConfigurationValue,
- OUT UINT32 *Status
- );
-
-/**
- Set the specified feature of the specified device.
-
- Submit a USB set device feature request for the USB device specified by UsbIo,
- Recipient, and Target to the value specified by Value. The status of the
- transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).
- Type USB_TYPES_DEFINITION is defined in the MDE Package Industry
- Standard include file Usb.h.
- @param Value The value of the feature to be set.
- @param Target The index of the device to be set.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbSetFeature (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN USB_TYPES_DEFINITION Recipient,
- IN UINT16 Value,
- IN UINT16 Target,
- OUT UINT32 *Status
- );
-
-/**
- Clear the specified feature of the specified device.
-
- Submit a USB clear device feature request for the USB device specified by UsbIo,
- Recipient, and Target to the value specified by Value. The status of the transfer
- is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).
- Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard
- include file Usb.h.
- @param Value The value of the feature to be cleared.
- @param Target The index of the device to be cleared.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbClearFeature (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN USB_TYPES_DEFINITION Recipient,
- IN UINT16 Value,
- IN UINT16 Target,
- OUT UINT32 *Status
- );
-
-/**
- Get the status of the specified device.
-
- Submit a USB device get status request for the USB device specified by UsbIo,
- Recipient, and Target, and place the result in the buffer specified by DeviceStatus.
- The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If DeviceStatus is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).
- Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard
- include file Usb.h.
- @param Target The index of the device to be get the status of.
- @param DeviceStatus A pointer to the device status to be retrieved.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
-
-**/
-EFI_STATUS
-EFIAPI
-UsbGetStatus (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN USB_TYPES_DEFINITION Recipient,
- IN UINT16 Target,
- OUT UINT16 *DeviceStatus,
- OUT UINT32 *Status
- );
-
-/**
- Clear halt feature of the specified usb endpoint.
-
- Retrieve the USB endpoint descriptor specified by UsbIo and EndPoint.
- If the USB endpoint descriptor can not be retrieved, then return EFI_NOT_FOUND.
- If the endpoint descriptor is found, then clear the halt feature of this USB endpoint.
- The status of the transfer is returned in Status.
- If UsbIo is NULL, then ASSERT().
- If Status is NULL, then ASSERT().
-
- @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.
- @param Endpoint The endpoint address.
- @param Status A pointer to the status of the transfer.
-
- @retval EFI_SUCCESS The request executed successfully.
- @retval EFI_TIMEOUT A timeout occurred executing the request.
- @retval EFI_DEVICE_ERROR The request failed due to a device error.
- The transfer status is returned in Status.
- @retval EFI_NOT_FOUND The specified USB endpoint descriptor can not be found
-
-**/
-EFI_STATUS
-EFIAPI
-UsbClearEndpointHalt (
- IN EFI_USB_IO_PROTOCOL *UsbIo,
- IN UINT8 Endpoint,
- OUT UINT32 *Status
- );
-
-#endif