summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-09 06:26:42 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-09 06:26:42 +0000
commite56187913724379012649c0411668f94ac2ffd9f (patch)
treef455b0004585ba7f2b38fd51ec4e1c82a2e58e8b
parentb3ff502f6dbbd343c75859ee04de4ee1683cdecc (diff)
downloadedk2-platforms-e56187913724379012649c0411668f94ac2ffd9f.tar.xz
Add INF extension Information
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7228 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Application/HelloWorld/HelloWorld.inf4
-rw-r--r--MdeModulePkg/Include/Guid/Bmp.h10
-rw-r--r--MdeModulePkg/Include/Guid/CapsuleVendor.h5
-rw-r--r--MdeModulePkg/Include/Guid/GenericPlatformVariable.h2
-rw-r--r--MdeModulePkg/Include/MdeModuleHii.h14
-rw-r--r--MdeModulePkg/Include/VariableFormat.h41
-rw-r--r--MdeModulePkg/Include/WorkingBlockHeader.h4
-rw-r--r--MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf4
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf8
-rw-r--r--MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwLite.inf6
-rw-r--r--MdeModulePkg/Universal/PCD/Pei/Pcd.inf10
-rw-r--r--MdeModulePkg/Universal/PCD/Pei/Service.c5
-rw-r--r--MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf2
-rw-r--r--MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c106
-rw-r--r--MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.inf31
-rw-r--r--MdeModulePkg/Universal/PlatformDriverOverride/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf2
-rw-r--r--MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf2
-rw-r--r--MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c28
-rw-r--r--MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h12
-rw-r--r--MdeModulePkg/Universal/Variable/Pei/Variable.h11
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c28
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h17
22 files changed, 163 insertions, 189 deletions
diff --git a/MdeModulePkg/Application/HelloWorld/HelloWorld.inf b/MdeModulePkg/Application/HelloWorld/HelloWorld.inf
index 50fb686319..2ee77d91c4 100644
--- a/MdeModulePkg/Application/HelloWorld/HelloWorld.inf
+++ b/MdeModulePkg/Application/HelloWorld/HelloWorld.inf
@@ -52,5 +52,5 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
[Pcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString
- gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString ## Valid when gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes ## Valid when gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
diff --git a/MdeModulePkg/Include/Guid/Bmp.h b/MdeModulePkg/Include/Guid/Bmp.h
index 0ab73790fb..093a9587c5 100644
--- a/MdeModulePkg/Include/Guid/Bmp.h
+++ b/MdeModulePkg/Include/Guid/Bmp.h
@@ -1,6 +1,6 @@
/** @file
- This file defines header data structures for BMP file and default
- FFS GUID Filename for BMP logo file.
+ This file defines BMP file header data structures.
+ It also defines the File GUID for default BMP logo file.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -34,10 +34,10 @@ typedef struct {
UINT32 HeaderSize;
UINT32 PixelWidth;
UINT32 PixelHeight;
- UINT16 Planes; /// Must be 1
- UINT16 BitPerPixel; /// 1, 4, 8, or 24
+ UINT16 Planes; ///> Must be 1
+ UINT16 BitPerPixel; ///> 1, 4, 8, or 24
UINT32 CompressionType;
- UINT32 ImageSize; /// Compressed image size in bytes
+ UINT32 ImageSize; ///> Compressed image size in bytes
UINT32 XPixelsPerMeter;
UINT32 YPixelsPerMeter;
UINT32 NumberOfColors;
diff --git a/MdeModulePkg/Include/Guid/CapsuleVendor.h b/MdeModulePkg/Include/Guid/CapsuleVendor.h
index b326018c49..58ac355bd4 100644
--- a/MdeModulePkg/Include/Guid/CapsuleVendor.h
+++ b/MdeModulePkg/Include/Guid/CapsuleVendor.h
@@ -1,7 +1,6 @@
/** @file
-
- This file defines capsule vendor guid, capsule variable name
- and capsule guid hob data structure.
+ This file defines capsule vendor guid for capsule variable and hob.
+ It also defines capsule varialbe name and capsule guid hob data structure.
They are used by EDKII implementation of capsule update across a system reset.
Copyright (c) 2006 - 2008, Intel Corporation
diff --git a/MdeModulePkg/Include/Guid/GenericPlatformVariable.h b/MdeModulePkg/Include/Guid/GenericPlatformVariable.h
index 92c73234f0..f63fe9588d 100644
--- a/MdeModulePkg/Include/Guid/GenericPlatformVariable.h
+++ b/MdeModulePkg/Include/Guid/GenericPlatformVariable.h
@@ -1,6 +1,6 @@
/** @file
This file defines the genenic platform guid for EFI variable.
- Common drivers can use this generic guid with its variable name to specify
+ Generic drivers can use this guid with its variable name to specify
its EFI variable without defining another new guid.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
diff --git a/MdeModulePkg/Include/MdeModuleHii.h b/MdeModulePkg/Include/MdeModuleHii.h
index 9f5c3e3e0e..092cdaf310 100644
--- a/MdeModulePkg/Include/MdeModuleHii.h
+++ b/MdeModulePkg/Include/MdeModuleHii.h
@@ -1,5 +1,5 @@
/** @file
- EDK II implementation specific HII relative definition.
+ EDKII extented HII IFR guid opcodes.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -98,9 +98,9 @@ typedef struct _EFI_IFR_GUID_BANNER {
/// EFI_IFR_EXTEND_OP_BANNER
///
UINT8 ExtendOpCode;
- EFI_STRING_ID Title; /// The string token for the banner title
- UINT16 LineNumber; /// 1-based line number
- UINT8 Alignment; /// left, center, or right-aligned
+ EFI_STRING_ID Title; ///< The string token for the banner title
+ UINT16 LineNumber; ///< 1-based line number
+ UINT8 Alignment; ///< left, center, or right-aligned
} EFI_IFR_GUID_BANNER;
///
@@ -116,7 +116,7 @@ typedef struct _EFI_IFR_GUID_TIMEOUT {
/// EFI_IFR_EXTEND_OP_TIMEOUT
///
UINT8 ExtendOpCode;
- UINT16 TimeOut; /// TimeOut Value
+ UINT16 TimeOut; ///< TimeOut Value
} EFI_IFR_GUID_TIMEOUT;
#define EFI_NON_DEVICE_CLASS 0x00
@@ -140,7 +140,7 @@ typedef struct _EFI_IFR_GUID_CLASS {
/// EFI_IFR_EXTEND_OP_CLASS
///
UINT8 ExtendOpCode;
- UINT16 Class; /// Device Class from the above
+ UINT16 Class; ///< Device Class from the above
} EFI_IFR_GUID_CLASS;
#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
@@ -161,7 +161,7 @@ typedef struct _EFI_IFR_GUID_SUBCLASS {
/// EFI_IFR_EXTEND_OP_SUBCLASS
///
UINT8 ExtendOpCode;
- UINT16 SubClass; ///Sub Class type from the above
+ UINT16 SubClass; ///< Sub Class type from the above
} EFI_IFR_GUID_SUBCLASS;
///
diff --git a/MdeModulePkg/Include/VariableFormat.h b/MdeModulePkg/Include/VariableFormat.h
index 2f7c7c6663..6e4ad1a9ca 100644
--- a/MdeModulePkg/Include/VariableFormat.h
+++ b/MdeModulePkg/Include/VariableFormat.h
@@ -1,5 +1,6 @@
/** @file
- The variable data structure related to EDK II specific UEFI variable implementation.
+ The variable data structures are related to EDK II specific UEFI variable implementation.
+ Variable data header and Variable storage region header are defined here.
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -16,23 +17,8 @@
#define __VARIABLE_FORMAT_H__
///
-/// Maximum buffer for the single variable.
-///
-#ifndef MAX_VARIABLE_SIZE
-#define MAX_VARIABLE_SIZE FixedPcdGet32(PcdMaxVariableSize)
-#endif
-
-///
-/// Maximum buffer for Hardware error record variable
-///
-#ifndef MAX_HARDWARE_ERROR_VARIABLE_SIZE
-#define MAX_HARDWARE_ERROR_VARIABLE_SIZE FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
-#endif
-
-///
-/// The alignment of variable's start offset.
-/// For IA32/X64 architecture, the alignment is set to 1, and
-/// 8 is for IPF archtecture.
+/// Alignment of variable name and data.
+/// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture.
///
#if defined (MDE_CPU_IPF)
#define ALIGNMENT 8
@@ -40,10 +26,23 @@
#define ALIGNMENT 1
#endif
+//
+// Define GET_PAD_SIZE to optimize compiler
+//
+#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
+#define GET_PAD_SIZE(a) (0)
+#else
+#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
+#endif
+
+///
+/// Alignment of Variable Data Header in Variable Store region
+///
#define HEADER_ALIGNMENT 4
+#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
///
-/// Variable Store Status
+/// Status of Variable Store Region
///
typedef enum {
EfiRaw,
@@ -100,7 +99,7 @@ typedef struct {
#define VAR_ADDED 0x3f ///< Variable has been completely added
///
-/// Variable Data Header Structure
+/// Single Variable Data Header Structure
///
typedef struct {
///
@@ -125,7 +124,7 @@ typedef struct {
///
UINT32 DataSize;
///
- /// A unique identifier for the vendor.
+ /// A unique identifier for the vendor that produce and consume this varaible.
///
EFI_GUID VendorGuid;
} VARIABLE_HEADER;
diff --git a/MdeModulePkg/Include/WorkingBlockHeader.h b/MdeModulePkg/Include/WorkingBlockHeader.h
index 93a0c8d934..4298d5fe18 100644
--- a/MdeModulePkg/Include/WorkingBlockHeader.h
+++ b/MdeModulePkg/Include/WorkingBlockHeader.h
@@ -20,8 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define WORKING_BLOCK_INVALID 0x2
///
-/// EFI Fault tolerant working block header
-/// The header is immediately followed by the write queue.
+/// EDKII Fault tolerant working block header
+/// The header is immediately followed by the write queue data.
///
typedef struct {
///
diff --git a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
index f13098f8d3..8a977003dc 100644
--- a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
+++ b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
@@ -45,6 +45,6 @@
BaseMemoryLib
[Protocols]
- gEfiCrc32GuidedSectionExtractionProtocolGuid # ALWAYS CONSUMED used as Guid, not protocol service
- gEfiSecurityPolicyProtocolGuid # ALWAYS CONSUMED
+ gEfiCrc32GuidedSectionExtractionProtocolGuid ## PRODUCED
+ gEfiSecurityPolicyProtocolGuid ## SOMETIMES_CONSUMED (Set platform override AUTH status if exist)
\ No newline at end of file
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
index 5addb49118..6d7fe08351 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
@@ -2,7 +2,7 @@
#
# Capsule Runtime Drivers produces two UEFI capsule runtime services.
# (UpdateCapsule, QueryCapsuleCapabilities)
-# It installs the Capsule Architectural Protocol (EDKII definition) to signify
+# It installs the Capsule Architectural Protocol (EDKII extension definition) to signify
# the capsule runtime services are ready.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
@@ -47,10 +47,10 @@
UefiRuntimeLib
[Guids]
- gEfiCapsuleVendorGuid # Produce variable L"CapsuleUpdateData" for capsule updated data
+ gEfiCapsuleVendorGuid ## SOMETIMES_PRODUCED (Process across reset capsule image) ## Variable:L"CapsuleUpdateData" for capsule updated data
[Protocols]
- gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiCapsuleArchProtocolGuid ## PRODUCED
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset
@@ -60,4 +60,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
[Depex]
- gEfiVariableWriteArchProtocolGuid # Depends on variable write functionality to produce capsule data variable
+ gEfiVariableWriteArchProtocolGuid ## Depends on variable write functionality to produce capsule data variable
diff --git a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwLite.inf b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwLite.inf
index ed51c07d18..758d128a38 100644
--- a/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwLite.inf
+++ b/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwLite.inf
@@ -50,11 +50,11 @@
DevicePathLib
[Guids]
- gEfiSystemNvDataFvGuid # ALWAYS_CONSUMED, Signature of Working Space Header
+ gEfiSystemNvDataFvGuid ## CONSUMED ## FV Signature of Working Space Header
[Protocols]
- gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiFaultTolerantWriteLiteProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiFirmwareVolumeBlockProtocolGuid ## CONSUMED
+ gEfiFaultTolerantWriteLiteProtocolGuid ## PRODUCED
[Pcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.inf b/MdeModulePkg/Universal/PCD/Pei/Pcd.inf
index 01acc1d42d..44e426e11c 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Pcd.inf
+++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.inf
@@ -47,13 +47,13 @@
DebugLib
[Guids]
- gPcdPeiCallbackFnTableHobGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION
- gPcdDataBaseHobGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION
-
+ gPcdPeiCallbackFnTableHobGuid ## RPIVATE ## Hob
+ gPcdDataBaseHobGuid ## PRODUCED ## Hob
+ gPcdDataBaseHobGuid ## CONSUMED ## Hob
[Ppis]
- gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED
- gPcdPpiGuid # PPI ALWAYS_PRODUCED
+ gEfiPeiReadOnlyVariable2PpiGuid ## CONSUMED
+ gPcdPpiGuid ## PRODUCED
[FeaturePcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiPcdDatabaseSetEnabled
diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c
index ce646edc7b..4bd3c6150a 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Service.c
+++ b/MdeModulePkg/Universal/PCD/Pei/Service.c
@@ -167,9 +167,8 @@ GetHiiVariable (
&Size,
NULL
);
- if (Status == EFI_BUFFER_TOO_SMALL) {
-
+ if (Status == EFI_BUFFER_TOO_SMALL) {
Status = PeiServicesAllocatePool (Size, &Buffer);
ASSERT_EFI_ERROR (Status);
@@ -187,7 +186,7 @@ GetHiiVariable (
*VariableData = Buffer;
return EFI_SUCCESS;
- }
+ }
return EFI_NOT_FOUND;
}
diff --git a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf
index 2a78525785..308fc08c6e 100644
--- a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf
+++ b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PcatSingleSegmentPciCfg2Pei.inf
@@ -45,7 +45,7 @@
[Ppis]
- gEfiPciCfg2PpiGuid # PPI ALWAYS_PRODUCED
+ gEfiPciCfg2PpiGuid ## PRODUCED
[Depex]
TRUE
diff --git a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c
index e4ea60cff2..a60e5576de 100644
--- a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c
+++ b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c
@@ -1,20 +1,5 @@
/** @file
-Copyright (c) 2007 - 2008, 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
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- PlatOverMngr.c
-
-Abstract:
-
A UI application to offer a UI interface in device manager to let user configue
platform override protocol to override the default algorithm for matching
drivers to controllers.
@@ -27,6 +12,15 @@ Abstract:
4. The UI application save all the mapping info in NV variables which will be consumed
by platform override protocol driver to publish the platform override protocol.
+Copyright (c) 2007 - 2008, 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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
**/
#include <PiDxe.h>
@@ -119,30 +113,33 @@ ConvertComponentNameSupportLanguage (
IN CHAR8 *Language
)
{
- CHAR8 *LangCode;
- LangCode = NULL;
+ CHAR8 *LangCode;
+ LangCode = NULL;
//
- // check the input language is English
+ // Check the input language is English
//
if (AsciiStrnCmp (Language, "en-", 3) != 0) {
return NULL;
}
-
- //
- // Convert Language string from RFC 3066 to ISO 639-2
- //
- LangCode = AllocateZeroPool(4);
- AsciiStrCpy (LangCode, "eng");
//
- // Check whether the converted language is supported in the SupportedLanguages list.
+ // Check SupportedLanguages format
//
- if (AsciiStrStr (SupportedLanguages, LangCode) == NULL) {
- FreePool (LangCode);
- return NULL;
+ if (AsciiStrStr (SupportedLanguages, "en-") != NULL) {
+ //
+ // Create RFC 3066 language
+ //
+ LangCode = AllocateZeroPool(AsciiStrSize (Language));
+ AsciiStrCpy (LangCode, Language);
+ } else if (AsciiStrStr (SupportedLanguages, "en") != NULL) {
+ //
+ // Create ISO 639-2 Language
+ //
+ LangCode = AllocateZeroPool(4);
+ AsciiStrCpy (LangCode, "eng");
}
-
+
return LangCode;
}
@@ -193,12 +190,14 @@ GetComponentName (
if (ComponentName != NULL) {
if (ComponentName->GetDriverName != NULL) {
SupportedLanguage = ConvertComponentNameSupportLanguage (ComponentName->SupportedLanguages, mLanguage);
- Status = ComponentName->GetDriverName (
- ComponentName,
- SupportedLanguage,
- &DriverName
- );
- FreePool (SupportedLanguage);
+ if (SupportedLanguage != NULL) {
+ Status = ComponentName->GetDriverName (
+ ComponentName,
+ SupportedLanguage,
+ &DriverName
+ );
+ FreePool (SupportedLanguage);
+ }
}
} else if (ComponentName2 != NULL) {
if (ComponentName2->GetDriverName != NULL) {
@@ -555,7 +554,10 @@ GetDriverBindingHandleFromImageHandle (
if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) {
return NULL;
}
-
+
+ //
+ // Get the first Driver Binding handle which has the specific image handle.
+ //
for (Index = 0; Index < DriverBindingHandleCount; Index++) {
DriverBindingInterface = NULL;
Status = gBS->OpenProtocol (
@@ -576,9 +578,6 @@ GetDriverBindingHandleFromImageHandle (
}
}
- //
- // If no Driver Binding Protocol instance is found
- //
FreePool (DriverBindingHandleBuffer);
return DriverBindingHandle;
}
@@ -1301,7 +1300,7 @@ PlatOverMngrInit (
EFI_CALLBACK_INFO *CallbackInfo;
EFI_HANDLE DriverHandle;
EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
-
+
//
// There should only be one HII protocol
//
@@ -1341,7 +1340,7 @@ PlatOverMngrInit (
//
Status = HiiLibCreateHiiDriverHandle (&DriverHandle);
if (EFI_ERROR (Status)) {
- return Status;
+ goto Finish;
}
CallbackInfo->DriverHandle = DriverHandle;
@@ -1355,7 +1354,7 @@ PlatOverMngrInit (
&CallbackInfo->ConfigAccess
);
if (EFI_ERROR (Status)) {
- return Status;
+ goto Finish;
}
//
@@ -1377,6 +1376,10 @@ PlatOverMngrInit (
);
FreePool (PackageList);
+ if (EFI_ERROR (Status)) {
+ goto Finish;
+ }
+
//
// Locate ConfigRouting protocol
//
@@ -1386,7 +1389,7 @@ PlatOverMngrInit (
(VOID **) &CallbackInfo->HiiConfigRouting
);
if (EFI_ERROR (Status)) {
- return Status;
+ goto Finish;
}
//
@@ -1411,11 +1414,24 @@ PlatOverMngrInit (
NULL,
NULL
);
+ if (EFI_ERROR (Status)) {
+ goto Finish;
+ }
Status = HiiDatabase->RemovePackageList (HiiDatabase, CallbackInfo->RegisteredHandle);
if (EFI_ERROR (Status)) {
- return Status;
+ goto Finish;
}
-
+
return EFI_SUCCESS;
+
+Finish:
+ if (CallbackInfo->DriverHandle != NULL) {
+ HiiLibDestroyHiiDriverHandle (CallbackInfo->DriverHandle);
+ }
+ if (CallbackInfo != NULL) {
+ FreePool (CallbackInfo);
+ }
+
+ return Status;
}
diff --git a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.inf b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.inf
index 4ba540e079..7ba07bcb60 100644
--- a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.inf
+++ b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.inf
@@ -67,21 +67,22 @@
GenericBdsLib
[Guids]
- gEfiGlobalVariableGuid # Get value of variable L"PlatformLang".
- # this value specifies the platform supported language string (RFC 3066)
+ gEfiGlobalVariableGuid ## CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 3066 format)
[Protocols]
- gEfiComponentName2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiComponentNameProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiFirmwareVolume2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiBusSpecificDriverOverrideProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiDriverBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiLoadedImageDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiHiiDatabaseProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiFormBrowser2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiHiiConfigRoutingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiHiiConfigAccessProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
+ gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
+ gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
+ gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
+ gEfiBusSpecificDriverOverrideProtocolGuid ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
+
+ gEfiDriverBindingProtocolGuid ## SOMETIMES_CONSUMED
+ gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMED
+ gEfiLoadedImageDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
+ gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
+
+ gEfiHiiDatabaseProtocolGuid ## CONSUMED
+ gEfiFormBrowser2ProtocolGuid ## CONSUMED
+ gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
+ gEfiHiiConfigAccessProtocolGuid ## PRODUCED
\ No newline at end of file
diff --git a/MdeModulePkg/Universal/PlatformDriverOverride/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf b/MdeModulePkg/Universal/PlatformDriverOverride/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
index 299e42c8e8..90ee5133e2 100644
--- a/MdeModulePkg/Universal/PlatformDriverOverride/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
+++ b/MdeModulePkg/Universal/PlatformDriverOverride/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
@@ -45,5 +45,5 @@
UefiBootServicesTableLib
[Protocols]
- gEfiPlatformDriverOverrideProtocolGuid # ALWAYS_PRODUCED
+ gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED
\ No newline at end of file
diff --git a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
index 71c5a8ef38..2d02248b13 100644
--- a/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
+++ b/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
@@ -39,7 +39,7 @@
DebugLib
[Protocols]
- gEfiSecurityArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiSecurityArchProtocolGuid ## PRODUCED
[Depex]
TRUE
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
index f028b717c9..8954a5fd8e 100644
--- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
+++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
@@ -118,7 +118,7 @@ GetNextVariablePtr (
VarHeader = (VARIABLE_HEADER *) (GetVariableDataPtr (Variable) + Variable->DataSize + GET_PAD_SIZE (Variable->DataSize));
if (VarHeader->StartId != VARIABLE_DATA ||
- (sizeof (VARIABLE_HEADER) + VarHeader->DataSize + VarHeader->NameSize) > MAX_VARIABLE_SIZE
+ (sizeof (VARIABLE_HEADER) + VarHeader->DataSize + VarHeader->NameSize) > FixedPcdGet32(PcdMaxVariableSize)
) {
return NULL;
}
@@ -485,21 +485,21 @@ SetVariable (
}
//
// The size of the VariableName, including the Unicode Null in bytes plus
- // the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)
- // bytes for HwErrRec, and MAX_VARIABLE_SIZE (1024) bytes for the others.
+ // the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
+ // bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
- if ((DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE) ||
- (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE)) {
+ if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
+ (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
return EFI_INVALID_PARAMETER;
}
} else {
//
// The size of the VariableName, including the Unicode Null in bytes plus
- // the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
+ // the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
//
- if ((DataSize > MAX_VARIABLE_SIZE) ||
- (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
+ if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
+ (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
return EFI_INVALID_PARAMETER;
}
}
@@ -740,15 +740,15 @@ QueryVariableInfo (
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
//
- // Let *MaximumVariableSize be MAX_VARIABLE_SIZE with the exception of the variable header size.
+ // Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
//
- *MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
+ *MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
//
// Harware error record variable needs larger size.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
- *MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
+ *MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
}
//
@@ -808,13 +808,13 @@ InitializeVariableStore (
// Allocate memory for volatile variable store
//
VariableStore = (VARIABLE_STORE_HEADER *) AllocateRuntimePool (
- VARIABLE_STORE_SIZE
+ FixedPcdGet32(PcdVariableStoreSize)
);
if (NULL == VariableStore) {
return EFI_OUT_OF_RESOURCES;
}
- SetMem (VariableStore, VARIABLE_STORE_SIZE, 0xff);
+ SetMem (VariableStore, FixedPcdGet32(PcdVariableStoreSize), 0xff);
//
// Variable Specific Data
@@ -823,7 +823,7 @@ InitializeVariableStore (
*LastVariableOffset = sizeof (VARIABLE_STORE_HEADER);
VariableStore->Signature = VARIABLE_STORE_SIGNATURE;
- VariableStore->Size = VARIABLE_STORE_SIZE;
+ VariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
VariableStore->Format = VARIABLE_STORE_FORMATTED;
VariableStore->State = VARIABLE_STORE_HEALTHY;
VariableStore->Reserved = 0;
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h
index 4120506735..3880ed55c9 100644
--- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h
+++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h
@@ -33,18 +33,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h>
#include <VariableFormat.h>
-#define VARIABLE_STORE_SIZE FixedPcdGet32(PcdVariableStoreSize)
-#define SCRATCH_SIZE FixedPcdGet32(PcdMaxVariableSize)
-
-//
-// Define GET_PAD_SIZE to optimize compiler
-//
-#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
-#define GET_PAD_SIZE(a) (0)
-#else
-#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
-#endif
-
#define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))
typedef enum {
diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.h b/MdeModulePkg/Universal/Variable/Pei/Variable.h
index fe32c113dd..7641a760d0 100644
--- a/MdeModulePkg/Universal/Variable/Pei/Variable.h
+++ b/MdeModulePkg/Universal/Variable/Pei/Variable.h
@@ -30,17 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <VariableFormat.h>
-//
-// Define GET_PAD_SIZE to optimize compiler
-//
-#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
-#define GET_PAD_SIZE(a) (0)
-#else
-#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
-#endif
-
-#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
-
typedef struct {
VARIABLE_HEADER *CurrPtr;
VARIABLE_HEADER *EndPtr;
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index f09ed23604..745021a0f3 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -1225,21 +1225,21 @@ RuntimeServiceSetVariable (
//
// The size of the VariableName, including the Unicode Null in bytes plus
- // the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)
- // bytes for HwErrRec, and MAX_VARIABLE_SIZE (1024) bytes for the others.
+ // the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
+ // bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
- if ((DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE) ||
- (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE)) {
+ if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
+ (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
return EFI_INVALID_PARAMETER;
}
} else {
//
// The size of the VariableName, including the Unicode Null in bytes plus
- // the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
+ // the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
//
- if ((DataSize > MAX_VARIABLE_SIZE) ||
- (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
+ if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
+ (sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
return EFI_INVALID_PARAMETER;
}
}
@@ -1391,7 +1391,7 @@ RuntimeServiceSetVariable (
//
NextVariable = GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
- SetMem (NextVariable, SCRATCH_SIZE, 0xff);
+ SetMem (NextVariable, FixedPcdGet32(PcdMaxVariableSize), 0xff);
NextVariable->StartId = VARIABLE_DATA;
NextVariable->Attributes = Attributes;
@@ -1690,15 +1690,15 @@ RuntimeServiceQueryVariableInfo (
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
//
- // Let *MaximumVariableSize be MAX_VARIABLE_SIZE with the exception of the variable header size.
+ // Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
//
- *MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
+ *MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
//
// Harware error record variable needs larger size.
//
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
- *MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
+ *MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
}
//
@@ -1835,13 +1835,13 @@ VariableCommonInitialize (
//
// Allocate memory for volatile variable store
//
- VolatileVariableStore = AllocateRuntimePool (VARIABLE_STORE_SIZE + SCRATCH_SIZE);
+ VolatileVariableStore = AllocateRuntimePool (FixedPcdGet32(PcdVariableStoreSize) + FixedPcdGet32(PcdMaxVariableSize));
if (VolatileVariableStore == NULL) {
FreePool (mVariableModuleGlobal);
return EFI_OUT_OF_RESOURCES;
}
- SetMem (VolatileVariableStore, VARIABLE_STORE_SIZE + SCRATCH_SIZE, 0xff);
+ SetMem (VolatileVariableStore, FixedPcdGet32(PcdVariableStoreSize) + FixedPcdGet32(PcdMaxVariableSize), 0xff);
//
// Variable Specific Data
@@ -1850,7 +1850,7 @@ VariableCommonInitialize (
mVariableModuleGlobal->VolatileLastVariableOffset = (UINTN) GetStartPointer (VolatileVariableStore) - (UINTN) VolatileVariableStore;
VolatileVariableStore->Signature = VARIABLE_STORE_SIGNATURE;
- VolatileVariableStore->Size = VARIABLE_STORE_SIZE;
+ VolatileVariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
VolatileVariableStore->Format = VARIABLE_STORE_FORMATTED;
VolatileVariableStore->State = VARIABLE_STORE_HEALTHY;
VolatileVariableStore->Reserved = 0;
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
index 320d1ec562..5682aa9c34 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
@@ -37,25 +37,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/GlobalVariable.h>
#include <VariableFormat.h>
-
-
#define VARIABLE_RECLAIM_THRESHOLD (1024)
-#define VARIABLE_STORE_SIZE FixedPcdGet32(PcdVariableStoreSize)
-#define SCRATCH_SIZE FixedPcdGet32(PcdMaxVariableSize)
-
-//
-// Define GET_PAD_SIZE to optimize compiler
-//
-#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
-#define GET_PAD_SIZE(a) (0)
-#else
-#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
-#endif
-
-#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
-
-
typedef struct {
VARIABLE_HEADER *CurrPtr;
VARIABLE_HEADER *EndPtr;