diff options
Diffstat (limited to 'DuetPkg/FSVariable')
-rw-r--r-- | DuetPkg/FSVariable/FSVariable.c | 15 | ||||
-rw-r--r-- | DuetPkg/FSVariable/FSVariable.h | 2 | ||||
-rw-r--r-- | DuetPkg/FSVariable/FSVariable.inf | 1 | ||||
-rw-r--r-- | DuetPkg/FSVariable/FileStorage.c | 2 | ||||
-rw-r--r-- | DuetPkg/FSVariable/MemStorage.c | 2 | ||||
-rw-r--r-- | DuetPkg/FSVariable/VariableStorage.h | 3 |
6 files changed, 15 insertions, 10 deletions
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 <Guid/HobList.h>
#include <Guid/FlashMapHob.h>
+#include <Guid/VariableFormat.h>
#include <Protocol/Variable.h>
#include <Protocol/VariableWrite.h>
@@ -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)
|