mirror of https://github.com/acidanthera/audk.git
Use Hob to get the variable base address in NV storage, but this need to be changed as use PCD when build tool is ready
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3111 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
361064ffae
commit
911cad134a
|
@ -43,6 +43,8 @@
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
#include <Library/HobLib.h>
|
||||||
|
#include <Common/FlashMap.h>
|
||||||
|
#include <Guid/FlashMapHob.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1299,13 +1299,15 @@ Returns:
|
||||||
EFI_PHYSICAL_ADDRESS FvVolHdr;
|
EFI_PHYSICAL_ADDRESS FvVolHdr;
|
||||||
|
|
||||||
UINT64 TempVariableStoreHeader;
|
UINT64 TempVariableStoreHeader;
|
||||||
|
UINT64 TempVariableStoreLen;
|
||||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;
|
EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;
|
||||||
EFI_FLASH_SUBAREA_ENTRY VariableStoreEntry;
|
EFI_FLASH_SUBAREA_ENTRY VariableStoreEntry;
|
||||||
UINT64 BaseAddress;
|
UINT64 BaseAddress;
|
||||||
UINT64 Length;
|
UINT64 Length;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINT8 Data;
|
UINT8 Data;
|
||||||
|
EFI_PEI_HOB_POINTERS FvHob;
|
||||||
|
EFI_FLASH_MAP_ENTRY_DATA *FlashMapEntry;
|
||||||
|
|
||||||
mVariableModuleGlobal = AllocateRuntimePool (sizeof (ESAL_VARIABLE_GLOBAL));
|
mVariableModuleGlobal = AllocateRuntimePool (sizeof (ESAL_VARIABLE_GLOBAL));
|
||||||
if (mVariableModuleGlobal == NULL) {
|
if (mVariableModuleGlobal == NULL) {
|
||||||
|
@ -1341,11 +1343,29 @@ Returns:
|
||||||
//
|
//
|
||||||
// Get non volatile varaible store
|
// Get non volatile varaible store
|
||||||
//
|
//
|
||||||
|
// BUGBUG: Here should use dynamic PCD to get NvStorageVariableBase when build tools is ready.
|
||||||
|
TempVariableStoreHeader = 0;
|
||||||
|
TempVariableStoreLen = 0;
|
||||||
|
FvHob.Raw = GetHobList ();
|
||||||
|
while ((FvHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, FvHob.Raw)) != NULL) {
|
||||||
|
|
||||||
TempVariableStoreHeader = (UINT64) PcdGet32 (PcdFlashNvStorageVariableBase);
|
FlashMapEntry = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (FvHob.Guid);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get the FTW work space Flash Map SUB area
|
||||||
|
//
|
||||||
|
if ((FlashMapEntry->AreaType == EFI_FLASH_AREA_EFI_VARIABLES) && (FlashMapEntry->NumEntries == 1)) {
|
||||||
|
TempVariableStoreHeader = FlashMapEntry->Entries[0].Base;
|
||||||
|
TempVariableStoreLen = FlashMapEntry->Entries[0].Length;
|
||||||
|
}
|
||||||
|
FvHob.Raw = GET_NEXT_HOB (FvHob);
|
||||||
|
}
|
||||||
|
ASSERT ((TempVariableStoreHeader != 0) && (TempVariableStoreLen != 0));
|
||||||
|
|
||||||
|
//TempVariableStoreHeader = (UINT64) PcdGet32 (PcdFlashNvStorageVariableBase);
|
||||||
VariableStoreEntry.Base = TempVariableStoreHeader + \
|
VariableStoreEntry.Base = TempVariableStoreHeader + \
|
||||||
(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);
|
(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);
|
||||||
VariableStoreEntry.Length = (UINT64) PcdGet32 (PcdFlashNvStorageVariableSize) - \
|
VariableStoreEntry.Length = TempVariableStoreLen - \
|
||||||
(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);
|
(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (TempVariableStoreHeader)) -> HeaderLength);
|
||||||
//
|
//
|
||||||
// Mark the variable storage region of the FLASH as RUNTIME
|
// Mark the variable storage region of the FLASH as RUNTIME
|
||||||
|
|
|
@ -82,7 +82,10 @@
|
||||||
DxeServicesTableLib
|
DxeServicesTableLib
|
||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
PcdLib
|
PcdLib
|
||||||
|
HobLib
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
gEfiFlashMapHobGuid
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
|
|
|
@ -349,6 +349,7 @@
|
||||||
[Components.IA32]
|
[Components.IA32]
|
||||||
$(WORKSPACE)/Nt32Pkg/BootModePei/BootMode.inf
|
$(WORKSPACE)/Nt32Pkg/BootModePei/BootMode.inf
|
||||||
$(WORKSPACE)/Nt32Pkg/WinNtThunkDxe/WinNtThunk.inf
|
$(WORKSPACE)/Nt32Pkg/WinNtThunkDxe/WinNtThunk.inf
|
||||||
|
$(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf
|
||||||
$(WORKSPACE)/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.inf
|
$(WORKSPACE)/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.inf
|
||||||
$(WORKSPACE)/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.inf
|
$(WORKSPACE)/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.inf
|
||||||
$(WORKSPACE)/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.inf
|
$(WORKSPACE)/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.inf
|
||||||
|
@ -373,7 +374,6 @@
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf
|
$(WORKSPACE)/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/Ebc/Dxe/Ebc.inf
|
$(WORKSPACE)/MdeModulePkg/Universal/Ebc/Dxe/Ebc.inf
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.inf
|
$(WORKSPACE)/MdeModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.inf
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf
|
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
|
$(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf
|
$(WORKSPACE)/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf
|
||||||
$(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf
|
$(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf
|
||||||
|
|
|
@ -111,6 +111,7 @@ READ_LOCK_STATUS = TRUE
|
||||||
################################################################################
|
################################################################################
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Core/Pei/PeiMain.inf
|
INF $(WORKSPACE)/MdeModulePkg/Core/Pei/PeiMain.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Core/Dxe/DxeMain.inf
|
INF $(WORKSPACE)/MdeModulePkg/Core/Dxe/DxeMain.inf
|
||||||
|
INF $(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf
|
||||||
INF $(WORKSPACE)/Nt32Pkg/BootModePei/BootMode.inf
|
INF $(WORKSPACE)/Nt32Pkg/BootModePei/BootMode.inf
|
||||||
INF $(WORKSPACE)/Nt32Pkg/WinNtThunkDxe/WinNtThunk.inf
|
INF $(WORKSPACE)/Nt32Pkg/WinNtThunkDxe/WinNtThunk.inf
|
||||||
#INF $(WORKSPACE)/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.inf
|
#INF $(WORKSPACE)/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.inf
|
||||||
|
@ -137,7 +138,6 @@ INF $(WORKSPACE)/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf
|
INF $(WORKSPACE)/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/Ebc/Dxe/Ebc.inf
|
INF $(WORKSPACE)/MdeModulePkg/Universal/Ebc/Dxe/Ebc.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.inf
|
INF $(WORKSPACE)/MdeModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf
|
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
|
INF $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf
|
INF $(WORKSPACE)/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf
|
||||||
INF $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf
|
INF $(WORKSPACE)/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf
|
||||||
|
|
Loading…
Reference in New Issue