diff options
Diffstat (limited to 'MdeModulePkg')
15 files changed, 60 insertions, 69 deletions
diff --git a/MdeModulePkg/Application/VariableInfo/VariableInfo.c b/MdeModulePkg/Application/VariableInfo/VariableInfo.c index 86117a63d1..ba4f553f49 100644 --- a/MdeModulePkg/Application/VariableInfo/VariableInfo.c +++ b/MdeModulePkg/Application/VariableInfo/VariableInfo.c @@ -18,7 +18,7 @@ #include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
-#include <Guid/VariableInfo.h>
+#include <Guid/VariableFormat.h>
/**
@@ -45,7 +45,7 @@ UefiMain ( VARIABLE_INFO_ENTRY *VariableInfo;
VARIABLE_INFO_ENTRY *Entry;
- Status = EfiGetSystemConfigurationTable (&gEfiVariableInfoGuid, (VOID **)&Entry);
+ Status = EfiGetSystemConfigurationTable (&gEfiVariableGuid, (VOID **)&Entry);
if (!EFI_ERROR (Status) && (Entry != NULL)) {
Print (L"Non-Volatile EFI Variables:\n");
VariableInfo = Entry;
diff --git a/MdeModulePkg/Application/VariableInfo/VariableInfo.inf b/MdeModulePkg/Application/VariableInfo/VariableInfo.inf index 46e35bd1d1..f963db5719 100644 --- a/MdeModulePkg/Application/VariableInfo/VariableInfo.inf +++ b/MdeModulePkg/Application/VariableInfo/VariableInfo.inf @@ -42,4 +42,4 @@ UefiLib
[Guids]
- gEfiVariableInfoGuid ## CONSUMES ## Configuration Table Guid
+ gEfiVariableGuid ## CONSUMES ## Configuration Table Guid
diff --git a/MdeModulePkg/Include/VariableFormat.h b/MdeModulePkg/Include/Guid/VariableFormat.h index 40bd461286..b5491e43dc 100644 --- a/MdeModulePkg/Include/VariableFormat.h +++ b/MdeModulePkg/Include/Guid/VariableFormat.h @@ -16,6 +16,11 @@ #ifndef __VARIABLE_FORMAT_H__
#define __VARIABLE_FORMAT_H__
+#define EFI_VARIABLE_GUID \
+ { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d } }
+
+extern EFI_GUID gEfiVariableGuid;
+
///
/// Alignment of variable name and data.
/// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture.
@@ -53,7 +58,7 @@ typedef enum { #pragma pack(1)
-#define VARIABLE_STORE_SIGNATURE SIGNATURE_32 ('$', 'V', 'S', 'S')
+#define VARIABLE_STORE_SIGNATURE EFI_VARIABLE_GUID
///
/// Variable Store Header Format and State
@@ -68,9 +73,10 @@ typedef struct { ///
/// Variable store region signature.
///
- UINT32 Signature;
+ EFI_GUID Signature;
///
- /// Size of variable store region including this header
+ /// Size of entire variable store,
+ /// including size of variable store header but not including the size of FvHeader.
///
UINT32 Size;
///
@@ -131,4 +137,23 @@ typedef struct { #pragma pack()
+typedef struct _VARIABLE_INFO_ENTRY VARIABLE_INFO_ENTRY;
+
+///
+/// This structure contains the variable list that is put in EFI system table.
+/// The variable driver collects all used variables at boot service time and produce this list.
+/// This is an optional feature to dump all used variables in shell environment.
+///
+struct _VARIABLE_INFO_ENTRY {
+ VARIABLE_INFO_ENTRY *Next; ///> Pointer to next entry
+ EFI_GUID VendorGuid; ///> Guid of Variable
+ CHAR16 *Name; ///> Name of Variable
+ UINT32 Attributes; ///> Attributes of variable defined in UEFI spec
+ UINT32 ReadCount; ///> Times to read this variable
+ UINT32 WriteCount; ///> Times to write this variable
+ UINT32 DeleteCount; ///> Times to delete this variable
+ UINT32 CacheCount; ///> Times that cache hits this variable
+ BOOLEAN Volatile; ///> TRUE if volatile FALSE if non-volatile
+};
+
#endif // _EFI_VARIABLE_H_
diff --git a/MdeModulePkg/Include/Guid/VariableInfo.h b/MdeModulePkg/Include/Guid/VariableInfo.h deleted file mode 100644 index 27a4dafea0..0000000000 --- a/MdeModulePkg/Include/Guid/VariableInfo.h +++ /dev/null @@ -1,44 +0,0 @@ -/** @file
- This file defines variable info guid and variable info entry.
- This guid is used to specify the variable list put in the EFI system table.
-
-Copyright (c) 2006 - 2009, 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.
-
-**/
-
-#ifndef __VARIABLE_INFO_GUID_H__
-#define __VARIABLE_INFO_GUID_H__
-
-#define EFI_VARIABLE_INFO_GUID \
- { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d } }
-
-extern EFI_GUID gEfiVariableInfoGuid;
-
-
-typedef struct _VARIABLE_INFO_ENTRY VARIABLE_INFO_ENTRY;
-
-///
-/// This structure contains the variable list that is put in EFI system table.
-/// The variable driver collects all used variables at boot service time and produce this list.
-/// This is an optional feature to dump all used variables in shell environment.
-///
-struct _VARIABLE_INFO_ENTRY {
- VARIABLE_INFO_ENTRY *Next; ///> Pointer to next entry
- EFI_GUID VendorGuid; ///> Guid of Variable
- CHAR16 *Name; ///> Name of Variable
- UINT32 Attributes; ///> Attributes of variable defined in UEFI spec
- UINT32 ReadCount; ///> Times to read this variable
- UINT32 WriteCount; ///> Times to write this variable
- UINT32 DeleteCount; ///> Times to delete this variable
- UINT32 CacheCount; ///> Times that cache hits this variable
- BOOLEAN Volatile; ///> TRUE if volatile FALSE if non-volatile
-};
-
-#endif
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h index 1efb4937a7..7cede71388 100644 --- a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h +++ b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h @@ -36,7 +36,7 @@ #include <Library/PlatformDriverOverrideLib.h>
#include <Guid/OverrideVariable.h>
-#include <VariableFormat.h>
+#include <Guid/VariableFormat.h>
#define PLATFORM_OVERRIDE_ITEM_SIGNATURE SIGNATURE_32('p','d','o','i')
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 86754adec4..871611cf57 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -153,9 +153,9 @@ ## Include/Guid/PeiPeCoffLoader.h
gEfiPeiPeCoffLoaderGuid = { 0xD8117CFF, 0x94A6, 0x11D4, { 0x9A, 0x3A, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}
- ## Guid specify the variable list entries put in the EFI system table.
- ## Include/Guid/VariableInfo.h
- gEfiVariableInfoGuid = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
+ ## Guid acted as variable store header's signature and to specify the variable list entries put in the EFI system table.
+ ## Include/Guid/VariableFormat.h
+ gEfiVariableGuid = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
## Platform Override Variable guid
## Include/Guid/OverrideVariable.h
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c index 76f9f09260..1fdf25de27 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c @@ -822,7 +822,7 @@ InitializeVariableStore ( *VariableBase = (EFI_PHYSICAL_ADDRESS) (UINTN) VariableStore;
*LastVariableOffset = sizeof (VARIABLE_STORE_HEADER);
- VariableStore->Signature = VARIABLE_STORE_SIGNATURE;
+ CopyGuid (&VariableStore->Signature, &gEfiVariableGuid);
VariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
VariableStore->Format = VARIABLE_STORE_FORMATTED;
VariableStore->State = VARIABLE_STORE_HEALTHY;
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf index 12cbbc929a..5e25d1efae 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf @@ -56,6 +56,7 @@ [Guids]
gEfiEventVirtualAddressChangeGuid ## PRODUCES ## Event
+ gEfiVariableGuid
[Pcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h index 482a192a38..a3fc9d1eeb 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h @@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/PcdLib.h>
-#include <VariableFormat.h>
+#include <Guid/VariableFormat.h>
#include <Guid/EventGroup.h>
diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c index f98d236443..7f4b4f68d7 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -268,7 +268,8 @@ GetVariableStoreStatus ( IN VARIABLE_STORE_HEADER *VarStoreHeader
)
{
- if (VarStoreHeader->Signature == VARIABLE_STORE_SIGNATURE &&
+
+ if (CompareGuid (&VarStoreHeader->Signature, &gEfiVariableGuid) &&
VarStoreHeader->Format == VARIABLE_STORE_FORMATTED &&
VarStoreHeader->State == VARIABLE_STORE_HEALTHY
) {
@@ -276,7 +277,10 @@ GetVariableStoreStatus ( return EfiValid;
}
- if (VarStoreHeader->Signature == 0xffffffff &&
+ if (((UINT32 *)(&VarStoreHeader->Signature))[0] == 0xffffffff &&
+ ((UINT32 *)(&VarStoreHeader->Signature))[1] == 0xffffffff &&
+ ((UINT32 *)(&VarStoreHeader->Signature))[2] == 0xffffffff &&
+ ((UINT32 *)(&VarStoreHeader->Signature))[3] == 0xffffffff &&
VarStoreHeader->Size == 0xffffffff &&
VarStoreHeader->Format == 0xff &&
VarStoreHeader->State == 0xff
diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.h b/MdeModulePkg/Universal/Variable/Pei/Variable.h index 7641a760d0..7cee1f08b5 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.h +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.h @@ -28,7 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/PeiServicesTablePointerLib.h>
#include <Library/PeiServicesLib.h>
-#include <VariableFormat.h>
+#include <Guid/VariableFormat.h>
typedef struct {
VARIABLE_HEADER *CurrPtr;
diff --git a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf index 46e29b2cca..2e5580bde6 100644 --- a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +++ b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf @@ -57,6 +57,9 @@ PeiServicesTablePointerLib
PeiServicesLib
+[Guids]
+ gEfiVariableGuid
+
[Ppis]
gEfiPeiReadOnlyVariable2PpiGuid ## SOMETIMES_PRODUCES (Not for boot mode RECOVERY)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 0d03376359..d25fe038aa 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -137,7 +137,7 @@ UpdateVariableInfo ( StrCpy (gVariableInfo->Name, VariableName);
gVariableInfo->Volatile = Volatile;
- gBS->InstallConfigurationTable (&gEfiVariableInfoGuid, gVariableInfo);
+ gBS->InstallConfigurationTable (&gEfiVariableGuid, gVariableInfo);
}
@@ -362,16 +362,19 @@ GetVariableStoreStatus ( IN VARIABLE_STORE_HEADER *VarStoreHeader
)
{
- if (VarStoreHeader->Signature == VARIABLE_STORE_SIGNATURE &&
+ if (CompareGuid (&VarStoreHeader->Signature, &gEfiVariableGuid) &&
VarStoreHeader->Format == VARIABLE_STORE_FORMATTED &&
VarStoreHeader->State == VARIABLE_STORE_HEALTHY
) {
return EfiValid;
- } else if (VarStoreHeader->Signature == 0xffffffff &&
- VarStoreHeader->Size == 0xffffffff &&
- VarStoreHeader->Format == 0xff &&
- VarStoreHeader->State == 0xff
+ } else if (((UINT32 *)(&VarStoreHeader->Signature))[0] == 0xffffffff &&
+ ((UINT32 *)(&VarStoreHeader->Signature))[1] == 0xffffffff &&
+ ((UINT32 *)(&VarStoreHeader->Signature))[2] == 0xffffffff &&
+ ((UINT32 *)(&VarStoreHeader->Signature))[3] == 0xffffffff &&
+ VarStoreHeader->Size == 0xffffffff &&
+ VarStoreHeader->Format == 0xff &&
+ VarStoreHeader->State == 0xff
) {
return EfiRaw;
@@ -1849,7 +1852,7 @@ VariableCommonInitialize ( mVariableModuleGlobal->VariableGlobal.VolatileVariableBase = (EFI_PHYSICAL_ADDRESS) (UINTN) VolatileVariableStore;
mVariableModuleGlobal->VolatileLastVariableOffset = (UINTN) GetStartPointer (VolatileVariableStore) - (UINTN) VolatileVariableStore;
- VolatileVariableStore->Signature = VARIABLE_STORE_SIGNATURE;
+ CopyGuid (&VolatileVariableStore->Signature, &gEfiVariableGuid);
VolatileVariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
VolatileVariableStore->Format = VARIABLE_STORE_FORMATTED;
VolatileVariableStore->State = VARIABLE_STORE_HEALTHY;
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h index ec35a7dfcf..4e861dccbc 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h @@ -34,10 +34,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/BaseLib.h>
#include <Library/SynchronizationLib.h>
#include <Library/MemoryAllocationLib.h>
-#include <Guid/VariableInfo.h>
#include <Guid/GlobalVariable.h>
#include <Guid/EventGroup.h>
-#include <VariableFormat.h>
+#include <Guid/VariableFormat.h>
#define VARIABLE_RECLAIM_THRESHOLD (1024)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf index c7ba49b11f..44063224a7 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf @@ -60,7 +60,7 @@ gEfiVariableArchProtocolGuid ## ALWAYS_PRODUCES
[Guids]
- gEfiVariableInfoGuid ## PRODUCES ## Configuration Table Guid
+ gEfiVariableGuid ## PRODUCES ## Configuration Table Guid
gEfiGlobalVariableGuid ## PRODUCES ## Variable Guid
gEfiEventVirtualAddressChangeGuid ## PRODUCES ## Event
|