From 3709c4cd5bc3956fee59f31bdd1b7dc5b61a039a Mon Sep 17 00:00:00 2001 From: eric_tian Date: Fri, 27 Feb 2009 05:35:08 +0000 Subject: [PATCH] =?utf8?q?1.=20delete=20Include/Guid/VariableInfo.h=202.?= =?utf8?q?=20move=20VariableFormat.h=20into=20GUID=20directory=20and=20cha?= =?utf8?q?nge=20the=20=E2=80=9CSignature=E2=80=9D=20field=20of=20the=20VAR?= =?utf8?q?IABLE=5FSTORE=5FHEADER=20to=20gEfiVariableGuid=20value.=203.=20m?= =?utf8?q?erging=20VARIABLE=5FINFO=5FENTRY=20structure=20into=20the=20new?= =?utf8?q?=20Include/Guid/VariableFormat.h=204.=20change=20gEfiVariableInf?= =?utf8?q?oGuid=20into=20gEfiVariableGuid.=205.=20modify=20FDF=20files=20t?= =?utf8?q?o=20use=20new=20guid=20value=20instead=20of=20the=20original=20s?= =?utf8?q?ignature.=206.=20all=20code=20related=20to=20signature=20is=20ch?= =?utf8?q?anged=20to=20use=20guid=20value.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7728 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/DxeIpl/DxeIpl.h | 2 +- DuetPkg/DxeIpl/DxeIpl.inf | 3 ++ DuetPkg/DxeIpl/HobGeneration.c | 2 +- DuetPkg/FSVariable/FSVariable.c | 15 ++++--- DuetPkg/FSVariable/FSVariable.h | 2 +- DuetPkg/FSVariable/FSVariable.inf | 1 + DuetPkg/FSVariable/FileStorage.c | 2 +- DuetPkg/FSVariable/MemStorage.c | 2 +- DuetPkg/FSVariable/VariableStorage.h | 3 +- .../Universal/VariablePei/Variable.c | 8 +++- .../Universal/VariablePei/Variable.h | 2 +- .../Universal/VariablePei/VariablePei.inf | 3 ++ .../Application/VariableInfo/VariableInfo.c | 4 +- .../Application/VariableInfo/VariableInfo.inf | 2 +- .../Include/{ => Guid}/VariableFormat.h | 31 +++++++++++-- MdeModulePkg/Include/Guid/VariableInfo.h | 44 ------------------- .../Library/DxePlatDriOverLib/PlatDriOver.h | 2 +- MdeModulePkg/MdeModulePkg.dec | 6 +-- .../Variable/EmuRuntimeDxe/EmuVariable.c | 2 +- .../EmuRuntimeDxe/EmuVariableRuntimeDxe.inf | 1 + .../Variable/EmuRuntimeDxe/Variable.h | 2 +- .../Universal/Variable/Pei/Variable.c | 8 +++- .../Universal/Variable/Pei/Variable.h | 2 +- .../Universal/Variable/Pei/VariablePei.inf | 3 ++ .../Universal/Variable/RuntimeDxe/Variable.c | 17 ++++--- .../Universal/Variable/RuntimeDxe/Variable.h | 3 +- .../RuntimeDxe/VariableRuntimeDxe.inf | 2 +- Nt32Pkg/Nt32Pkg.fdf | 21 +++++++-- UnixPkg/UnixPkg.fdf | 10 +++-- 29 files changed, 115 insertions(+), 90 deletions(-) rename MdeModulePkg/Include/{ => Guid}/VariableFormat.h (68%) delete mode 100644 MdeModulePkg/Include/Guid/VariableInfo.h diff --git a/DuetPkg/DxeIpl/DxeIpl.h b/DuetPkg/DxeIpl/DxeIpl.h index c8c67948a2..8b6e9a8c8a 100644 --- a/DuetPkg/DxeIpl/DxeIpl.h +++ b/DuetPkg/DxeIpl/DxeIpl.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,6 @@ #include #include -#include #include #endif // _DUET_DXEIPL_H_ diff --git a/DuetPkg/DxeIpl/DxeIpl.inf b/DuetPkg/DxeIpl/DxeIpl.inf index 6a2ba5de15..826aee15b8 100644 --- a/DuetPkg/DxeIpl/DxeIpl.inf +++ b/DuetPkg/DxeIpl/DxeIpl.inf @@ -39,6 +39,9 @@ ReportStatusCodeLib IoLib +[Guids] + gEfiVariableGuid + [Sources.common] DxeIpl.h DxeInit.c diff --git a/DuetPkg/DxeIpl/HobGeneration.c b/DuetPkg/DxeIpl/HobGeneration.c index 0b215eba3a..93bf2891a5 100644 --- a/DuetPkg/DxeIpl/HobGeneration.c +++ b/DuetPkg/DxeIpl/HobGeneration.c @@ -738,7 +738,7 @@ PrepareHobNvStorage ( */ { STATIC VARIABLE_STORE_HEADER VarStoreHeader = { - VARIABLE_STORE_SIGNATURE, + gEfiVariableGuid, 0xffffffff, // will be fixed in Variable driver VARIABLE_STORE_FORMATTED, VARIABLE_STORE_HEALTHY, diff --git a/DuetPkg/FSVariable/FSVariable.c b/DuetPkg/FSVariable/FSVariable.c index 18b93c08cc..d20b3a78e3 100644 --- a/DuetPkg/FSVariable/FSVariable.c +++ b/DuetPkg/FSVariable/FSVariable.c @@ -22,7 +22,7 @@ Abstract: #include "FSVariable.h" VARIABLE_STORE_HEADER mStoreHeaderTemplate = { - VARIABLE_STORE_SIGNATURE, + gEfiVariableGuid, VOLATILE_VARIABLE_STORE_SIZE, VARIABLE_STORE_FORMATTED, VARIABLE_STORE_HEALTHY, @@ -100,15 +100,18 @@ Returns: --*/ { - if ((VarStoreHeader->Signature == mStoreHeaderTemplate.Signature) && + if (CompareGuid (&VarStoreHeader->Signature, &mStoreHeaderTemplate.Signature) && (VarStoreHeader->Format == mStoreHeaderTemplate.Format) && (VarStoreHeader->State == mStoreHeaderTemplate.State) ) { return EfiValid; - } else if (VarStoreHeader->Signature == VAR_DEFAULT_VALUE_32 && - VarStoreHeader->Size == VAR_DEFAULT_VALUE_32 && - VarStoreHeader->Format == VAR_DEFAULT_VALUE && - VarStoreHeader->State == VAR_DEFAULT_VALUE + } else if (((UINT32 *)(&VarStoreHeader->Signature))[0] == VAR_DEFAULT_VALUE_32 && + ((UINT32 *)(&VarStoreHeader->Signature))[1] == VAR_DEFAULT_VALUE_32 && + ((UINT32 *)(&VarStoreHeader->Signature))[2] == VAR_DEFAULT_VALUE_32 && + ((UINT32 *)(&VarStoreHeader->Signature))[3] == VAR_DEFAULT_VALUE_32 && + VarStoreHeader->Size == VAR_DEFAULT_VALUE_32 && + VarStoreHeader->Format == VAR_DEFAULT_VALUE && + VarStoreHeader->State == VAR_DEFAULT_VALUE ) { return EfiRaw; diff --git a/DuetPkg/FSVariable/FSVariable.h b/DuetPkg/FSVariable/FSVariable.h index 9fdd0a77fd..6da525cbf6 100644 --- a/DuetPkg/FSVariable/FSVariable.h +++ b/DuetPkg/FSVariable/FSVariable.h @@ -38,6 +38,7 @@ Abstract: #include #include +#include #include #include @@ -46,7 +47,6 @@ Abstract: #include "EfiFlashMap.h" -#include "VariableFormat.h" #include "VariableStorage.h" #define VOLATILE_VARIABLE_STORE_SIZE (64 * 1024) diff --git a/DuetPkg/FSVariable/FSVariable.inf b/DuetPkg/FSVariable/FSVariable.inf index 52a805d036..c2a8c84b52 100644 --- a/DuetPkg/FSVariable/FSVariable.inf +++ b/DuetPkg/FSVariable/FSVariable.inf @@ -57,6 +57,7 @@ [Guids] gEfiHobListGuid gEfiFlashMapHobGuid + gEfiVariableGuid [Protocols] gEfiVariableArchProtocolGuid diff --git a/DuetPkg/FSVariable/FileStorage.c b/DuetPkg/FSVariable/FileStorage.c index df11ae16b8..0c25efa8c3 100644 --- a/DuetPkg/FSVariable/FileStorage.c +++ b/DuetPkg/FSVariable/FileStorage.c @@ -247,7 +247,7 @@ FileStorageConstructor ( ASSERT_EFI_ERROR (Status); ZeroMem (Dev, sizeof(VS_DEV)); - Dev->Signature = VARIABLE_STORE_SIGNATURE; + CopyGuid (&Dev->Signature, &gEfiVariableGuid); Dev->Size = Size; VAR_DATA_PTR (Dev) = (UINT8 *) (UINTN) NvStorageBase; VAR_FILE_VOLUMEID (Dev) = VolumeId; diff --git a/DuetPkg/FSVariable/MemStorage.c b/DuetPkg/FSVariable/MemStorage.c index cb8c864fce..02582d953a 100644 --- a/DuetPkg/FSVariable/MemStorage.c +++ b/DuetPkg/FSVariable/MemStorage.c @@ -59,7 +59,7 @@ MemStorageConstructor ( ZeroMem (Dev, sizeof(VS_DEV)); - Dev->Signature = VARIABLE_STORE_SIGNATURE; + CopyGuid (&Dev->Signature, &gEfiVariableGuid); Dev->Size = Size; Dev->VarStore.Erase = MemEraseStore; diff --git a/DuetPkg/FSVariable/VariableStorage.h b/DuetPkg/FSVariable/VariableStorage.h index 2c4a3f9808..d5423bb01a 100644 --- a/DuetPkg/FSVariable/VariableStorage.h +++ b/DuetPkg/FSVariable/VariableStorage.h @@ -100,7 +100,8 @@ typedef struct _VS_DEV { } VS_DEV; -#define DEV_FROM_THIS(a) CR (a, VS_DEV, VarStore, VARIABLE_STORE_SIGNATURE) +#define VS_DEV_SIGNATURE SIGNATURE_32 ('$', 'V', 'S', 'D') +#define DEV_FROM_THIS(a) CR (a, VS_DEV, VarStore, VS_DEV_SIGNATURE) #define VAR_DATA_PTR(a) ((a)->Info.Data) #define VAR_FILE_DEVICEPATH(a) ((a)->Info.FileInfo.DevicePath) diff --git a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c index d5881f5ce8..aa43ae1512 100644 --- a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c +++ b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.c @@ -277,7 +277,8 @@ GetVariableStoreStatus ( ) { - if (VarStoreHeader->Signature == VARIABLE_STORE_SIGNATURE && + + if (CompareGuid (&VarStoreHeader->Signature, &gEfiVariableGuid) && VarStoreHeader->Format == VARIABLE_STORE_FORMATTED && VarStoreHeader->State == VARIABLE_STORE_HEALTHY ) { @@ -285,7 +286,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/IntelFrameworkModulePkg/Universal/VariablePei/Variable.h b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.h index 73cb491ddc..31c855d27b 100644 --- a/IntelFrameworkModulePkg/Universal/VariablePei/Variable.h +++ b/IntelFrameworkModulePkg/Universal/VariablePei/Variable.h @@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include +#include typedef struct { VARIABLE_HEADER *CurrPtr; diff --git a/IntelFrameworkModulePkg/Universal/VariablePei/VariablePei.inf b/IntelFrameworkModulePkg/Universal/VariablePei/VariablePei.inf index 48e9efc4ab..a83c3102ce 100644 --- a/IntelFrameworkModulePkg/Universal/VariablePei/VariablePei.inf +++ b/IntelFrameworkModulePkg/Universal/VariablePei/VariablePei.inf @@ -99,6 +99,9 @@ gEfiPeiReadOnlyVariablePpiGuid # PPI ALWAYS_PRODUCED gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_PRODUCED +[Guids] + gEfiVariableGuid + ################################################################################ # # Pcd DYNAMIC - list of PCDs that this module is coded for. 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 #include #include -#include +#include /** @@ -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 similarity index 68% rename from MdeModulePkg/Include/VariableFormat.h rename to 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 #include -#include +#include #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 #include #include -#include +#include #include 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 #include -#include +#include 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 #include #include -#include #include #include -#include +#include #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 diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf index 044211651f..41563deea9 100644 --- a/Nt32Pkg/Nt32Pkg.fdf +++ b/Nt32Pkg/Nt32Pkg.fdf @@ -73,9 +73,13 @@ DATA = { #Blockmap[1]: End 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ## This is the VARIABLE_STORE_HEADER - #Signature: "$VSS" #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (HeaderLength) = 0xBFB8 - # This can speed up the Variable Dispatch a bit. - 0x24, 0x56, 0x53, 0x53, 0xB8, 0xBF, 0x00, 0x00, + #Signature: gEfiVariableGuid = + # { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xBF, 0x00, 0x00, #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } @@ -216,6 +220,17 @@ INF Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf INF MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf INF MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf +INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf +INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf +INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf +INF MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf +INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf +INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf +INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf +INF MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf +INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf +INF Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf +INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf ################################################################################ # # FILE statements are provided so that a platform integrator can include diff --git a/UnixPkg/UnixPkg.fdf b/UnixPkg/UnixPkg.fdf index 956895697a..b54537cfc3 100644 --- a/UnixPkg/UnixPkg.fdf +++ b/UnixPkg/UnixPkg.fdf @@ -73,9 +73,13 @@ DATA = { # Blockmap[1]: End 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ## This is the VARIABLE_STORE_HEADER - #Signature: "$VSS" #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (HeaderLength) = 0xBFB8 - # This can speed up the Variable Dispatch a bit. - 0x24, 0x56, 0x53, 0x53, 0xB8, 0xBF, 0x00, 0x00, + #Signature: gEfiVariableGuid = + # { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xBF, 0x00, 0x00, #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } -- 2.39.2