summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h9
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h10
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h5
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h58
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h33
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h21
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h3
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h2015
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h114
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h1
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h5
14 files changed, 1878 insertions, 433 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h
index 3c3076954d..376d7f38ac 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation
+Copyright (c) 2004 - 2007, Intel Corporation
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
@@ -23,7 +23,11 @@ Abstract:
#ifndef __EDKII_GLUE_DEFINITION_CHANGES_BASE_H__
#define __EDKII_GLUE_DEFINITION_CHANGES_BASE_H__
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+#include "TianoHii.h"
+#else
#include "EfiInternalFormRepresentation.h"
+#endif
#include "EfiPxe.h"
@@ -47,7 +51,7 @@ Abstract:
// ----------------------------------------------------------------------------------
// InternalFormRepresentation.h:
// ----------------------------------------------------------------------------------
-
+#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
@@ -66,6 +70,7 @@ typedef struct {
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_END_EXPR;
+#endif
// ------------------------
// define GUID as EFI_GUID
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h
index 0f2cadd3fc..4bcbf9ca62 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation
+Copyright (c) 2004 - 2007, Intel Corporation
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
@@ -23,7 +23,11 @@ Abstract:
#ifndef __EDKII_GLUE_DEFINITION_CHANGES_DXE_H__
#define __EDKII_GLUE_DEFINITION_CHANGES_DXE_H__
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+#include "TianoHii.h"
+#else
#include "EfiInternalFormRepresentation.h"
+#endif
#include "EdkIIGlueDefinitionChangesBase.h"
@@ -59,8 +63,10 @@ typedef EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION EFI_MISC_SMBIOS_STRUCT_ENCA
// -------------------
#define gEfiAcpiSupportProtocolGuid gEfiAcpiSupportGuid
#define gEfiLoadPeImageProtocolGuid gEfiLoadPeImageGuid
+#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
#define EFI_GLYPH_NON_SPACING GLYPH_NON_SPACING
#define EFI_GLYPH_WIDE GLYPH_NON_BREAKING
+#endif
#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE
#define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID
#define EFI_FILE_SYSTEM_VOLUME_LABEL_ID EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID
@@ -78,7 +84,9 @@ typedef EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION EFI_MISC_SMBIOS_STRUCT_ENCA
//
typedef EFI_VOLUME_OPEN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME;
typedef EFI_TEXT_OUTPUT_STRING EFI_TEXT_STRING;
+#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
typedef SCREEN_DESCRIPTOR EFI_SCREEN_DESCRIPTOR;
+#endif
typedef EFI_SIMPLE_TEXT_IN_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
typedef EFI_SIMPLE_TEXT_OUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
//typedef EFI_TO_LEGACY16_INIT_TABLE EFI_TO_COMPATIBILITY16_INIT_TABLE;
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h
index 353fe36709..635b0dc51a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h
@@ -23,9 +23,14 @@ Abstract:
#ifndef __EDKII_GLUE_DEFINITION_CHANGES_PEIM_H__
#define __EDKII_GLUE_DEFINITION_CHANGES_PEIM_H__
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+#include "TianoHii.h"
+#else
#include "EfiInternalFormRepresentation.h"
+#endif
#include "EdkIIGlueDefinitionChangesBase.h"
+
#include "EfiPciCfg.h"
//
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
index 1f59b3552b..c28debd6f1 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
@@ -62,6 +62,45 @@ Abstract:
#endif
//
+// DxePerformanceLib
+//
+#ifdef __EDKII_GLUE_DXE_PERFORMANCE_LIB__
+ #ifndef __EDKII_GLUE_BASE_LIB__
+ #define __EDKII_GLUE_BASE_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
+ #define __EDKII_GLUE_BASE_MEMORY_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
+ #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_DXE_HOB_LIB__
+ #define __EDKII_GLUE_DXE_HOB_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
+ #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_UEFI_LIB__
+ #define __EDKII_GLUE_UEFI_LIB__
+ #endif
+#endif
+
+//
+// PeiPerformanceLib
+//
+#ifdef __EDKII_GLUE_PEI_PERFORMANCE_LIB__
+ #ifndef __EDKII_GLUE_BASE_LIB__
+ #define __EDKII_GLUE_BASE_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
+ #define __EDKII_GLUE_BASE_MEMORY_LIB__
+ #endif
+ #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
+ #define __EDKII_GLUE_PEI_SERVICES_LIB__
+ #endif
+#endif
+
+//
// EdkDxeRuntimeDriverLib
//
#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
@@ -554,6 +593,14 @@ Abstract:
//
#endif
+//
+// Whether _gDriverExitBootServicesEvent[] contains effective handler
+//
+#if defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) || defined(__EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__)
+ #define __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ 1
+#else
+ #define __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ 0
+#endif
//
// Check against multiple instances of same library class being used
@@ -654,6 +701,7 @@ Abstract:
#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
EFI_STATUS
+EFIAPI
UefiBootServicesTableLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -671,6 +719,7 @@ IoLibConstructor (
#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
EFI_STATUS
+EFIAPI
UefiRuntimeServicesTableLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -679,6 +728,7 @@ UefiRuntimeServicesTableLibConstructor (
#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
EFI_STATUS
+EFIAPI
RuntimeDriverLibConstruct (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -687,6 +737,7 @@ RuntimeDriverLibConstruct (
#ifdef __EDKII_GLUE_DXE_HOB_LIB__
EFI_STATUS
+EFIAPI
HobLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -695,6 +746,7 @@ HobLibConstructor (
#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
EFI_STATUS
+EFIAPI
UefiDriverModelLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -703,6 +755,7 @@ UefiDriverModelLibConstructor (
#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
EFI_STATUS
+EFIAPI
PeiServicesTablePointerLibConstructor (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
@@ -711,6 +764,7 @@ PeiServicesTablePointerLibConstructor (
#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
EFI_STATUS
+EFIAPI
PeiServicesTablePointerLibConstructor (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
@@ -719,6 +773,7 @@ PeiServicesTablePointerLibConstructor (
#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
EFI_STATUS
+EFIAPI
PeiServicesTablePointerLibConstructor (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
@@ -736,6 +791,7 @@ SmbusLibConstructor (
#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
EFI_STATUS
+EFIAPI
DxeServicesTableLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -760,6 +816,7 @@ DxeSalLibConstructor (
//
#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
EFI_STATUS
+EFIAPI
UefiDriverModelLibDestructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -768,6 +825,7 @@ UefiDriverModelLibDestructor (
#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
EFI_STATUS
+EFIAPI
RuntimeDriverLibDeconstruct (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h
index 605c84547e..b62edef674 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h
@@ -30,6 +30,10 @@ Abstract:
#define BUILD_WITH_EDKII_GLUE_LIB
#endif
+#ifndef BUILD_WITH_GLUELIB
+ #define BUILD_WITH_GLUELIB
+#endif
+
//
// General Type & API definitions
//
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
index 6bbcfee1bc..8a1d018a97 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
@@ -31,10 +31,12 @@ Abstract:
// 0x3000 - the 3rd release
// 0x5000 - support IPF. Jan, 2007
// 0x6000 - support EBC. Feb, 2007
+// 0x7000 - size reduction, Jun, 2007
+// 0x7100 - backward compatibility supported, Jun, 2007
//
// For reference only, don't change the value
//
-#define EDKII_GLUE_LIBRARY_VERSION 0x6000
+#define EDKII_GLUE_LIBRARY_VERSION 0x7100
//
@@ -84,21 +86,19 @@ Abstract:
//
// debug print level
-// only when EFI_DEBUG is defined, the mask is effective
//
#define EDKII_GLUE_DebugPrintErrorLevel EFI_D_ERROR
//
// debug propery mask
-// only when EFI_DEBUG is defined, the mask is effective
-//
-#define EDKII_GLUE_DebugPropertyMask ( DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED \
- | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED \
- | DEBUG_PROPERTY_DEBUG_CODE_ENABLED \
- | DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED \
- | DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED \
- | DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED \
- )
+//
+#define EDKII_GLUE_DebugPropertyMask ( DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED \
+ | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED \
+ | DEBUG_PROPERTY_DEBUG_CODE_ENABLED \
+ | DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED \
+ | DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED \
+ | DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED \
+ )
//
// clear memory value
@@ -115,23 +115,22 @@ Abstract:
// This value is FSB Clock frequency. Its unit is Hz and its
// default value is 200000000, that means FSB frequency is 200Mhz.
//
-#define EDKII_GLUE_FSBClock 200000000
+#define EDKII_GLUE_FSBClock 200000000
//
// post code property mask
//
#define EDKII_GLUE_PostCodePropertyMask ( POST_CODE_PROPERTY_POST_CODE_ENABLED \
- | POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED \
+ | POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED \
)
//
// status code property mask
//
#define EDKII_GLUE_ReportStatusCodePropertyMask ( REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED \
- | REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED \
- | REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED \
- )
-
+ | REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED \
+ | REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED \
+ )
//
// for IPF only
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h
index 8aa355e127..c1d5102257 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h
@@ -39,8 +39,13 @@ Abstract:
#include "EfiFirmwareVolumeHeader.h"
#include "EfiFirmwareFileSystem.h"
#include "PeiHob.h"
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+#include "TianoHii.h"
+#else
#include "EfiInternalFormRepresentation.h"
+#endif
#include "EfiStatusCode.h"
+#include "EfiPerf.h"
//
// IPF only
@@ -90,10 +95,20 @@ Abstract:
// resolved when porting a module to real EDK II
//
#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
+#include EFI_GUID_DEFINITION (PeiPerformanceHob)
//
// Protocol definitions
//
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+#include EFI_PROTOCOL_DEFINITION (FormBrowser2)
+#include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)
+#include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)
+#include EFI_PROTOCOL_DEFINITION (HiiDatabase)
+#include EFI_PROTOCOL_DEFINITION (HiiFont)
+#include EFI_PROTOCOL_DEFINITION (HiiImage)
+#include EFI_PROTOCOL_DEFINITION (HiiString)
+#endif
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
#include EFI_PROTOCOL_DEFINITION (DevicePathFromText)
@@ -120,7 +135,9 @@ Abstract:
#include EFI_PROTOCOL_DEFINITION (BootScriptSave)
#include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride)
#include EFI_PROTOCOL_DEFINITION (ComponentName)
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
#include EFI_PROTOCOL_DEFINITION (ComponentName2)
+#endif
#include EFI_PROTOCOL_DEFINITION (CpuIo)
#include EFI_PROTOCOL_DEFINITION (DataHub)
#include EFI_PROTOCOL_DEFINITION (DebugPort)
@@ -140,10 +157,14 @@ Abstract:
#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeDispatch)
+#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
#include EFI_PROTOCOL_DEFINITION (FormBrowser)
#include EFI_PROTOCOL_DEFINITION (FormCallback)
+#endif
#include EFI_PROTOCOL_DEFINITION (GuidedSectionExtraction)
+#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
#include EFI_PROTOCOL_DEFINITION (Hii)
+#endif
#include EFI_PROTOCOL_DEFINITION (IdeControllerInit)
#include EFI_PROTOCOL_DEFINITION (IncompatiblePciDeviceSupport)
#include EFI_PROTOCOL_DEFINITION (Legacy8259)
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h
index 617364ffba..f2cda3365f 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h
@@ -45,6 +45,7 @@ Abstract:
#include "EfiCapsule.h"
#include EFI_PROTOCOL_DEFINITION (DevicePath)
#include "TianoDevicePath.h"
+#include "PeiPerf.h"
//
// GUID definitions
@@ -58,6 +59,8 @@ Abstract:
#include EFI_GUID_DEFINITION (FirmwareFileSystem)
#include EFI_GUID_DEFINITION (SmramMemoryReserve)
#include EFI_GUID_DEFINITION (DataHubRecords)
+#include EFI_GUID_DEFINITION (PeiPerformanceHob)
+
//
// *** NOTE ***: StatusCodeDataTypeId definition differences need to be
// resolved when porting a module to real EDK II
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
index e71020e296..dbeeafd48f 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
@@ -73,7 +73,9 @@ Abstract:
#include EFI_PROTOCOL_DEFINITION(Bis)
#include EFI_PROTOCOL_DEFINITION(BusSpecificDriverOverride)
#include EFI_PROTOCOL_DEFINITION(ComponentName)
-#include EFI_PROTOCOL_DEFINITION(ComponentName2)
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+#include EFI_PROTOCOL_DEFINITION (ComponentName2)
+#endif
#include EFI_PROTOCOL_DEFINITION(DebugPort)
#include EFI_PROTOCOL_DEFINITION(DebugSupport)
#include EFI_PROTOCOL_DEFINITION(Decompress)
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h
index 8c6ef88b4f..a37be76663 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h
@@ -37,5 +37,32 @@ Abstract:
#ifndef MDE_CPU_IPF
#define MDE_CPU_IPF
#endif
-
+
+//
+// IPF Specific Functions
+//
+typedef struct {
+ UINT64 Status;
+ UINT64 r9;
+ UINT64 r10;
+ UINT64 r11;
+} PAL_CALL_RETURN;
+
+
+#define EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_LO 0x4871260ec1a74056
+#define EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_HI 0x116e5ba645e631a0
+
+#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO 0x4d02efdb7e97a470
+#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI 0x96a27bd29061ce8f
+
+#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_LO 0x4370c6414ecb6c53
+#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_HI 0x78836e490e3bb28c
+
+#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_LO 0x408b75e8899afd18
+#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_HI 0x54f4cd7e2e6e1aa4
+
+#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_LO 0x46f58ce17d019990
+#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_HI 0xa06a6798513c76a7
+
+
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h
index 4c95c85ce1..59cd672740 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h
@@ -72,7 +72,7 @@ Abstract:
//
// SPIN_LOCK
//
-typedef UINTN SPIN_LOCK;
+typedef volatile UINTN SPIN_LOCK;
#if defined (MDE_CPU_IA32)
//
@@ -206,6 +206,8 @@ GlueStrCpy (
OUT CHAR16 *Destination,
IN CONST CHAR16 *Source
);
+
+
/**
Copies one Null-terminated Unicode string with a maximum length to another
Null-terminated Unicode string with a maximum length and returns the new
@@ -242,6 +244,8 @@ GlueStrnCpy (
IN CONST CHAR16 *Source,
IN UINTN Length
);
+
+
/**
Returns the length of a Null-terminated Unicode string.
@@ -264,6 +268,8 @@ EFIAPI
GlueStrLen (
IN CONST CHAR16 *String
);
+
+
/**
Returns the size of a Null-terminated Unicode string in bytes, including the
Null terminator.
@@ -287,6 +293,8 @@ EFIAPI
GlueStrSize (
IN CONST CHAR16 *String
);
+
+
/**
Compares two Null-terminated Unicode strings, and returns the difference
between the first mismatched Unicode characters.
@@ -321,6 +329,8 @@ GlueStrCmp (
IN CONST CHAR16 *FirstString,
IN CONST CHAR16 *SecondString
);
+
+
/**
Compares two Null-terminated Unicode strings with maximum lengths, and
returns the difference between the first mismatched Unicode characters.
@@ -358,6 +368,8 @@ GlueStrnCmp (
IN CONST CHAR16 *SecondString,
IN UINTN Length
);
+
+
/**
Concatenates one Null-terminated Unicode string to another Null-terminated
Unicode string, and returns the concatenated Unicode string.
@@ -396,6 +408,8 @@ GlueStrCat (
IN OUT CHAR16 *Destination,
IN CONST CHAR16 *Source
);
+
+
/**
Concatenates one Null-terminated Unicode string with a maximum length to the
end of another Null-terminated Unicode string, and returns the concatenated
@@ -442,22 +456,22 @@ GlueStrnCat (
);
/**
- Returns the first occurance of a Null-terminated Unicode sub-string
+ Returns the first occurance 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
+ 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
+ If PcdMaximumUnicodeStringLength is not zero, and SearchString
+ or String contains more than PcdMaximumUnicodeStringLength Unicode
characters not including the Null-terminator, then ASSERT().
@param String Pointer to a Null-terminated Unicode string.
@@ -475,37 +489,37 @@ StrStr (
);
/**
- Convert a Null-terminated Unicode decimal string to a value of
+ 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
+ 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.
-
+
+ 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 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,
+ If String has no pad spaces or valid decimal digits,
then 0 is returned.
- If the number represented by String overflows according
+ If the number represented by String overflows according
to the range defined by UINTN, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
+
+ 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.
- @retval UINTN
+ @retval UINTN
**/
UINTN
@@ -515,37 +529,37 @@ StrDecimalToUintn (
);
/**
- Convert a Null-terminated Unicode decimal string to a value of
+ 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
+ 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.
-
+
+ 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 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,
+ If String has no pad spaces or valid decimal digits,
then 0 is returned.
- If the number represented by String overflows according
+ If the number represented by String overflows according
to the range defined by UINT64, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
+
+ 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.
- @retval UINT64
+ @retval UINT64
**/
UINT64
@@ -553,35 +567,36 @@ 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.
+ 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
+
+ [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,
+ 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
+ If the number represented by String overflows according to the range defined by
UINTN, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
+ 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.
@@ -595,34 +610,35 @@ 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
+ 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,
+ 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
+ If the number represented by String overflows according to the range defined by
UINT64, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
+ 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.
@@ -636,28 +652,29 @@ StrHexToUint64 (
IN CONST CHAR16 *String
);
+
/**
- Convert one Null-terminated Unicode string to a Null-terminated
+ Convert one 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.
- If any Unicode characters in Source contain non-zero value in
+ 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.
+
+ 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
+
+ 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
+
+ If PcdMaximumAsciiStringLength is not zero, and Source contains more
+ than PcdMaximumAsciiStringLength Unicode characters not including the
Null-terminator, then ASSERT().
@param Source Pointer to a Null-terminated Unicode string.
@@ -673,6 +690,7 @@ UnicodeStrToAsciiStr (
OUT CHAR8 *Destination
);
+
/**
Copies one Null-terminated ASCII string to another Null-terminated ASCII
string and returns the new ASCII string.
@@ -700,6 +718,8 @@ AsciiStrCpy (
OUT CHAR8 *Destination,
IN CONST CHAR8 *Source
);
+
+
/**
Copies one Null-terminated ASCII string with a maximum length to another
Null-terminated ASCII string with a maximum length and returns the new ASCII
@@ -733,6 +753,8 @@ AsciiStrnCpy (
IN CONST CHAR8 *Source,
IN UINTN Length
);
+
+
/**
Returns the length of a Null-terminated ASCII string.
@@ -755,6 +777,8 @@ EFIAPI
AsciiStrLen (
IN CONST CHAR8 *String
);
+
+
/**
Returns the size of a Null-terminated ASCII string in bytes, including the
Null terminator.
@@ -777,6 +801,8 @@ EFIAPI
AsciiStrSize (
IN CONST CHAR8 *String
);
+
+
/**
Compares two Null-terminated ASCII strings, and returns the difference
between the first mismatched ASCII characters.
@@ -809,6 +835,8 @@ 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.
@@ -844,6 +872,8 @@ 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.
@@ -878,6 +908,8 @@ AsciiStrnCmp (
IN CONST CHAR8 *SecondString,
IN UINTN Length
);
+
+
/**
Concatenates one Null-terminated ASCII string to another Null-terminated
ASCII string, and returns the concatenated ASCII string.
@@ -911,6 +943,8 @@ AsciiStrCat (
IN OUT CHAR8 *Destination,
IN CONST CHAR8 *Source
);
+
+
/**
Concatenates one Null-terminated ASCII string with a maximum length to the
end of another Null-terminated ASCII string, and returns the concatenated
@@ -953,20 +987,21 @@ AsciiStrnCat (
IN UINTN Length
);
+
/**
- Returns the first occurance of a Null-terminated ASCII sub-string
+ Returns the first occurance 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,
+ 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
+ If PcdMaximumAsciiStringLength is not zero, and SearchString or
+ String contains more than PcdMaximumAsciiStringLength Unicode characters
not including the Null-terminator, then ASSERT().
@param String Pointer to a Null-terminated ASCII string.
@@ -983,34 +1018,35 @@ AsciiStrStr (
IN CONST CHAR8 *SearchString
);
+
/**
- Convert a Null-terminated ASCII decimal string to a value of type
+ 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
+ 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
+
+ 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
+ If the number represented by String overflows according to the range defined by
UINTN, then ASSERT().
If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
+ If PcdMaximumAsciiStringLength is not zero, and String contains more than
+ PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
then ASSERT().
@param String Pointer to a Null-terminated ASCII string.
- @retval UINTN
+ @retval UINTN
**/
UINTN
@@ -1019,34 +1055,35 @@ AsciiStrDecimalToUintn (
IN CONST CHAR8 *String
);
+
/**
- Convert a Null-terminated ASCII decimal string to a value of type
+ 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
+ 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
+
+ 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
+ If the number represented by String overflows according to the range defined by
UINT64, then ASSERT().
If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
+ If PcdMaximumAsciiStringLength is not zero, and String contains more than
+ PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
then ASSERT().
@param String Pointer to a Null-terminated ASCII string.
- @retval UINT64
+ @retval UINT64
**/
UINT64
@@ -1055,33 +1092,34 @@ 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
+ 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
+
+ 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,
+ If the number represented by String overflows according to the range defined by UINTN,
then ASSERT().
If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
+ If PcdMaximumAsciiStringLength is not zero,
+ and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
the Null-terminator, then ASSERT().
@param String Pointer to a Null-terminated ASCII string.
@@ -1095,33 +1133,34 @@ 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
+ 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
+
+ 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,
+ If the number represented by String overflows according to the range defined by UINT64,
then ASSERT().
If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
+ If PcdMaximumAsciiStringLength is not zero,
+ and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
the Null-terminator, then ASSERT().
@param String Pointer to a Null-terminated ASCII string.
@@ -1135,25 +1174,26 @@ AsciiStrHexToUint64 (
IN CONST CHAR8 *String
);
+
/**
- Convert one Null-terminated ASCII string to a Null-terminated
+ 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
+ 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,
+ 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
+ If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
+ PcdMaximumUnicodeStringLength ASCII characters not including the
Null-terminator, then ASSERT().
@param Source Pointer to a Null-terminated ASCII string.
@@ -1169,6 +1209,7 @@ AsciiStrToUnicodeStr (
OUT CHAR16 *Destination
);
+
/**
Converts an 8-bit value to an 8-bit BCD value.
@@ -1188,6 +1229,7 @@ DecimalToBcd8 (
IN UINT8 Value
);
+
/**
Converts an 8-bit BCD value to an 8-bit value.
@@ -1238,6 +1280,7 @@ struct _LIST_ENTRY {
**/
#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.
@@ -1260,6 +1303,7 @@ GlueInitializeListHead (
IN 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.
@@ -1288,6 +1332,7 @@ GlueInsertHeadList (
IN 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.
@@ -1316,6 +1361,7 @@ GlueInsertTailList (
IN LIST_ENTRY *Entry
);
+
/**
Retrieves the first node of a doubly linked list.
@@ -1341,6 +1387,7 @@ GlueGetFirstNode (
IN CONST LIST_ENTRY *List
);
+
/**
Retrieves the next node of a doubly linked list.
@@ -1369,6 +1416,7 @@ GlueGetNextNode (
IN CONST LIST_ENTRY *Node
);
+
/**
Checks to see if a doubly linked list is empty or not.
@@ -1393,6 +1441,7 @@ GlueIsListEmpty (
IN CONST LIST_ENTRY *ListHead
);
+
/**
Determines if a node in a doubly linked list is null.
@@ -1422,6 +1471,7 @@ GlueIsNull (
IN CONST LIST_ENTRY *Node
);
+
/**
Determines if a node the last node in a doubly linked list.
@@ -1451,6 +1501,7 @@ GlueIsNodeAtEnd (
IN CONST LIST_ENTRY *Node
);
+
/**
Swaps the location of two nodes in a doubly linked list, and returns the
first node after the swap.
@@ -1481,6 +1532,7 @@ GlueSwapListEntries (
IN LIST_ENTRY *SecondEntry
);
+
/**
Removes a node from a doubly linked list, and returns the node that follows
the removed node.
@@ -1534,6 +1586,7 @@ GlueLShiftU64 (
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.
@@ -1556,6 +1609,7 @@ GlueRShiftU64 (
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.
@@ -1578,6 +1632,7 @@ ARShiftU64 (
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.
@@ -1601,6 +1656,7 @@ LRotU32 (
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.
@@ -1624,6 +1680,7 @@ RRotU32 (
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.
@@ -1647,6 +1704,7 @@ LRotU64 (
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.
@@ -1670,6 +1728,7 @@ RRotU64 (
IN UINTN Count
);
+
/**
Returns the bit position of the lowest bit set in a 32-bit value.
@@ -1689,6 +1748,7 @@ LowBitSet32 (
IN UINT32 Operand
);
+
/**
Returns the bit position of the lowest bit set in a 64-bit value.
@@ -1708,6 +1768,7 @@ LowBitSet64 (
IN UINT64 Operand
);
+
/**
Returns the bit position of the highest bit set in a 32-bit value. Equivalent
to log2(x).
@@ -1728,6 +1789,7 @@ HighBitSet32 (
IN UINT32 Operand
);
+
/**
Returns the bit position of the highest bit set in a 64-bit value. Equivalent
to log2(x).
@@ -1748,6 +1810,7 @@ HighBitSet64 (
IN UINT64 Operand
);
+
/**
Returns the value of the highest bit set in a 32-bit value. Equivalent to
1 << HighBitSet32(x).
@@ -1767,6 +1830,7 @@ GetPowerOfTwo32 (
IN UINT32 Operand
);
+
/**
Returns the value of the highest bit set in a 64-bit value. Equivalent to
1 << HighBitSet64(x).
@@ -1786,6 +1850,7 @@ GetPowerOfTwo64 (
IN UINT64 Operand
);
+
/**
Switches the endianess of a 16-bit integer.
@@ -1804,6 +1869,7 @@ SwapBytes16 (
IN UINT16 Value
);
+
/**
Switches the endianess of a 32-bit integer.
@@ -1822,6 +1888,7 @@ SwapBytes32 (
IN UINT32 Value
);
+
/**
Switches the endianess of a 64-bit integer.
@@ -1840,6 +1907,7 @@ SwapBytes64 (
IN UINT64 Value
);
+
/**
Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
generates a 64-bit unsigned result.
@@ -1863,6 +1931,7 @@ GlueMultU64x32 (
IN UINT32 Multiplier
);
+
/**
Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
generates a 64-bit unsigned result.
@@ -1886,6 +1955,7 @@ MultU64x64 (
IN UINT64 Multiplier
);
+
/**
Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
64-bit signed result.
@@ -1909,6 +1979,7 @@ MultS64x64 (
IN INT64 Multiplier
);
+
/**
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
a 64-bit unsigned result.
@@ -1932,6 +2003,7 @@ GlueDivU64x32 (
IN UINT32 Divisor
);
+
/**
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
a 32-bit unsigned remainder.
@@ -1955,6 +2027,7 @@ ModU64x32 (
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.
@@ -1982,6 +2055,7 @@ DivU64x32Remainder (
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.
@@ -2009,6 +2083,7 @@ DivU64x64Remainder (
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.
@@ -2036,6 +2111,7 @@ DivS64x64Remainder (
OUT INT64 *Remainder OPTIONAL
);
+
/**
Reads a 16-bit value from memory that may be unaligned.
@@ -2055,6 +2131,7 @@ ReadUnaligned16 (
IN CONST UINT16 *Uint16
);
+
/**
Writes a 16-bit value to memory that may be unaligned.
@@ -2077,6 +2154,7 @@ WriteUnaligned16 (
IN UINT16 Value
);
+
/**
Reads a 24-bit value from memory that may be unaligned.
@@ -2096,6 +2174,7 @@ ReadUnaligned24 (
IN CONST UINT32 *Buffer
);
+
/**
Writes a 24-bit value to memory that may be unaligned.
@@ -2118,6 +2197,7 @@ WriteUnaligned24 (
IN UINT32 Value
);
+
/**
Reads a 32-bit value from memory that may be unaligned.
@@ -2137,6 +2217,7 @@ ReadUnaligned32 (
IN CONST UINT32 *Uint32
);
+
/**
Writes a 32-bit value to memory that may be unaligned.
@@ -2159,6 +2240,7 @@ WriteUnaligned32 (
IN UINT32 Value
);
+
/**
Reads a 64-bit value from memory that may be unaligned.
@@ -2178,6 +2260,7 @@ ReadUnaligned64 (
IN CONST UINT64 *Uint64
);
+
/**
Writes a 64-bit value to memory that may be unaligned.
@@ -2200,6 +2283,7 @@ WriteUnaligned64 (
IN UINT64 Value
);
+
//
// Bit Field Functions
//
@@ -2231,6 +2315,7 @@ BitFieldRead8 (
IN UINTN EndBit
);
+
/**
Writes a bit field to an 8-bit value, and returns the result.
@@ -2262,6 +2347,7 @@ BitFieldWrite8 (
IN UINT8 Value
);
+
/**
Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
result.
@@ -2294,6 +2380,7 @@ BitFieldOr8 (
IN UINT8 OrData
);
+
/**
Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
the result.
@@ -2326,6 +2413,7 @@ BitFieldAnd8 (
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.
@@ -2361,6 +2449,7 @@ BitFieldAndThenOr8 (
IN UINT8 OrData
);
+
/**
Returns a bit field from a 16-bit value.
@@ -2388,6 +2477,7 @@ BitFieldRead16 (
IN UINTN EndBit
);
+
/**
Writes a bit field to a 16-bit value, and returns the result.
@@ -2419,6 +2509,7 @@ BitFieldWrite16 (
IN UINT16 Value
);
+
/**
Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
result.
@@ -2451,6 +2542,7 @@ BitFieldOr16 (
IN UINT16 OrData
);
+
/**
Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
the result.
@@ -2483,6 +2575,7 @@ BitFieldAnd16 (
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.
@@ -2518,6 +2611,7 @@ BitFieldAndThenOr16 (
IN UINT16 OrData
);
+
/**
Returns a bit field from a 32-bit value.
@@ -2545,6 +2639,7 @@ BitFieldRead32 (
IN UINTN EndBit
);
+
/**
Writes a bit field to a 32-bit value, and returns the result.
@@ -2576,6 +2671,7 @@ BitFieldWrite32 (
IN UINT32 Value
);
+
/**
Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
result.
@@ -2608,6 +2704,7 @@ BitFieldOr32 (
IN UINT32 OrData
);
+
/**
Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
the result.
@@ -2640,6 +2737,7 @@ BitFieldAnd32 (
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.
@@ -2675,6 +2773,7 @@ BitFieldAndThenOr32 (
IN UINT32 OrData
);
+
/**
Returns a bit field from a 64-bit value.
@@ -2702,6 +2801,7 @@ BitFieldRead64 (
IN UINTN EndBit
);
+
/**
Writes a bit field to a 64-bit value, and returns the result.
@@ -2733,6 +2833,7 @@ BitFieldWrite64 (
IN UINT64 Value
);
+
/**
Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
result.
@@ -2765,6 +2866,7 @@ BitFieldOr64 (
IN UINT64 OrData
);
+
/**
Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
the result.
@@ -2797,6 +2899,7 @@ BitFieldAnd64 (
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.
@@ -2832,6 +2935,7 @@ BitFieldAndThenOr64 (
IN UINT64 OrData
);
+
//
// Base Library Synchronization Functions
//
@@ -2858,6 +2962,7 @@ GetSpinLockProperties (
VOID
);
+
/**
Initializes a spin lock to the released state and returns the spin lock.
@@ -2880,6 +2985,7 @@ InitializeSpinLock (
IN SPIN_LOCK *SpinLock
);
+
/**
Waits until a spin lock can be placed in the acquired state.
@@ -2906,6 +3012,7 @@ AcquireSpinLock (
IN SPIN_LOCK *SpinLock
);
+
/**
Attempts to place a spin lock in the acquired state.
@@ -2929,6 +3036,7 @@ AcquireSpinLockOrFail (
IN SPIN_LOCK *SpinLock
);
+
/**
Releases a spin lock.
@@ -2949,6 +3057,7 @@ ReleaseSpinLock (
IN SPIN_LOCK *SpinLock
);
+
/**
Performs an atomic increment of an 32-bit unsigned integer.
@@ -2970,6 +3079,7 @@ InterlockedIncrement (
IN UINT32 *Value
);
+
/**
Performs an atomic decrement of an 32-bit unsigned integer.
@@ -2991,6 +3101,7 @@ InterlockedDecrement (
IN UINT32 *Value
);
+
/**
Performs an atomic compare exchange operation on a 32-bit unsigned integer.
@@ -3018,6 +3129,7 @@ InterlockedCompareExchange32 (
IN UINT32 ExchangeValue
);
+
/**
Performs an atomic compare exchange operation on a 64-bit unsigned integer.
@@ -3044,6 +3156,7 @@ InterlockedCompareExchange64 (
IN UINT64 ExchangeValue
);
+
/**
Performs an atomic compare exchange operation on a pointer value.
@@ -3069,21 +3182,22 @@ InterlockedCompareExchangePointer (
IN VOID *ExchangeValue
);
+
//
// Base Library Checksum Functions
//
/**
- Calculate the sum of all elements in a buffer in unit of UINT8.
+ Calculate 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
+ 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().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the buffer to carry out the sum operation.
@param Length The size, in bytes, of Buffer .
@@ -3100,14 +3214,14 @@ CalculateSum8 (
/**
- Returns the two's complement checksum of all elements in a buffer
+ 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
+ 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().
@@ -3125,14 +3239,15 @@ CalculateCheckSum8 (
IN UINTN Length
);
+
/**
- Returns the sum of all elements in a buffer of 16-bit values. During
+ 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.
-
+ 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().
@@ -3151,19 +3266,20 @@ CalculateSum16 (
IN UINTN Length
);
+
/**
- Returns the two's complement checksum of all elements in a buffer of
+ 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
+ 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().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the buffer to carry out the checksum operation.
@param Length The size, in bytes, of Buffer.
@@ -3178,14 +3294,15 @@ CalculateCheckSum16 (
IN UINTN Length
);
+
/**
- Returns the sum of all elements in a buffer of 32-bit values. During
+ 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.
-
+ 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().
@@ -3204,19 +3321,20 @@ CalculateSum32 (
IN UINTN Length
);
+
/**
- Returns the two's complement checksum of all elements in a buffer of
+ 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
+ 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().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the buffer to carry out the checksum operation.
@param Length The size, in bytes, of Buffer.
@@ -3231,14 +3349,15 @@ CalculateCheckSum32 (
IN UINTN Length
);
+
/**
- Returns the sum of all elements in a buffer of 64-bit values. During
+ 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.
-
+ 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().
@@ -3257,19 +3376,20 @@ CalculateSum64 (
IN UINTN Length
);
+
/**
- Returns the two's complement checksum of all elements in a buffer of
+ 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
+ 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().
+ If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the buffer to carry out the checksum operation.
@param Length The size, in bytes, of Buffer.
@@ -3284,6 +3404,7 @@ CalculateCheckSum64 (
IN UINTN Length
);
+
//
// Base Library CPU Functions
//
@@ -3294,6 +3415,7 @@ VOID
IN VOID *Context2 OPTIONAL
);
+
/**
Used to serialize load and store operations.
@@ -3307,6 +3429,7 @@ MemoryFence (
VOID
);
+
/**
Saves the current CPU context that can be restored with a call to LongJump()
and returns 0.
@@ -3329,6 +3452,7 @@ SetJump (
OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
);
+
/**
Restores the CPU context that was saved with SetJump().
@@ -3352,6 +3476,7 @@ LongJump (
IN UINTN Value
);
+
/**
Enables CPU interrupts.
@@ -3364,6 +3489,7 @@ EnableInterrupts (
VOID
);
+
/**
Disables CPU interrupts.
@@ -3376,6 +3502,7 @@ DisableInterrupts (
VOID
);
+
/**
Disables CPU interrupts and returns the interrupt state prior to the disable
operation.
@@ -3393,6 +3520,7 @@ SaveAndDisableInterrupts (
VOID
);
+
/**
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
@@ -3407,6 +3535,7 @@ EnableDisableInterrupts (
VOID
);
+
/**
Retrieves the current CPU interrupt state.
@@ -3423,6 +3552,7 @@ GlueGetInterruptState (
VOID
);
+
/**
Set the current CPU interrupt state.
@@ -3443,6 +3573,7 @@ SetInterruptState (
IN BOOLEAN InterruptState
);
+
/**
Places the CPU in a sleep state until an interrupt is received.
@@ -3457,6 +3588,7 @@ CpuSleep (
VOID
);
+
/**
Requests CPU to pause for a short period of time.
@@ -3470,6 +3602,7 @@ CpuPause (
VOID
);
+
/**
Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
@@ -3482,13 +3615,18 @@ CpuFlushTlb (
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.
+ 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.
+ IPF CPUs 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().
@@ -3508,9 +3646,11 @@ SwitchStack (
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
IN VOID *Context1, OPTIONAL
IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
+ IN VOID *NewStack,
+ ...
);
+
/**
Generates a breakpoint on the CPU.
@@ -3524,6 +3664,7 @@ CpuBreakpoint (
VOID
);
+
/**
Executes an infinite loop.
@@ -3539,6 +3680,1237 @@ CpuDeadLoop (
VOID
);
+
+#if defined (MDE_CPU_IPF)
+
+/**
+ Flush a range of cache lines in the cache coherency domain of the calling
+ CPU.
+
+ Invalidates 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 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, the 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 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
+IpfFlushCacheRange (
+ IN VOID *Address,
+ IN UINTN Length
+ );
+
+
+/**
+ Executes a FC instruction
+ Executes a 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 IPF.
+
+ @param Address The Address of cache line to be flushed.
+
+ @return The address of FC instruction executed.
+
+**/
+UINT64
+EFIAPI
+AsmFc (
+ IN UINT64 Address
+ );
+
+
+/**
+ Executes a FC.I instruction.
+ Executes a 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 IPF.
+
+ @param Address The Address of cache line to be flushed.
+
+ @return The address of FC.I instruction executed.
+
+**/
+UINT64
+EFIAPI
+AsmFci (
+ IN UINT64 Address
+ );
+
+
+/**
+ Reads the current value of a Processor Identifier Register (CPUID).
+ 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 IPF.
+
+ @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 IPF.
+
+ @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 IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @return The current value of KR0.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr0 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #1 (KR1).
+ This function is only available on IPF.
+
+ @return The current value of KR1.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr1 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #2 (KR2).
+ This function is only available on IPF.
+
+ @return The current value of KR2.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr2 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #3 (KR3).
+ This function is only available on IPF.
+
+ @return The current value of KR3.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr3 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #4 (KR4).
+ This function is only available on IPF.
+
+ @return The current value of KR4.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr4 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #5 (KR5).
+ This function is only available on IPF.
+
+ @return The current value of KR5.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr5 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #6 (KR6).
+ This function is only available on IPF.
+
+ @return The current value of KR6.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr6 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of 64-bit Kernel Register #7 (KR7).
+ This function is only available on IPF.
+
+ @return The current value of KR7.
+
+**/
+UINT64
+EFIAPI
+AsmReadKr7 (
+ VOID
+ );
+
+
+/**
+ Write the current value of 64-bit Kernel Register #0 (KR0).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @return The current value of ITC.
+
+**/
+UINT64
+EFIAPI
+AsmReadItc (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Interval Timer Vector Register (ITV).
+ This function is only available on IPF.
+
+ @return The current value of ITV.
+
+**/
+UINT64
+EFIAPI
+AsmReadItv (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Interval Timer Match Register (ITM).
+ This function is only available on IPF.
+
+ @return The current value of ITM.
+**/
+UINT64
+EFIAPI
+AsmReadItm (
+ VOID
+ );
+
+
+/**
+ Writes the current value of 64-bit Interval Timer Counter Register (ITC).
+ This function is only available on IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @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).
+ 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 IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @return The current value of DCR.
+
+**/
+UINT64
+EFIAPI
+AsmReadDcr (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Interruption Vector Address Register (IVA).
+ This function is only available on IPF.
+
+ @return The current value of IVA.
+**/
+UINT64
+EFIAPI
+AsmReadIva (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Page Table Address Register (PTA).
+ This function is only available on IPF.
+
+ @return The current value of PTA.
+
+**/
+UINT64
+EFIAPI
+AsmReadPta (
+ VOID
+ );
+
+
+/**
+ Writes the current value of 64-bit Default Control Register (DCR).
+ 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 IPF.
+
+ @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).
+ 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 IPF.
+
+ @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).
+ 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 IPF.
+
+ @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).
+ This function is only available on IPF.
+
+ @return The current value of LID.
+
+**/
+UINT64
+EFIAPI
+AsmReadLid (
+ VOID
+ );
+
+
+/**
+ Reads the current value of External Interrupt Vector Register (IVR).
+ This function is only available on IPF.
+
+ @return The current value of IVR.
+
+**/
+UINT64
+EFIAPI
+AsmReadIvr (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Task Priority Register (TPR).
+ This function is only available on IPF.
+
+ @return The current value of TPR.
+
+**/
+UINT64
+EFIAPI
+AsmReadTpr (
+ VOID
+ );
+
+
+/**
+ Reads the current value of External Interrupt Request Register #0 (IRR0).
+ This function is only available on IPF.
+
+ @return The current value of IRR0.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr0 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of External Interrupt Request Register #1 (IRR1).
+ This function is only available on IPF.
+
+ @return The current value of IRR1.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr1 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of External Interrupt Request Register #2 (IRR2).
+ This function is only available on IPF.
+
+ @return The current value of IRR2.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr2 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of External Interrupt Request Register #3 (IRR3).
+ This function is only available on IPF.
+
+ @return The current value of IRR3.
+
+**/
+UINT64
+EFIAPI
+AsmReadIrr3 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Performance Monitor Vector Register (PMV).
+ This function is only available on IPF.
+
+ @return The current value of PMV.
+
+**/
+UINT64
+EFIAPI
+AsmReadPmv (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Corrected Machine Check Vector Register (CMCV).
+ This function is only available on IPF.
+
+ @return The current value of CMCV.
+
+**/
+UINT64
+EFIAPI
+AsmReadCmcv (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Local Redirection Register #0 (LRR0).
+ This function is only available on IPF.
+
+ @return The current value of LRR0.
+
+**/
+UINT64
+EFIAPI
+AsmReadLrr0 (
+ VOID
+ );
+
+
+/**
+ Reads the current value of Local Redirection Register #1 (LRR1).
+ This function is only available on IPF.
+
+ @return The current value of LRR1.
+
+**/
+UINT64
+EFIAPI
+AsmReadLrr1 (
+ VOID
+ );
+
+
+/**
+ Writes the current value of 64-bit Page Local Interrupt ID Register (LID).
+ 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 IPF.
+
+ @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).
+ 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 IPF.
+
+ @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 IPF.
+
+**/
+VOID
+EFIAPI
+AsmWriteEoi (
+ VOID
+ );
+
+
+/**
+ Writes the current value of 64-bit Performance Monitor Vector Register (PMV).
+ 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 IPF.
+
+ @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).
+ 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 IPF.
+
+ @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).
+ 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 IPF.
+
+ @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).
+ 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 IPF.
+
+ @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 4 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 IPF.
+
+ @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 4 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 IPF.
+
+ @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 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 PMC register range,
+ zero value will be returned.
+ This function is only available on IPF.
+
+ @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 IPF.
+
+ @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 4 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 IPF.
+
+ @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 4 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 IPF.
+
+ @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 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 PMC register range, the write is ignored.
+ This function is only available on IPF.
+
+ @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 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, the write is ignored.
+ This function is only available on IPF.
+
+ @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 IPF.
+
+ @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 IPF.
+
+ @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 IPF.
+
+ @return The current value of SP.
+
+**/
+UINT64
+EFIAPI
+AsmReadSp (
+ VOID
+ );
+
+
+/**
+ 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 IPF.
+
+ @return 1 The CPU is in virtual mode.
+ @return 0 The CPU is in physical mode.
+ @return -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 IPF.
+
+ @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
+ );
+
+
+/**
+ 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.
+
+ 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 NewBsp A pointer to the new memory location for RSE backing
+ store.
+
+**/
+VOID
+EFIAPI
+AsmSwitchStackAndBackingStore (
+ IN SWITCH_STACK_ENTRY_POINT EntryPoint,
+ IN VOID *Context1, OPTIONAL
+ IN VOID *Context2, OPTIONAL
+ IN VOID *NewStack,
+ IN VOID *NewBsp
+ );
+
+
+//
+// Bugbug: This call should be removed after
+// the PalCall Instance issue has been fixed.
+//
+/**
+ Performs a PAL call using static calling convention.
+
+ An internal function to perform a PAL call using static calling convention.
+
+ @param PalEntryPoint The entry point address of PAL. The address in ar.kr5
+ would be used if this parameter were NULL on input.
+ @param Arg1 The first argument of a PAL call.
+ @param Arg1 The second argument of a PAL call.
+ @param Arg1 The third argument of a PAL call.
+ @param Arg1 The fourth argument of a PAL call.
+
+ @return The values returned in r8, r9, r10 and r11.
+
+**/
+PAL_CALL_RETURN
+PalCallStatic (
+ IN CONST VOID *PalEntryPoint,
+ IN UINT64 Arg1,
+ IN UINT64 Arg2,
+ IN UINT64 Arg3,
+ IN UINT64 Arg4
+ );
+
+
+#elif defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
//
// IA32 and X64 Specific Functions
//
@@ -3806,6 +5178,7 @@ AsmCpuid (
OUT UINT32 *Edx OPTIONAL
);
+
/**
Retrieves CPUID information using an extended leaf identifier.
@@ -3849,6 +5222,7 @@ AsmCpuidEx (
OUT UINT32 *Edx OPTIONAL
);
+
/**
Returns the lower 32-bits of a Machine Specific Register(MSR).
@@ -3869,6 +5243,7 @@ AsmReadMsr32 (
IN UINT32 Index
);
+
/**
Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).
@@ -3892,6 +5267,7 @@ AsmWriteMsr32 (
IN UINT32 Value
);
+
/**
Reads a 64-bit MSR, performs a bitwise inclusive OR on the lower 32-bits, and
writes the result back to the 64-bit MSR.
@@ -3918,6 +5294,7 @@ AsmMsrOr32 (
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.
@@ -3944,6 +5321,7 @@ AsmMsrAnd32 (
IN UINT32 AndData
);
+
/**
Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive OR
on the lower 32-bits, and writes the result back to the 64-bit MSR.
@@ -3974,6 +5352,7 @@ AsmMsrAndThenOr32 (
IN UINT32 OrData
);
+
/**
Reads a bit field of an MSR.
@@ -4004,6 +5383,7 @@ AsmMsrBitFieldRead32 (
IN UINTN EndBit
);
+
/**
Writes a bit field to an MSR.
@@ -4038,6 +5418,7 @@ AsmMsrBitFieldWrite32 (
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.
@@ -4073,6 +5454,7 @@ AsmMsrBitFieldOr32 (
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.
@@ -4108,6 +5490,7 @@ AsmMsrBitFieldAnd32 (
IN UINT32 AndData
);
+
/**
Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
bitwise inclusive OR, and writes the result back to the bit field in the
@@ -4147,6 +5530,7 @@ AsmMsrBitFieldAndThenOr32 (
IN UINT32 OrData
);
+
/**
Returns a 64-bit Machine Specific Register(MSR).
@@ -4167,6 +5551,7 @@ AsmReadMsr64 (
IN UINT32 Index
);
+
/**
Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
value.
@@ -4191,6 +5576,7 @@ AsmWriteMsr64 (
IN UINT64 Value
);
+
/**
Reads a 64-bit MSR, performs a bitwise inclusive OR, and writes the result
back to the 64-bit MSR.
@@ -4216,6 +5602,7 @@ AsmMsrOr64 (
IN UINT64 OrData
);
+
/**
Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
64-bit MSR.
@@ -4241,6 +5628,7 @@ AsmMsrAnd64 (
IN UINT64 AndData
);
+
/**
Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive
OR, and writes the result back to the 64-bit MSR.
@@ -4270,6 +5658,7 @@ AsmMsrAndThenOr64 (
IN UINT64 OrData
);
+
/**
Reads a bit field of an MSR.
@@ -4300,6 +5689,7 @@ AsmMsrBitFieldRead64 (
IN UINTN EndBit
);
+
/**
Writes a bit field to an MSR.
@@ -4333,6 +5723,7 @@ AsmMsrBitFieldWrite64 (
IN UINT64 Value
);
+
/**
Reads a bit field in a 64-bit MSR, performs a bitwise inclusive OR, and
writes the result back to the bit field in the 64-bit MSR.
@@ -4368,6 +5759,7 @@ AsmMsrBitFieldOr64 (
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.
@@ -4403,6 +5795,7 @@ AsmMsrBitFieldAnd64 (
IN UINT64 AndData
);
+
/**
Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
bitwise inclusive OR, and writes the result back to the bit field in the
@@ -4441,6 +5834,7 @@ AsmMsrBitFieldAndThenOr64 (
IN UINT64 OrData
);
+
/**
Reads the current value of the EFLAGS register.
@@ -4457,6 +5851,7 @@ AsmReadEflags (
VOID
);
+
/**
Reads the current value of the Control Register 0 (CR0).
@@ -4473,6 +5868,7 @@ AsmReadCr0 (
VOID
);
+
/**
Reads the current value of the Control Register 2 (CR2).
@@ -4489,6 +5885,7 @@ AsmReadCr2 (
VOID
);
+
/**
Reads the current value of the Control Register 3 (CR3).
@@ -4505,6 +5902,7 @@ AsmReadCr3 (
VOID
);
+
/**
Reads the current value of the Control Register 4 (CR4).
@@ -4521,6 +5919,7 @@ AsmReadCr4 (
VOID
);
+
/**
Writes a value to Control Register 0 (CR0).
@@ -4538,6 +5937,7 @@ AsmWriteCr0 (
UINTN Cr0
);
+
/**
Writes a value to Control Register 2 (CR2).
@@ -4555,6 +5955,7 @@ AsmWriteCr2 (
UINTN Cr2
);
+
/**
Writes a value to Control Register 3 (CR3).
@@ -4572,6 +5973,7 @@ AsmWriteCr3 (
UINTN Cr3
);
+
/**
Writes a value to Control Register 4 (CR4).
@@ -4589,6 +5991,7 @@ AsmWriteCr4 (
UINTN Cr4
);
+
/**
Reads the current value of Debug Register 0 (DR0).
@@ -4605,6 +6008,7 @@ AsmReadDr0 (
VOID
);
+
/**
Reads the current value of Debug Register 1 (DR1).
@@ -4621,6 +6025,7 @@ AsmReadDr1 (
VOID
);
+
/**
Reads the current value of Debug Register 2 (DR2).
@@ -4637,6 +6042,7 @@ AsmReadDr2 (
VOID
);
+
/**
Reads the current value of Debug Register 3 (DR3).
@@ -4653,6 +6059,7 @@ AsmReadDr3 (
VOID
);
+
/**
Reads the current value of Debug Register 4 (DR4).
@@ -4669,6 +6076,7 @@ AsmReadDr4 (
VOID
);
+
/**
Reads the current value of Debug Register 5 (DR5).
@@ -4685,6 +6093,7 @@ AsmReadDr5 (
VOID
);
+
/**
Reads the current value of Debug Register 6 (DR6).
@@ -4701,6 +6110,7 @@ AsmReadDr6 (
VOID
);
+
/**
Reads the current value of Debug Register 7 (DR7).
@@ -4717,6 +6127,7 @@ AsmReadDr7 (
VOID
);
+
/**
Writes a value to Debug Register 0 (DR0).
@@ -4734,6 +6145,7 @@ AsmWriteDr0 (
UINTN Dr0
);
+
/**
Writes a value to Debug Register 1 (DR1).
@@ -4751,6 +6163,7 @@ AsmWriteDr1 (
UINTN Dr1
);
+
/**
Writes a value to Debug Register 2 (DR2).
@@ -4768,6 +6181,7 @@ AsmWriteDr2 (
UINTN Dr2
);
+
/**
Writes a value to Debug Register 3 (DR3).
@@ -4785,6 +6199,7 @@ AsmWriteDr3 (
UINTN Dr3
);
+
/**
Writes a value to Debug Register 4 (DR4).
@@ -4802,6 +6217,7 @@ AsmWriteDr4 (
UINTN Dr4
);
+
/**
Writes a value to Debug Register 5 (DR5).
@@ -4819,6 +6235,7 @@ AsmWriteDr5 (
UINTN Dr5
);
+
/**
Writes a value to Debug Register 6 (DR6).
@@ -4836,6 +6253,7 @@ AsmWriteDr6 (
UINTN Dr6
);
+
/**
Writes a value to Debug Register 7 (DR7).
@@ -4853,6 +6271,7 @@ AsmWriteDr7 (
UINTN Dr7
);
+
/**
Reads the current value of Code Segment Register (CS).
@@ -4868,6 +6287,7 @@ AsmReadCs (
VOID
);
+
/**
Reads the current value of Data Segment Register (DS).
@@ -4883,6 +6303,7 @@ AsmReadDs (
VOID
);
+
/**
Reads the current value of Extra Segment Register (ES).
@@ -4898,6 +6319,7 @@ AsmReadEs (
VOID
);
+
/**
Reads the current value of FS Data Segment Register (FS).
@@ -4913,6 +6335,7 @@ AsmReadFs (
VOID
);
+
/**
Reads the current value of GS Data Segment Register (GS).
@@ -4928,6 +6351,7 @@ AsmReadGs (
VOID
);
+
/**
Reads the current value of Stack Segment Register (SS).
@@ -4943,6 +6367,7 @@ AsmReadSs (
VOID
);
+
/**
Reads the current value of Task Register (TR).
@@ -4958,6 +6383,7 @@ AsmReadTr (
VOID
);
+
/**
Reads the current Global Descriptor Table Register(GDTR) descriptor.
@@ -4975,6 +6401,7 @@ AsmReadGdtr (
OUT IA32_DESCRIPTOR *Gdtr
);
+
/**
Writes the current Global Descriptor Table Register (GDTR) descriptor.
@@ -4992,6 +6419,7 @@ AsmWriteGdtr (
IN CONST IA32_DESCRIPTOR *Gdtr
);
+
/**
Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
@@ -5009,6 +6437,7 @@ AsmReadIdtr (
OUT IA32_DESCRIPTOR *Idtr
);
+
/**
Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
@@ -5026,6 +6455,7 @@ AsmWriteIdtr (
IN CONST IA32_DESCRIPTOR *Idtr
);
+
/**
Reads the current Local Descriptor Table Register(LDTR) selector.
@@ -5041,6 +6471,7 @@ AsmReadLdtr (
VOID
);
+
/**
Writes the current Local Descriptor Table Register (GDTR) selector.
@@ -5056,6 +6487,7 @@ AsmWriteLdtr (
IN UINT16 Ldtr
);
+
/**
Save the current floating point/SSE/SSE2 context to a buffer.
@@ -5075,6 +6507,7 @@ AsmFxSave (
OUT IA32_FX_BUFFER *Buffer
);
+
/**
Restores the current floating point/SSE/SSE2 context from a buffer.
@@ -5095,6 +6528,7 @@ AsmFxRestore (
IN CONST IA32_FX_BUFFER *Buffer
);
+
/**
Reads the current value of 64-bit MMX Register #0 (MM0).
@@ -5110,6 +6544,7 @@ AsmReadMm0 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #1 (MM1).
@@ -5125,6 +6560,7 @@ AsmReadMm1 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #2 (MM2).
@@ -5140,6 +6576,7 @@ AsmReadMm2 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #3 (MM3).
@@ -5155,6 +6592,7 @@ AsmReadMm3 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #4 (MM4).
@@ -5170,6 +6608,7 @@ AsmReadMm4 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #5 (MM5).
@@ -5185,6 +6624,7 @@ AsmReadMm5 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #6 (MM6).
@@ -5200,6 +6640,7 @@ AsmReadMm6 (
VOID
);
+
/**
Reads the current value of 64-bit MMX Register #7 (MM7).
@@ -5215,6 +6656,7 @@ AsmReadMm7 (
VOID
);
+
/**
Writes the current value of 64-bit MMX Register #0 (MM0).
@@ -5230,6 +6672,7 @@ AsmWriteMm0 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #1 (MM1).
@@ -5245,6 +6688,7 @@ AsmWriteMm1 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #2 (MM2).
@@ -5260,6 +6704,7 @@ AsmWriteMm2 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #3 (MM3).
@@ -5275,6 +6720,7 @@ AsmWriteMm3 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #4 (MM4).
@@ -5290,6 +6736,7 @@ AsmWriteMm4 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #5 (MM5).
@@ -5305,6 +6752,7 @@ AsmWriteMm5 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #6 (MM6).
@@ -5320,6 +6768,7 @@ AsmWriteMm6 (
IN UINT64 Value
);
+
/**
Writes the current value of 64-bit MMX Register #7 (MM7).
@@ -5335,6 +6784,7 @@ AsmWriteMm7 (
IN UINT64 Value
);
+
/**
Reads the current value of Time Stamp Counter (TSC).
@@ -5350,6 +6800,7 @@ AsmReadTsc (
VOID
);
+
/**
Reads the current value of a Performance Counter (PMC).
@@ -5367,6 +6818,7 @@ AsmReadPmc (
IN UINT32 Index
);
+
/**
Sets up a monitor buffer that is used by AsmMwait().
@@ -5391,6 +6843,7 @@ AsmMonitor (
IN UINTN Edx
);
+
/**
Executes an MWAIT instruction.
@@ -5412,6 +6865,7 @@ AsmMwait (
IN UINTN Ecx
);
+
/**
Executes a WBINVD instruction.
@@ -5425,6 +6879,7 @@ AsmWbinvd (
VOID
);
+
/**
Executes a INVD instruction.
@@ -5438,6 +6893,7 @@ AsmInvd (
VOID
);
+
/**
Flushes a cache line from all the instruction and data caches within the
coherency domain of the CPU.
@@ -5459,6 +6915,7 @@ AsmFlushCacheLine (
IN VOID *LinearAddress
);
+
/**
Enables the 32-bit paging mode on the CPU.
@@ -5505,6 +6962,7 @@ AsmEnablePaging32 (
IN VOID *NewStack
);
+
/**
Disables the 32-bit paging mode on the CPU.
@@ -5548,6 +7006,7 @@ AsmDisablePaging32 (
IN VOID *NewStack
);
+
/**
Enables the 64-bit paging mode on the CPU.
@@ -5590,6 +7049,7 @@ AsmEnablePaging64 (
IN UINT64 NewStack
);
+
/**
Disables the 64-bit paging mode on the CPU.
@@ -5630,6 +7090,7 @@ AsmDisablePaging64 (
IN UINT32 NewStack
);
+
//
// 16-bit thunking services
//
@@ -5662,6 +7123,7 @@ AsmGetThunk16Properties (
OUT UINT32 *ExtraStackSize
);
+
/**
Prepares all structures a code required to use AsmThunk16().
@@ -5679,6 +7141,7 @@ AsmPrepareThunk16 (
OUT THUNK_CONTEXT *ThunkContext
);
+
/**
Transfers control to a 16-bit real mode entry point and returns the results.
@@ -5699,6 +7162,7 @@ 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.
@@ -5722,121 +7186,8 @@ AsmPrepareAndThunk16 (
IN OUT THUNK_CONTEXT *ThunkContext
);
-/**
- 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.
-
- 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 NewBsp A pointer to the new memory location for RSE backing
- store.
-
-**/
-VOID
-EFIAPI
-AsmSwitchStackAndBackingStore (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VOID *NewBsp
- );
-
-typedef struct {
- UINT64 Status;
- UINT64 r9;
- UINT64 r10;
- UINT64 r11;
-} PAL_PROC_RETURN;
-
-//
-// IPF Specific functions
-//
-
-
-/**
- Performs a PAL call using static calling convention.
-
- An internal function to perform a PAL call using static calling convention.
-
- @param PalEntryPoint The entry point address of PAL. The address in ar.kr5
- would be used if this parameter were NULL on input.
- @param Arg1 The first argument of a PAL call.
- @param Arg1 The second argument of a PAL call.
- @param Arg1 The third argument of a PAL call.
- @param Arg1 The fourth argument of a PAL call.
-
- @return The values returned in r8, r9, r10 and r11.
-
-**/
-PAL_PROC_RETURN
-PalCallStatic (
- IN CONST VOID *PalEntryPoint,
- IN UINT64 Arg1,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- );
-
-
-/**
- Returns the current value of ar.itc.
-
- An internal function to return the current value of ar.itc, which is the
- timer tick on IPF.
-
- @return The currect value of ar.itc
-
-**/
-INT64
-IpfReadItc (
- VOID
- );
-
-
-/**
- Flush a range of cache lines in the cache coherency domain of the calling
- CPU.
-
- Invalidates 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 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, the 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 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
-IpfFlushCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
+#else
#endif
+#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h
index 577b28d272..90ec02600d 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h
@@ -97,6 +97,19 @@ Abstract:
#define EFI_D_EVENT DEBUG_EVENT
#define EFI_D_ERROR DEBUG_ERROR
+
+//
+// Use the following 4 macros to save size
+//
+#define DebugAssertEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0))
+
+#define DebugPrintEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0))
+
+#define DebugCodeEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0))
+
+#define DebugClearMemoryEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0))
+
+
/**
Prints a debug message to the debug output device if the specified error level is enabled.
@@ -179,78 +192,6 @@ DebugClearMemory (
/**
- 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_DEBUG_CLEAR_MEMORY_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
- VOID
- );
-
-
-/**
-
Internal worker macro that calls DebugAssert().
This macro calls DebugAssert() passing in the filename, line number, and
@@ -259,8 +200,12 @@ DebugClearMemoryEnabled (
@param Expression Boolean expression that evailated to FALSE
**/
+#ifdef EFI_DEBUG
#define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, #Expression)
+#else
+#define _ASSERT(Expression)
+#endif
/**
@@ -273,8 +218,12 @@ DebugClearMemoryEnabled (
and a variable argument list based on the format string.
**/
+#ifdef EFI_DEBUG
#define _DEBUG(Expression) DebugPrint Expression
+#else
+#define _DEBUG(Expression)
+#endif
/**
@@ -443,6 +392,7 @@ DebugClearMemoryEnabled (
@param Guid Pointer to a protocol GUID.
**/
+#ifdef EFI_DEBUG
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \
do { \
if (DebugAssertEnabled ()) { \
@@ -459,6 +409,10 @@ DebugClearMemoryEnabled (
} \
} \
} while (FALSE)
+#else
+#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \
+ do {} while(0);
+#endif
/**
@@ -563,9 +517,15 @@ DebugClearMemoryEnabled (
@param TestSignature The 32-bit signature value to match.
**/
-#define CR(Record, TYPE, Field, TestSignature) \
- (DebugAssertEnabled () && (_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
- (TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
- _CR (Record, TYPE, Field)
-
+#ifdef EFI_DEBUG
+ #define CR(Record, TYPE, Field, TestSignature) \
+ (DebugAssertEnabled () && (_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
+ (TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
+ _CR (Record, TYPE, Field)
+#else
+ #define CR(Record, TYPE, Field, TestSignature) \
+ _CR (Record, TYPE, Field)
+#endif
+
+
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h
index f5ee0bc5ed..0db9ee55f4 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h
@@ -250,6 +250,7 @@ EfiGetNextHighMonotonicCount (
**/
VOID
+EFIAPI
EfiResetSystem (
IN EFI_RESET_TYPE ResetType,
IN EFI_STATUS ResetStatus,
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h
index 601656923b..47444e2044 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation
+Copyright (c) 2004 - 2007, Intel Corporation
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
@@ -23,6 +23,7 @@ Abstract:
#ifndef __EDKII_GLUE_HII_LIB_H__
#define __EDKII_GLUE_HII_LIB_H__
+#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
#define PreparePackages GluePreparePackages
@@ -49,6 +50,6 @@ GluePreparePackages (
)
;
-
+#endif
#endif