git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1082 6f19259b...
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 24 Jul 2006 08:44:40 +0000 (08:44 +0000)
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 24 Jul 2006 08:44:40 +0000 (08:44 +0000)
EdkModulePkg/EdkModulePkg.fpd
EdkModulePkg/EdkModulePkg.spd
EdkModulePkg/Universal/Variable/Pei/Variable.c
EdkModulePkg/Universal/Variable/Pei/Variable.msa
EdkNt32Pkg/Nt32.fpd

index 1866bd7..6483cb9 100644 (file)
@@ -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,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="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>
@@ -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="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>
@@ -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="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>
@@ -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="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>
index 6d8b4cd..883df18 100644 (file)
     <IncludePkgHeader ModuleType="USER_DEFINED">Include/EdkPeim.h</IncludePkgHeader>\r
   </PackageHeaders>\r
   <GuidDeclarations>\r
+    <Entry Name="GenericPlatformTokenSpace">\r
+      <C_Name>gEfiGenericPlatformTokenSpaceGuid</C_Name>\r
+      <GuidValue>18D15EA6-9E14-40a1-B39C-59C44DA9D891</GuidValue>\r
+      <HelpText>\r
+        This is the token space GUID for platform generic PCD definitions.\r
+        Now FlashLayout and Platform CPU belong to this space.\r
+      </HelpText>      \r
+    </Entry> \r
     <Entry Name="EdkModulePkgTokenSpace">\r
       <C_Name>gEfiEdkModulePkgTokenSpaceGuid</C_Name>\r
       <GuidValue>8CC4092F-F60E-46d1-B41C-1E761DF50582</GuidValue>\r
index 9561ad1..f10a96b 100644 (file)
@@ -245,18 +245,13 @@ Returns:
 \r
 --*/\r
 {\r
-  PEI_FLASH_MAP_PPI       *FlashMapPpi;\r
-  EFI_FLASH_SUBAREA_ENTRY *VariableStoreEntry;\r
-  UINT32                  NumEntries;\r
   EFI_HOB_GUID_TYPE       *GuidHob;\r
   VARIABLE_STORE_HEADER   *VariableStoreHeader;\r
   VARIABLE_HEADER         *Variable;\r
-\r
-  EFI_STATUS              Status;\r
-\r
   VARIABLE_HEADER         *MaxIndex;\r
   VARIABLE_INDEX_TABLE    *IndexTable;\r
   UINT32                  Count;\r
+  UINT8                   *VariableBase;\r
 \r
   if (VariableName != 0 && VendorGuid == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -305,39 +300,10 @@ Returns:
     if (IndexTable->StartPtr || IndexTable->EndPtr) {\r
       Variable = IndexTable->StartPtr;\r
     } else {\r
-      //\r
-      // Locate FlashMap PPI\r
-      //\r
-      Status = (**PeiServices).LocatePpi (\r
-                                PeiServices,\r
-                                &gPeiFlashMapPpiGuid,\r
-                                0,\r
-                                NULL,\r
-                                (VOID **) &FlashMapPpi\r
-                                );\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-      //\r
-      // Get flash area info for variables\r
-      //\r
-      Status = FlashMapPpi->GetAreaInfo (\r
-                              PeiServices,\r
-                              FlashMapPpi,\r
-                              EFI_FLASH_AREA_EFI_VARIABLES,\r
-                              NULL,\r
-                              &NumEntries,\r
-                              &VariableStoreEntry\r
-                              );\r
-\r
-      //\r
-      //  Currently only one non-volatile variable store is supported\r
-      //\r
-      if (NumEntries != 1) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
-\r
-      VariableStoreHeader = (VARIABLE_STORE_HEADER *) (UINTN) (VariableStoreEntry->Base);\r
-\r
+      VariableBase = (UINT8 *) (UINTN) PcdGet32 (PcdFlashNvStorageVariableBase);\r
+      VariableStoreHeader = (VARIABLE_STORE_HEADER *) (VariableBase + \\r
+                            ((EFI_FIRMWARE_VOLUME_HEADER *) (VariableBase)) -> HeaderLength);\r
+      \r
       if (GetVariableStoreStatus (VariableStoreHeader) != EfiValid) {\r
         return EFI_UNSUPPORTED;\r
       }\r
index f8cf68b..5fa1028 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <!--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">\r
       <Keyword>HobLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PcdLib</Keyword>\r
+    </LibraryClass>    \r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>Variable.h</Filename>\r
@@ -74,4 +77,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
       <ModuleEntryPoint>PeimInitializeVariableServices</ModuleEntryPoint>\r
     </Extern>\r
   </Externs>\r
+  <PcdCoded>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD">\r
+      <C_Name>PcdFlashNvStorageVariableBase</C_Name>\r
+      <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>\r
+        The driver gets the Variable store base address from this PCD.  This base address point to\r
+        an EFI_FIRMWARE_VOLUMN_HEADER struct.\r
+      </HelpText>\r
+    </PcdEntry>     \r
+  </PcdCoded> \r
 </ModuleSurfaceArea>
\ No newline at end of file
index de641ab..f0bd9bf 100644 (file)
@@ -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,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="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>