]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/IntelFrameworkModulePkg: Update PeiCore, SmbiosDxe and IsaSerialDxe...
authorZeng, Star <star.zeng@intel.com>
Thu, 14 Aug 2014 05:55:08 +0000 (05:55 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Aug 2014 05:55:08 +0000 (05:55 +0000)
It changes some of the PCD declarations to add more supported PCD storage types and
the change in the PCD access methods is associated with that.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zeng, Star <star.zeng@intel.com>
Reviewed-by: Kinney, Michael D <michael.d.kinney@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15798 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
MdeModulePkg/Core/Pei/FwVol/FwVol.c
MdeModulePkg/Core/Pei/PeiMain.h
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
MdeModulePkg/Core/Pei/Ppi/Ppi.c
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf

index 6f62bd4f7db599fe37529e4cda190c4b7507ecbb..f53531f1d21aff19bc2ebfb785912e3c1d585fd5 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Serial driver for standard UARTS on an ISA bus.\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -63,7 +63,7 @@
 [FeaturePcd]\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE\r
   \r
-[FixedPcd]\r
+[Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1\r
index 4a12eb9e041488930cd2c766368c137729d84a56..15d2bab824b43dfa9442d2f982d1fec396e80b17 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Serial driver for standard UARTS on an ISA bus.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -43,11 +43,11 @@ SERIAL_DEV  gSerialDevTempate = {
   { // SerialMode\r
     SERIAL_PORT_SUPPORT_CONTROL_MASK,\r
     SERIAL_PORT_DEFAULT_TIMEOUT,\r
-    FixedPcdGet64 (PcdUartDefaultBaudRate),     // BaudRate\r
+    0,\r
     SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH,\r
-    FixedPcdGet8 (PcdUartDefaultDataBits),      // DataBits\r
-    FixedPcdGet8 (PcdUartDefaultParity),        // Parity\r
-    FixedPcdGet8 (PcdUartDefaultStopBits)       // StopBits\r
+    0,\r
+    0,\r
+    0\r
   },\r
   NULL,\r
   NULL,\r
@@ -61,10 +61,10 @@ SERIAL_DEV  gSerialDevTempate = {
       }\r
     },\r
     0,\r
-    FixedPcdGet64 (PcdUartDefaultBaudRate),    \r
-    FixedPcdGet8 (PcdUartDefaultDataBits),\r
-    FixedPcdGet8 (PcdUartDefaultParity),\r
-    FixedPcdGet8 (PcdUartDefaultStopBits)\r
+    0,\r
+    0,\r
+    0,\r
+    0\r
   },\r
   NULL,\r
   0,    //BaseAddress\r
@@ -163,6 +163,17 @@ InitializeIsaSerial (
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Initialize UART default setting in gSerialDevTempate\r
+  //\r
+  gSerialDevTempate.SerialMode.BaudRate = PcdGet64 (PcdUartDefaultBaudRate);\r
+  gSerialDevTempate.SerialMode.DataBits = PcdGet8 (PcdUartDefaultDataBits);\r
+  gSerialDevTempate.SerialMode.Parity   = PcdGet8 (PcdUartDefaultParity);\r
+  gSerialDevTempate.SerialMode.StopBits = PcdGet8 (PcdUartDefaultStopBits);\r
+  gSerialDevTempate.UartDevicePath.BaudRate = PcdGet64 (PcdUartDefaultBaudRate);\r
+  gSerialDevTempate.UartDevicePath.DataBits = PcdGet8 (PcdUartDefaultDataBits);\r
+  gSerialDevTempate.UartDevicePath.Parity   = PcdGet8 (PcdUartDefaultParity);\r
+  gSerialDevTempate.UartDevicePath.StopBits = PcdGet8 (PcdUartDefaultStopBits);\r
 \r
   return Status;\r
 }\r
index ea80392deaee433ab12ec17238633b6aa196a99e..4004a3ad6286d7224bb1045ba4f8ae62ea638b32 100644 (file)
@@ -49,8 +49,8 @@ DiscoverPeimsAndOrderWithApriori (
   UINTN                               PeimIndex;\r
   UINTN                               PeimCount;\r
   EFI_GUID                            *Guid;\r
-  EFI_PEI_FILE_HANDLE                 TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1];\r
-  EFI_GUID                            FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
+  EFI_PEI_FILE_HANDLE                 *TempFileHandles;\r
+  EFI_GUID                            *FileGuid;\r
   EFI_PEI_FIRMWARE_VOLUME_PPI         *FvPpi;\r
   EFI_FV_FILE_INFO                    FileInfo;\r
   \r
@@ -63,12 +63,14 @@ DiscoverPeimsAndOrderWithApriori (
   Private->CurrentFvFileHandles[0] = NULL;\r
   Guid = NULL;\r
   FileHandle = NULL;\r
+  TempFileHandles = Private->FileHandles;\r
+  FileGuid        = Private->FileGuid;\r
 \r
   //\r
   // If the current Fv has been scanned, directly get its cachable record.\r
   //\r
   if (Private->Fv[Private->CurrentPeimFvCount].ScanFv) {\r
-    CopyMem (Private->CurrentFvFileHandles, Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, sizeof (Private->CurrentFvFileHandles));\r
+    CopyMem (Private->CurrentFvFileHandles, Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
     return;\r
   }\r
 \r
@@ -76,9 +78,9 @@ DiscoverPeimsAndOrderWithApriori (
   // Go ahead to scan this Fv, and cache FileHandles within it.\r
   //\r
   Status = EFI_NOT_FOUND;\r
-  for (PeimCount = 0; PeimCount <= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {\r
+  for (PeimCount = 0; PeimCount <= PcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {\r
     Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);\r
-    if (Status != EFI_SUCCESS || PeimCount == FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {\r
+    if (Status != EFI_SUCCESS || PeimCount == PcdGet32 (PcdPeiCoreMaxPeimPerFv)) {\r
       break;\r
     }\r
 \r
@@ -89,7 +91,7 @@ DiscoverPeimsAndOrderWithApriori (
   // Check whether the count of files exceeds the max support files in a FV image\r
   // If more files are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.\r
   //\r
-  ASSERT ((Status != EFI_SUCCESS) || (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)));\r
+  ASSERT ((Status != EFI_SUCCESS) || (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)));\r
 \r
   //\r
   // Get Apriori File handle\r
@@ -115,7 +117,6 @@ DiscoverPeimsAndOrderWithApriori (
       }\r
       Private->AprioriCount /= sizeof (EFI_GUID);\r
 \r
-      ZeroMem (FileGuid, sizeof (FileGuid));\r
       for (Index = 0; Index < PeimCount; Index++) {\r
         //\r
         // Make an array of file name guids that matches the FileHandle array so we can convert\r
@@ -176,7 +177,7 @@ DiscoverPeimsAndOrderWithApriori (
       // We need to update it to start with files in the A Priori list and\r
       // then the remaining files in PEIM order.\r
       //\r
-      CopyMem (Private->CurrentFvFileHandles, TempFileHandles, sizeof (Private->CurrentFvFileHandles));\r
+      CopyMem (Private->CurrentFvFileHandles, TempFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
     }\r
   }\r
   //\r
@@ -184,7 +185,7 @@ DiscoverPeimsAndOrderWithApriori (
   // Instead, we can retrieve the file handles within this Fv from cachable data.\r
   //\r
   Private->Fv[Private->CurrentPeimFvCount].ScanFv = TRUE;\r
-  CopyMem (Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, Private->CurrentFvFileHandles, sizeof (Private->CurrentFvFileHandles));\r
+  CopyMem (Private->Fv[Private->CurrentPeimFvCount].FvFileHandles, Private->CurrentFvFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
 \r
 }\r
 \r
@@ -699,7 +700,7 @@ PeiDispatcher (
     SaveCurrentFileHandle =  Private->CurrentFileHandle;\r
 \r
     for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {\r
-      for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {\r
+      for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {\r
         if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) {\r
           PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];\r
           Status = PeiLoadImage (\r
@@ -785,7 +786,7 @@ PeiDispatcher (
       // Start to dispatch all modules within the current Fv.\r
       //\r
       for (PeimCount = Private->CurrentPeimCount;\r
-           (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);\r
+           (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);\r
            PeimCount++) {\r
         Private->CurrentPeimCount  = PeimCount;\r
         PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount];\r
@@ -1144,7 +1145,7 @@ PeiDispatcher (
       //\r
       // Before walking through the next FV,Private->CurrentFvFileHandles[]should set to NULL\r
       //\r
-      SetMem (Private->CurrentFvFileHandles, sizeof (Private->CurrentFvFileHandles), 0);\r
+      SetMem (Private->CurrentFvFileHandles, sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv), 0);\r
     }\r
 \r
     //\r
index fe876ed393a9357bca3d689ab4be8401637ff3b1..a347129be420853fccc41288fe2241e742315f40 100644 (file)
@@ -530,8 +530,8 @@ FirmwareVolmeInfoPpiNotifyCallback (
   Status       = EFI_SUCCESS;\r
   PrivateData  = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
 \r
-  if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
-    DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, FixedPcdGet32 (PcdPeiCoreMaxFvSupported)));\r
+  if (PrivateData->FvCount >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
+    DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, PcdGet32 (PcdPeiCoreMaxFvSupported)));\r
     DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));\r
     ASSERT (FALSE);\r
   }\r
@@ -1967,7 +1967,7 @@ FindNextCoreFvHandle (
     }\r
   }\r
 \r
-  ASSERT (Private->FvCount <= FixedPcdGet32 (PcdPeiCoreMaxFvSupported));\r
+  ASSERT (Private->FvCount <= PcdGet32 (PcdPeiCoreMaxFvSupported));\r
   if (Instance >= Private->FvCount) {\r
     return NULL;\r
   }\r
@@ -2015,7 +2015,7 @@ PeiReinitializeFv (
   //\r
   // Fixup all FvPpi pointers for the implementation in flash to permanent memory.\r
   //\r
-  for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
+  for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
     if (PrivateData->Fv[Index].FvPpi == OldFfsFvPpi) {\r
       PrivateData->Fv[Index].FvPpi = &mPeiFfs2FwVol.Fv;\r
     }\r
@@ -2043,7 +2043,7 @@ PeiReinitializeFv (
   //\r
   // Fixup all FvPpi pointers for the implementation in flash to permanent memory.\r
   //\r
-  for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
+  for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
     if (PrivateData->Fv[Index].FvPpi == OldFfsFvPpi) {\r
       PrivateData->Fv[Index].FvPpi = &mPeiFfs3FwVol.Fv;\r
     }\r
@@ -2074,7 +2074,7 @@ AddUnknownFormatFvInfo (
 {\r
   PEI_CORE_UNKNOW_FORMAT_FV_INFO    *NewUnknownFv;\r
   \r
-  if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
+  if (PrivateData->UnknownFvInfoCount + 1 >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   \r
@@ -2212,8 +2212,8 @@ ThirdPartyFvPpiNotifyCallback (
       continue;\r
     }\r
     \r
-    if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
-      DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, FixedPcdGet32 (PcdPeiCoreMaxFvSupported)));\r
+    if (PrivateData->FvCount >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {\r
+      DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, PcdGet32 (PcdPeiCoreMaxFvSupported)));\r
       DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));\r
       ASSERT (FALSE);\r
     }\r
index 9656f07186670cc50e5604411cc354fa6209e555..8c7cfe4cacdf842b310cff24a2850fc7537764a9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Definition of Pei Core Structures and Services\r
   \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -89,9 +89,9 @@ typedef struct {
   /// \r
   INTN                    LastDispatchedNotify;\r
   ///\r
-  /// Ppi database.\r
+  /// Ppi database has the PcdPeiCoreMaxPpiSupported number of entries.\r
   ///\r
-  PEI_PPI_LIST_POINTERS   PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)];\r
+  PEI_PPI_LIST_POINTERS   *PpiListPtrs;\r
 } PEI_PPI_DATABASE;\r
 \r
 \r
@@ -109,8 +109,14 @@ typedef struct {
   EFI_FIRMWARE_VOLUME_HEADER          *FvHeader;\r
   EFI_PEI_FIRMWARE_VOLUME_PPI         *FvPpi;\r
   EFI_PEI_FV_HANDLE                   FvHandle;\r
-  UINT8                               PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
-  EFI_PEI_FILE_HANDLE                 FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
+  //\r
+  // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries.\r
+  //\r
+  UINT8                               *PeimState;\r
+  //\r
+  // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries.\r
+  //\r
+  EFI_PEI_FILE_HANDLE                 *FvFileHandles;\r
   BOOLEAN                             ScanFv;\r
   UINT32                              AuthenticationStatus;\r
 } PEI_CORE_FV_HANDLE;\r
@@ -188,13 +194,22 @@ struct _PEI_CORE_INSTANCE {
   UINTN                              FvCount;\r
   \r
   ///\r
-  /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore.\r
+  /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries.\r
+  /// Each entry is for one FV which contains FFS and could be dispatched by PeiCore.\r
   ///\r
-  PEI_CORE_FV_HANDLE                 Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
-  PEI_CORE_UNKNOW_FORMAT_FV_INFO     UnknownFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
+  PEI_CORE_FV_HANDLE                 *Fv;\r
+\r
+  ///\r
+  /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries.\r
+  /// Each entry is for one FV which could not be dispatched by PeiCore.\r
+  ///\r
+  PEI_CORE_UNKNOW_FORMAT_FV_INFO     *UnknownFvInfo;\r
   UINTN                              UnknownFvInfoCount;\r
   \r
-  EFI_PEI_FILE_HANDLE                CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r
+  ///\r
+  /// Pointer to the buffer with the PcdPeiCoreMaxPeimPerFv number of entries.\r
+  ///\r
+  EFI_PEI_FILE_HANDLE                *CurrentFvFileHandles;\r
   UINTN                              AprioriCount;\r
   UINTN                              CurrentPeimFvCount;\r
   UINTN                              CurrentPeimCount;\r
@@ -234,6 +249,16 @@ struct _PEI_CORE_INSTANCE {
   // This field points to the shadowed image read function\r
   //\r
   PE_COFF_LOADER_READ_FILE          ShadowedImageRead;\r
+\r
+  //\r
+  // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv + 1 number of entries.\r
+  //\r
+  EFI_PEI_FILE_HANDLE               *FileHandles;\r
+  //\r
+  // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv number of entries.\r
+  //\r
+  EFI_GUID                          *FileGuid;\r
+\r
   //\r
   // Temp Memory Range is not covered by PeiTempMem and Stack.\r
   // Those Memory Range will be migrated into phisical memory. \r
index 27e75428387878279ef67d52e6c0c9f158d00d61..7cff0632a333779c386da54063ce3705d54a9792 100644 (file)
@@ -4,7 +4,7 @@
 # 2) Dispatch PEIM from discovered FV.\r
 # 3) Handoff control to DxeIpl to load DXE core and enter DXE phase.\r
 #\r
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
   gEfiTemporaryRamSupportPpiGuid                ## SOMETIMES_CONSUMES\r
   gEfiTemporaryRamDonePpiGuid                   ## SOMETIMES_CONSUMES\r
 \r
-[FixedPcd]\r
+[Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported             ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv               ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported            ## CONSUMES\r
\r
-[Pcd]  \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize                   ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst   ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport            ## CONSUMES\r
index 6429ad3a218cb533f5ba2d24689197543a8daa87..d105fce28d61a5830a5fe8ce7050bf2c1fd587c6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pei Core Main Entry Point\r
   \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -152,6 +152,7 @@ PeiCore (
   EFI_PEI_PCI_CFG2_PPI        *PciCfg;\r
   EFI_HOB_HANDOFF_INFO_TABLE  *HandoffInformationTable;\r
   EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi;\r
+  UINTN                       Index;\r
   \r
   //\r
   // Retrieve context passed into PEI Core\r
@@ -181,8 +182,28 @@ PeiCore (
       OldCoreData->CpuIo = &OldCoreData->ServiceTableShadow.CpuIo;\r
       if (OldCoreData->HeapOffsetPositive) {\r
         OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw + OldCoreData->HeapOffset);\r
+        OldCoreData->UnknownFvInfo        = (PEI_CORE_UNKNOW_FORMAT_FV_INFO *) ((UINT8 *) OldCoreData->UnknownFvInfo + OldCoreData->HeapOffset);\r
+        OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->CurrentFvFileHandles + OldCoreData->HeapOffset);\r
+        OldCoreData->PpiData.PpiListPtrs  = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiListPtrs + OldCoreData->HeapOffset);\r
+        OldCoreData->Fv                   = (PEI_CORE_FV_HANDLE *) ((UINT8 *) OldCoreData->Fv + OldCoreData->HeapOffset);\r
+        for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
+          OldCoreData->Fv[Index].PeimState     = (UINT8 *) OldCoreData->Fv[Index].PeimState + OldCoreData->HeapOffset;\r
+          OldCoreData->Fv[Index].FvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->Fv[Index].FvFileHandles + OldCoreData->HeapOffset);\r
+        }\r
+        OldCoreData->FileGuid             = (EFI_GUID *) ((UINT8 *) OldCoreData->FileGuid + OldCoreData->HeapOffset);\r
+        OldCoreData->FileHandles          = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->FileHandles + OldCoreData->HeapOffset);\r
       } else {\r
         OldCoreData->HobList.Raw = (VOID *)(OldCoreData->HobList.Raw - OldCoreData->HeapOffset);\r
+        OldCoreData->UnknownFvInfo        = (PEI_CORE_UNKNOW_FORMAT_FV_INFO *) ((UINT8 *) OldCoreData->UnknownFvInfo - OldCoreData->HeapOffset);\r
+        OldCoreData->CurrentFvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->CurrentFvFileHandles - OldCoreData->HeapOffset);\r
+        OldCoreData->PpiData.PpiListPtrs  = (PEI_PPI_LIST_POINTERS *) ((UINT8 *) OldCoreData->PpiData.PpiListPtrs - OldCoreData->HeapOffset);\r
+        OldCoreData->Fv                   = (PEI_CORE_FV_HANDLE *) ((UINT8 *) OldCoreData->Fv - OldCoreData->HeapOffset);\r
+        for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
+          OldCoreData->Fv[Index].PeimState     = (UINT8 *) OldCoreData->Fv[Index].PeimState - OldCoreData->HeapOffset;\r
+          OldCoreData->Fv[Index].FvFileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->Fv[Index].FvFileHandles - OldCoreData->HeapOffset);\r
+        }\r
+        OldCoreData->FileGuid             = (EFI_GUID *) ((UINT8 *) OldCoreData->FileGuid - OldCoreData->HeapOffset);\r
+        OldCoreData->FileHandles          = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->FileHandles - OldCoreData->HeapOffset);\r
       }\r
 \r
       //\r
@@ -285,8 +306,25 @@ PeiCore (
 \r
   //\r
   // Initialize PEI Core Services\r
-  //  \r
+  //\r
   InitializeMemoryServices   (&PrivateData,    SecCoreData, OldCoreData);\r
+  if (OldCoreData == NULL) {\r
+    //\r
+    // Initialize PEI Core Private Data Buffer\r
+    //\r
+    PrivateData.PpiData.PpiListPtrs  = AllocateZeroPool (sizeof (PEI_PPI_LIST_POINTERS) * PcdGet32 (PcdPeiCoreMaxPpiSupported));\r
+    PrivateData.Fv                   = AllocateZeroPool (sizeof (PEI_CORE_FV_HANDLE) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+    PrivateData.Fv[0].PeimState      = AllocateZeroPool (sizeof (UINT8) * PcdGet32 (PcdPeiCoreMaxPeimPerFv) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+    PrivateData.Fv[0].FvFileHandles  = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+    for (Index = 1; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {\r
+      PrivateData.Fv[Index].PeimState     = PrivateData.Fv[Index - 1].PeimState + PcdGet32 (PcdPeiCoreMaxPeimPerFv);\r
+      PrivateData.Fv[Index].FvFileHandles = PrivateData.Fv[Index - 1].FvFileHandles + PcdGet32 (PcdPeiCoreMaxPeimPerFv);\r
+    }\r
+    PrivateData.UnknownFvInfo        = AllocateZeroPool (sizeof (PEI_CORE_UNKNOW_FORMAT_FV_INFO) * PcdGet32 (PcdPeiCoreMaxFvSupported));\r
+    PrivateData.CurrentFvFileHandles = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
+    PrivateData.FileGuid             = AllocatePool (sizeof (EFI_GUID) * PcdGet32 (PcdPeiCoreMaxPeimPerFv));\r
+    PrivateData.FileHandles          = AllocatePool (sizeof (EFI_PEI_FILE_HANDLE) * (PcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1));\r
+  }\r
   InitializePpiServices      (&PrivateData,    OldCoreData);\r
   \r
   //\r
index 9fe95acb86d3e34f5c7fcf59c12cdefb07c624c1..706e835a70916810d2926423cf626a8450dda5af 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PEI Core PPI services\r
   \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -30,9 +30,9 @@ InitializePpiServices (
   )\r
 {\r
   if (OldCoreData == NULL) {\r
-    PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
-    PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
-    PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
   }\r
 }\r
 \r
@@ -119,7 +119,7 @@ ConvertPpiPointers (
   UINT8                 Index;\r
   UINT8                 IndexHole;\r
 \r
-  for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
+  for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
     if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) {\r
       //\r
       // Convert PPI pointer in old Heap\r
@@ -312,7 +312,7 @@ PeiReInstallPpi (
   // Remove the old PPI from the database, add the new one.\r
   //\r
   DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid));\r
-  ASSERT (Index < (INTN)(FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)));\r
+  ASSERT (Index < (INTN)(PcdGet32 (PcdPeiCoreMaxPpiSupported)));\r
   PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi;\r
 \r
   //\r
@@ -570,7 +570,7 @@ ProcessNotifyList (
         EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,\r
         PrivateData->PpiData.LastDispatchedInstall,\r
         PrivateData->PpiData.PpiListEnd,\r
-        FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1,\r
+        PcdGet32 (PcdPeiCoreMaxPpiSupported)-1,\r
         PrivateData->PpiData.DispatchListEnd\r
         );\r
       PrivateData->PpiData.LastDispatchedInstall = TempValue;\r
index 47d9fdda1a7b7493a8ec27511724be794abe5053..7fec666c79fe1ce40a5855764b7e95b4a579df3e 100644 (file)
   #  for a dynamic PCD used in PEI phase.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f\r
 \r
-  ## Maximum number of FV is supported by PeiCore's dispatching.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030\r
-\r
-  ## Maximum File count in every FV is supported by PeiCore's dispatching.\r
-  #  PeiCore supported File type includes PEIM, Combined PEIM and FV.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031\r
-\r
   ## Maximum stack size for PeiCore.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize|0x20000|UINT32|0x00010032\r
 \r
-  ## Maximum PPI count is supported by PeiCore's PPI database.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported|64|UINT32|0x00010033\r
-\r
   ## Size of the NV variable range. Note that this value should less than or equal to PcdFlashNvStorageFtwSpareSize\r
   #  The root cause is that variable driver will use FTW protocol to reclaim variable region.\r
   #  If the length of variable region is larger than FTW spare size, it means the whole variable region can not\r
   #  Other Value:        Enable the feature as fixed absolute address, and the value is the top memory address \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable|0|UINT64|0x30001015\r
 \r
-  ## Smbios version\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208|UINT16|0x00010055\r
-\r
   ## TFTP BlockSize. Initial value 0 means using default block size which is (MTU-IP_HEADER-UDP_HEADER-TFTP_HEADER)\r
   #  to handle all link layers. If the value is non zero, the PCD value will be used as block size.\r
   #\r
   #\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010\r
 \r
+  ## Maximum number of FV is supported by PeiCore's dispatching.\r
+  # @Prompt Maximum number of FV supported by PeiCore.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030\r
+\r
+  ## Maximum File count in every FV is supported by PeiCore's dispatching.\r
+  #  PeiCore supported File type includes PEIM, Combined PEIM and FV.\r
+  # @Prompt Maximum File count per FV supported by PeiCore.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031\r
+\r
+  ## Maximum PPI count is supported by PeiCore's PPI database.\r
+  # @Prompt Maximum PPI count supported by PeiCore.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported|64|UINT32|0x00010033\r
+\r
   ## Maximun number of performance log entries during PEI phase.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f\r
 \r
   ## This PCD specifies whether 1G page table is enabled.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|FALSE|BOOLEAN|0x0001005E\r
 \r
+  ## Smbios version.\r
+  # @Prompt Smbios version.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208|UINT16|0x00010055\r
+\r
   ## This PCD specifies the additional pad size in FPDT Basic Boot Performance Table for \r
   #  the extension FPDT boot records got after ReadyToBoot and before ExitBootService.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x0|UINT32|0x0001005F\r
index 329bdbfc497ac4de3a5fc4757476366a07a10e11..c0128f088f9e12a5fd69e86f35f7a857248a81f6 100644 (file)
@@ -2,7 +2,7 @@
   This code produces the Smbios protocol. It also responsible for constructing \r
   SMBIOS table into system table.\r
   \r
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -49,11 +49,11 @@ SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData = {
   //\r
   // MajorVersion\r
   //\r
-  (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) >> 8),\r
+  0,\r
   //\r
   // MinorVersion\r
   //\r
-  (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x00ff),\r
+  0,\r
   //\r
   // MaxStructureSize, TO BE FILLED\r
   //\r
@@ -101,8 +101,7 @@ SMBIOS_TABLE_ENTRY_POINT EntryPointStructureData = {
   //\r
   // SmbiosBcdRevision\r
   //\r
-  (UINT8) ((FixedPcdGet16 (PcdSmbiosVersion) >> 4) & 0xf0)\r
-  | (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x0f)\r
+  0\r
 };\r
 \r
 \r
@@ -1079,8 +1078,11 @@ SmbiosDriverEntryPoint (
   mPrivateData.Smbios.UpdateString      = SmbiosUpdateString;\r
   mPrivateData.Smbios.Remove            = SmbiosRemove;\r
   mPrivateData.Smbios.GetNext           = SmbiosGetNext;\r
-  mPrivateData.Smbios.MajorVersion      = (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) >> 8);\r
-  mPrivateData.Smbios.MinorVersion      = (UINT8) (FixedPcdGet16 (PcdSmbiosVersion) & 0x00ff);\r
+  mPrivateData.Smbios.MajorVersion      = (UINT8) (PcdGet16 (PcdSmbiosVersion) >> 8);\r
+  mPrivateData.Smbios.MinorVersion      = (UINT8) (PcdGet16 (PcdSmbiosVersion) & 0x00ff);\r
+  EntryPointStructureData.MajorVersion  = mPrivateData.Smbios.MajorVersion;\r
+  EntryPointStructureData.MinorVersion  = mPrivateData.Smbios.MinorVersion;\r
+  EntryPointStructureData.SmbiosBcdRevision = (UINT8) ((PcdGet16 (PcdSmbiosVersion) >> 4) & 0xf0) | (UINT8) (PcdGet16 (PcdSmbiosVersion) & 0x0f);\r
 \r
   InitializeListHead (&mPrivateData.DataListHead);\r
   InitializeListHead (&mPrivateData.AllocatedHandleListHead);\r
index c4524837bd1f732e4ec8dfd78dbe20f22d7eea96..f385df10cabfd02ceb8a8b2f4df944ef6812a87e 100644 (file)
@@ -2,7 +2,7 @@
 # Component description file for Smbios module.\r
 #\r
 # This driver initializes and installs the SMBIOS protocol.\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -54,7 +54,7 @@
   gEfiEventReadyToBootGuid                    # PROTOCOL ALWAYS_CONSUMED\r
   gEfiSmbiosTableGuid                         # PROTOCOL ALWAYS_CONSUMED\r
 \r
-[FixedPcd]\r
+[Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion\r
 \r
 [Depex]\r