This commit is contained in:
xgu3 2006-07-24 08:44:40 +00:00
parent 1be13d3fdd
commit 5dd2d779dd
5 changed files with 74 additions and 42 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -1709,8 +1709,17 @@ 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="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="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="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> </Libraries>
<PcdBuildDefinition> <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"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
<Token>0x00000001</Token> <Token>0x00000001</Token>
@ -6090,8 +6099,17 @@ 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="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="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="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> </Libraries>
<PcdBuildDefinition> <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"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
<Token>0x00000001</Token> <Token>0x00000001</Token>
@ -10020,8 +10038,17 @@ 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="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="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="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> </Libraries>
<PcdBuildDefinition> <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"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
<Token>0x00000001</Token> <Token>0x00000001</Token>
@ -13612,8 +13639,17 @@ 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="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="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="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> </Libraries>
<PcdBuildDefinition> <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"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
<Token>0x00000001</Token> <Token>0x00000001</Token>

View File

@ -458,6 +458,14 @@
<IncludePkgHeader ModuleType="USER_DEFINED">Include/EdkPeim.h</IncludePkgHeader> <IncludePkgHeader ModuleType="USER_DEFINED">Include/EdkPeim.h</IncludePkgHeader>
</PackageHeaders> </PackageHeaders>
<GuidDeclarations> <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"> <Entry Name="EdkModulePkgTokenSpace">
<C_Name>gEfiEdkModulePkgTokenSpaceGuid</C_Name> <C_Name>gEfiEdkModulePkgTokenSpaceGuid</C_Name>
<GuidValue>8CC4092F-F60E-46d1-B41C-1E761DF50582</GuidValue> <GuidValue>8CC4092F-F60E-46d1-B41C-1E761DF50582</GuidValue>

View File

@ -245,18 +245,13 @@ Returns:
--*/ --*/
{ {
PEI_FLASH_MAP_PPI *FlashMapPpi;
EFI_FLASH_SUBAREA_ENTRY *VariableStoreEntry;
UINT32 NumEntries;
EFI_HOB_GUID_TYPE *GuidHob; EFI_HOB_GUID_TYPE *GuidHob;
VARIABLE_STORE_HEADER *VariableStoreHeader; VARIABLE_STORE_HEADER *VariableStoreHeader;
VARIABLE_HEADER *Variable; VARIABLE_HEADER *Variable;
EFI_STATUS Status;
VARIABLE_HEADER *MaxIndex; VARIABLE_HEADER *MaxIndex;
VARIABLE_INDEX_TABLE *IndexTable; VARIABLE_INDEX_TABLE *IndexTable;
UINT32 Count; UINT32 Count;
UINT8 *VariableBase;
if (VariableName != 0 && VendorGuid == NULL) { if (VariableName != 0 && VendorGuid == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -305,39 +300,10 @@ Returns:
if (IndexTable->StartPtr || IndexTable->EndPtr) { if (IndexTable->StartPtr || IndexTable->EndPtr) {
Variable = IndexTable->StartPtr; Variable = IndexTable->StartPtr;
} else { } else {
// VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);
// Locate FlashMap PPI VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \
// ((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);
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);
if (GetVariableStoreStatus (VariableStoreHeader) != EfiValid) { if (GetVariableStoreStatus (VariableStoreHeader) != EfiValid) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--Copyright (c) 2006, Intel Corporation <!--Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>HobLib</Keyword> <Keyword>HobLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PcdLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>Variable.h</Filename> <Filename>Variable.h</Filename>
@ -74,4 +77,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
<ModuleEntryPoint>PeimInitializeVariableServices</ModuleEntryPoint> <ModuleEntryPoint>PeimInitializeVariableServices</ModuleEntryPoint>
</Extern> </Extern>
</Externs> </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> </ModuleSurfaceArea>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -873,8 +873,17 @@ 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="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="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="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> </Libraries>
<PcdBuildDefinition> <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"> <PcdData ItemType="FIXED_AT_BUILD">
<C_Name>PcdMaximumUnicodeStringLength</C_Name> <C_Name>PcdMaximumUnicodeStringLength</C_Name>
<Token>0x00000001</Token> <Token>0x00000001</Token>