diff options
-rw-r--r-- | EdkModulePkg/EdkModulePkg.fpd | 38 | ||||
-rw-r--r-- | EdkModulePkg/EdkModulePkg.spd | 8 | ||||
-rw-r--r-- | EdkModulePkg/Universal/Variable/Pei/Variable.c | 44 | ||||
-rw-r--r-- | EdkModulePkg/Universal/Variable/Pei/Variable.msa | 15 | ||||
-rw-r--r-- | EdkNt32Pkg/Nt32.fpd | 11 |
5 files changed, 74 insertions, 42 deletions
diff --git a/EdkModulePkg/EdkModulePkg.fpd b/EdkModulePkg/EdkModulePkg.fpd index 1866bd7..6483cb9 100644 --- a/EdkModulePkg/EdkModulePkg.fpd +++ b/EdkModulePkg/EdkModulePkg.fpd @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials @@ -1709,9 +1709,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <Instance ModuleGuid="1c747f6b-0a58-49ae-8ea3-0327a4fa10e3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="9643128f-ac24-4b3e-b6be-d8849a306153" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="fa177ff7-1fc7-458d-a358-d9d62ae61cec" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> </Libraries> <PcdBuildDefinition> <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdFlashNvStorageVariableBase</C_Name> + <Token>0x30000001</Token> + <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x0</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> <C_Name>PcdMaximumUnicodeStringLength</C_Name> <Token>0x00000001</Token> <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> @@ -6090,9 +6099,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <Instance ModuleGuid="1c747f6b-0a58-49ae-8ea3-0327a4fa10e3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="9643128f-ac24-4b3e-b6be-d8849a306153" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="fa177ff7-1fc7-458d-a358-d9d62ae61cec" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> </Libraries> <PcdBuildDefinition> <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdFlashNvStorageVariableBase</C_Name> + <Token>0x30000001</Token> + <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x0</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> <C_Name>PcdMaximumUnicodeStringLength</C_Name> <Token>0x00000001</Token> <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> @@ -10020,9 +10038,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <Instance ModuleGuid="1c747f6b-0a58-49ae-8ea3-0327a4fa10e3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="9643128f-ac24-4b3e-b6be-d8849a306153" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="fa177ff7-1fc7-458d-a358-d9d62ae61cec" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> </Libraries> <PcdBuildDefinition> <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdFlashNvStorageVariableBase</C_Name> + <Token>0x30000001</Token> + <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x0</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> <C_Name>PcdMaximumUnicodeStringLength</C_Name> <Token>0x00000001</Token> <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> @@ -13612,9 +13639,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <Instance ModuleGuid="1c747f6b-0a58-49ae-8ea3-0327a4fa10e3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="9643128f-ac24-4b3e-b6be-d8849a306153" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="fa177ff7-1fc7-458d-a358-d9d62ae61cec" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> </Libraries> <PcdBuildDefinition> <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdFlashNvStorageVariableBase</C_Name> + <Token>0x30000001</Token> + <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x0</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> <C_Name>PcdMaximumUnicodeStringLength</C_Name> <Token>0x00000001</Token> <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> diff --git a/EdkModulePkg/EdkModulePkg.spd b/EdkModulePkg/EdkModulePkg.spd index 6d8b4cd..883df18 100644 --- a/EdkModulePkg/EdkModulePkg.spd +++ b/EdkModulePkg/EdkModulePkg.spd @@ -458,6 +458,14 @@ <IncludePkgHeader ModuleType="USER_DEFINED">Include/EdkPeim.h</IncludePkgHeader>
</PackageHeaders>
<GuidDeclarations>
+ <Entry Name="GenericPlatformTokenSpace">
+ <C_Name>gEfiGenericPlatformTokenSpaceGuid</C_Name>
+ <GuidValue>18D15EA6-9E14-40a1-B39C-59C44DA9D891</GuidValue>
+ <HelpText>
+ This is the token space GUID for platform generic PCD definitions.
+ Now FlashLayout and Platform CPU belong to this space.
+ </HelpText>
+ </Entry>
<Entry Name="EdkModulePkgTokenSpace">
<C_Name>gEfiEdkModulePkgTokenSpaceGuid</C_Name>
<GuidValue>8CC4092F-F60E-46d1-B41C-1E761DF50582</GuidValue>
diff --git a/EdkModulePkg/Universal/Variable/Pei/Variable.c b/EdkModulePkg/Universal/Variable/Pei/Variable.c index 9561ad1..f10a96b 100644 --- a/EdkModulePkg/Universal/Variable/Pei/Variable.c +++ b/EdkModulePkg/Universal/Variable/Pei/Variable.c @@ -245,18 +245,13 @@ Returns: --*/
{
- PEI_FLASH_MAP_PPI *FlashMapPpi;
- EFI_FLASH_SUBAREA_ENTRY *VariableStoreEntry;
- UINT32 NumEntries;
EFI_HOB_GUID_TYPE *GuidHob;
VARIABLE_STORE_HEADER *VariableStoreHeader;
VARIABLE_HEADER *Variable;
-
- EFI_STATUS Status;
-
VARIABLE_HEADER *MaxIndex;
VARIABLE_INDEX_TABLE *IndexTable;
UINT32 Count;
+ UINT8 *VariableBase;
if (VariableName != 0 && VendorGuid == NULL) {
return EFI_INVALID_PARAMETER;
@@ -305,39 +300,10 @@ Returns: if (IndexTable->StartPtr || IndexTable->EndPtr) {
Variable = IndexTable->StartPtr;
} else {
- //
- // Locate FlashMap PPI
- //
- Status = (**PeiServices).LocatePpi (
- PeiServices,
- &gPeiFlashMapPpiGuid,
- 0,
- NULL,
- (VOID **) &FlashMapPpi
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Get flash area info for variables
- //
- Status = FlashMapPpi->GetAreaInfo (
- PeiServices,
- FlashMapPpi,
- EFI_FLASH_AREA_EFI_VARIABLES,
- NULL,
- &NumEntries,
- &VariableStoreEntry
- );
-
- //
- // Currently only one non-volatile variable store is supported
- //
- if (NumEntries != 1) {
- return EFI_UNSUPPORTED;
- }
-
- VariableStoreHeader = (VARIABLE_STORE_HEADER *) (UINTN) (VariableStoreEntry->Base);
-
+ VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);
+ VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \
+ ((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);
+
if (GetVariableStoreStatus (VariableStoreHeader) != EfiValid) {
return EFI_UNSUPPORTED;
}
diff --git a/EdkModulePkg/Universal/Variable/Pei/Variable.msa b/EdkModulePkg/Universal/Variable/Pei/Variable.msa index f8cf68b..5fa1028 100644 --- a/EdkModulePkg/Universal/Variable/Pei/Variable.msa +++ b/EdkModulePkg/Universal/Variable/Pei/Variable.msa @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2006, 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 @@ -45,6 +45,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>HobLib</Keyword>
</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>PcdLib</Keyword>
+ </LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>Variable.h</Filename>
@@ -74,4 +77,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <ModuleEntryPoint>PeimInitializeVariableServices</ModuleEntryPoint>
</Extern>
</Externs>
+ <PcdCoded>
+ <PcdEntry PcdItemType="FIXED_AT_BUILD">
+ <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>
+ </PcdCoded>
</ModuleSurfaceArea>
\ No newline at end of file diff --git a/EdkNt32Pkg/Nt32.fpd b/EdkNt32Pkg/Nt32.fpd index de641ab..f0bd9bf 100644 --- a/EdkNt32Pkg/Nt32.fpd +++ b/EdkNt32Pkg/Nt32.fpd @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials @@ -873,9 +873,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <Instance ModuleGuid="1c747f6b-0a58-49ae-8ea3-0327a4fa10e3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="9643128f-ac24-4b3e-b6be-d8849a306153" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Instance ModuleGuid="fa177ff7-1fc7-458d-a358-d9d62ae61cec" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="9dbf6f25-0da2-4a1d-8e12-e78de6ab4d0e" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> </Libraries> <PcdBuildDefinition> <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdFlashNvStorageVariableBase</C_Name> + <Token>0x30000001</Token> + <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x00280000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> <C_Name>PcdMaximumUnicodeStringLength</C_Name> <Token>0x00000001</Token> <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> |