summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/Variable/RuntimeDxe
diff options
context:
space:
mode:
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-10 12:28:02 +0000
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-10 12:28:02 +0000
commit202c5d55e5a5a1f065038cda8316ad36293aa6bb (patch)
treebb5348825b30ebfd14566d2d87fc639a9e928c49 /EdkModulePkg/Universal/Variable/RuntimeDxe
parent382aab1c37276a1274e62469301ee27374cbd047 (diff)
downloadedk2-platforms-202c5d55e5a5a1f065038cda8316ad36293aa6bb.tar.xz
Modify FtwLite and Variable DXE driver to use PCD instead of FlashMap HOB
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1236 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/Variable/RuntimeDxe')
-rw-r--r--EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c38
-rw-r--r--EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.msa21
2 files changed, 29 insertions, 30 deletions
diff --git a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index cfd3183f09..3fa16172cc 100644
--- a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -1254,14 +1254,14 @@ Returns:
UINT32 Instance;
EFI_PHYSICAL_ADDRESS FvVolHdr;
- EFI_FLASH_MAP_ENTRY_DATA *FlashMapEntryData;
+ UINT64 TempVariableStoreHeader;
+
EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;
EFI_FLASH_SUBAREA_ENTRY VariableStoreEntry;
UINT64 BaseAddress;
UINT64 Length;
UINTN Index;
UINT8 Data;
- EFI_PEI_HOB_POINTERS GuidHob;
Status = gBS->AllocatePool (
EfiRuntimeServicesData,
@@ -1305,35 +1305,13 @@ Returns:
// Get non volatile varaible store
//
- FlashMapEntryData = NULL;
-
- GuidHob.Raw = GetHobList ();
- while (NULL != (GuidHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, GuidHob.Raw))) {
- FlashMapEntryData = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (GuidHob.Guid);
-
- if (FlashMapEntryData->AreaType == EFI_FLASH_AREA_EFI_VARIABLES) {
- break;
- }
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
-
- if (NULL == GuidHob.Raw || FlashMapEntryData == NULL) {
- gBS->FreePool (mVariableModuleGlobal);
- gBS->FreePool (VolatileVariableStore);
- return EFI_NOT_FOUND;
- }
-
- //
- // Currently only one non-volatile variable store is supported
- //
- if (FlashMapEntryData->NumEntries != 1) {
- gBS->FreePool (mVariableModuleGlobal);
- gBS->FreePool (VolatileVariableStore);
- return EFI_UNSUPPORTED;
- }
-
- CopyMem (&VariableStoreEntry, &FlashMapEntryData->Entries[0], sizeof (VariableStoreEntry));
+ TempVariableStoreHeader = (UINT64) PcdGet32 (PcdFlashNvStorageVariableBase);
+ VariableStoreEntry.Base = TempVariableStoreHeader + \
+ (((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);
+ VariableStoreEntry.Length = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize) - \
+ (((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);
+ VariableStoreEntry.Length = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize);
//
// Mark the variable storage region of the FLASH as RUNTIME
//
diff --git a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.msa b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.msa
index c3f538abe6..049ee3731d 100644
--- a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.msa
+++ b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.msa
@@ -31,6 +31,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>PcdLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
@@ -150,4 +153,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<SetVirtualAddressMapCallBack>VariableClassAddressChangeEvent</SetVirtualAddressMapCallBack>
</Extern>
</Externs>
+ <PcdCoded>
+ <PcdEntry PcdItemType="DYNAMIC">
+ <C_Name>PcdFlashNvStorageVariableBase</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>
+ The driver gets the Variable store base address from this PCD. This base address point to
+ an EFI_FIRMWARE_VOLUMN_HEADER struct.
+ </HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="DYNAMIC">
+ <C_Name>PcdFlashNvStorageVariableSize</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>
+ The driver gets the Variable store base address from this PCD. This base address point to
+ an EFI_FIRMWARE_VOLUMN_HEADER struct.
+ </HelpText>
+ </PcdEntry>
+ </PcdCoded>
</ModuleSurfaceArea> \ No newline at end of file