diff options
Diffstat (limited to 'MdeModulePkg/Core/Pei')
-rw-r--r-- | MdeModulePkg/Core/Pei/BootMode/BootMode.c | 36 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/CpuIo/CpuIo.c | 138 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Dependency/Dependency.c | 48 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Dependency/Dependency.h | 18 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 248 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/FwVol/FwVol.c | 382 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/FwVol/FwVol.h | 104 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Hob/Hob.c | 40 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Image/Image.c | 50 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 44 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PciCfg2/PciCfg2.c | 48 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiCoreExtra.uni | 6 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain.h | 204 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain.inf | 12 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 32 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Ppi/Ppi.c | 34 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Security/Security.c | 22 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/StatusCode/StatusCode.c | 38 |
18 files changed, 752 insertions, 752 deletions
diff --git a/MdeModulePkg/Core/Pei/BootMode/BootMode.c b/MdeModulePkg/Core/Pei/BootMode/BootMode.c index 39afeba838..af7d8b1058 100644 --- a/MdeModulePkg/Core/Pei/BootMode/BootMode.c +++ b/MdeModulePkg/Core/Pei/BootMode/BootMode.c @@ -4,15 +4,15 @@ SetBootMode()
See PI Specification volume I, chapter 9 Boot Paths for additional information
on the boot mode.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -35,7 +35,7 @@ PeiGetBootMode ( IN OUT EFI_BOOT_MODE *BootMode
)
{
- PEI_CORE_INSTANCE *PrivateData;
+ PEI_CORE_INSTANCE *PrivateData;
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
@@ -44,13 +44,13 @@ PeiGetBootMode ( }
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
-
+
HandOffHob = (PrivateData->HobList.HandoffInformationTable);
-
+
*BootMode = HandOffHob->BootMode;
-
- return EFI_SUCCESS;
+
+ return EFI_SUCCESS;
}
@@ -71,16 +71,16 @@ PeiSetBootMode ( IN EFI_BOOT_MODE BootMode
)
{
- PEI_CORE_INSTANCE *PrivateData;
+ PEI_CORE_INSTANCE *PrivateData;
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
-
+
HandOffHob = (PrivateData->HobList.HandoffInformationTable);
-
+
HandOffHob->BootMode = BootMode;
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Core/Pei/CpuIo/CpuIo.c b/MdeModulePkg/Core/Pei/CpuIo/CpuIo.c index c82c221540..e065a6c988 100644 --- a/MdeModulePkg/Core/Pei/CpuIo/CpuIo.c +++ b/MdeModulePkg/Core/Pei/CpuIo/CpuIo.c @@ -1,19 +1,19 @@ /** @file
The default version of EFI_PEI_CPU_IO_PPI support published by PeiServices in
PeiCore initialization phase.
-
+
EFI_PEI_CPU_IO_PPI is installed by some platform or chipset-specific PEIM that
abstracts the processor-visible I/O operations. When PeiCore is started, the
default version of EFI_PEI_CPU_IO_PPI will be assigned to PeiServices table.
-
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -52,12 +52,12 @@ EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi = { /**
Memory-based read services.
-
- This function is to perform the Memory Access Read service based on installed
- instance of the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+
+ This function is to perform the Memory Access Read service based on installed
+ instance of the EFI_PEI_CPU_IO_PPI.
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -67,7 +67,7 @@ EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi = { @param Buffer A pointer to the buffer of data.
@retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
**/
EFI_STATUS
EFIAPI
@@ -82,15 +82,15 @@ PeiDefaultMemRead ( {
return EFI_NOT_AVAILABLE_YET;
}
-
+
/**
Memory-based write services.
-
- This function is to perform the Memory Access Write service based on installed
- instance of the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+
+ This function is to perform the Memory Access Write service based on installed
+ instance of the EFI_PEI_CPU_IO_PPI.
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -100,7 +100,7 @@ PeiDefaultMemRead ( @param Buffer A pointer to the buffer of data.
@retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
**/
EFI_STATUS
EFIAPI
@@ -118,11 +118,11 @@ PeiDefaultMemWrite ( /**
IO-based read services.
-
+
This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -150,11 +150,11 @@ PeiDefaultIoRead ( /**
IO-based write services.
-
+
This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -182,10 +182,10 @@ PeiDefaultIoWrite ( /**
8-bit I/O read operations.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -205,10 +205,10 @@ PeiDefaultIoRead8 ( /**
Reads an 16-bit I/O port.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -228,10 +228,10 @@ PeiDefaultIoRead16 ( /**
Reads an 32-bit I/O port.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -251,10 +251,10 @@ PeiDefaultIoRead32 ( /**
Reads an 64-bit I/O port.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -276,7 +276,7 @@ PeiDefaultIoRead64 ( 8-bit I/O write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -291,13 +291,13 @@ PeiDefaultIoWrite8 ( IN UINT8 Data
)
{
-}
+}
/**
16-bit I/O write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -318,7 +318,7 @@ PeiDefaultIoWrite16 ( 32-bit I/O write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -339,7 +339,7 @@ PeiDefaultIoWrite32 ( 64-bit I/O write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -359,9 +359,9 @@ PeiDefaultIoWrite64 ( /**
8-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -378,14 +378,14 @@ PeiDefaultMemRead8 ( )
{
return 0;
-}
+}
/**
16-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -402,14 +402,14 @@ PeiDefaultMemRead16 ( )
{
return 0;
-}
+}
/**
32-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -426,14 +426,14 @@ PeiDefaultMemRead32 ( )
{
return 0;
-}
+}
/**
64-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -450,13 +450,13 @@ PeiDefaultMemRead64 ( )
{
return 0;
-}
+}
/**
8-bit memory write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -472,13 +472,13 @@ PeiDefaultMemWrite8 ( IN UINT8 Data
)
{
-}
+}
/**
16-bit memory write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -494,7 +494,7 @@ PeiDefaultMemWrite16 ( IN UINT16 Data
)
{
-}
+}
/**
32-bit memory write operations.
@@ -516,13 +516,13 @@ PeiDefaultMemWrite32 ( IN UINT32 Data
)
{
-}
+}
/**
64-bit memory write operations.
If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then do
nothing.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -538,4 +538,4 @@ PeiDefaultMemWrite64 ( IN UINT64 Data
)
{
-}
+}
diff --git a/MdeModulePkg/Core/Pei/Dependency/Dependency.c b/MdeModulePkg/Core/Pei/Dependency/Dependency.c index e71566b5a7..32003a0114 100644 --- a/MdeModulePkg/Core/Pei/Dependency/Dependency.c +++ b/MdeModulePkg/Core/Pei/Dependency/Dependency.c @@ -5,14 +5,14 @@ if a driver can be scheduled for execution. The criteria for
schedulability is that the dependency expression is satisfied.
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -42,17 +42,17 @@ IsPpiInstalled ( VOID *PeiInstance;
EFI_STATUS Status;
EFI_GUID PpiGuid;
-
+
//
// If there is no GUID to evaluate, just return current result on stack.
//
if (Stack->Operator == NULL) {
return Stack->Result;
}
-
+
//
// Copy the Guid into a locale variable so that there are no
- // possibilities of alignment faults for cross-compilation
+ // possibilities of alignment faults for cross-compilation
// environments such as Intel?Itanium(TM).
//
CopyMem(&PpiGuid, Stack->Operator, sizeof(EFI_GUID));
@@ -70,7 +70,7 @@ IsPpiInstalled ( if (EFI_ERROR(Status)) {
return FALSE;
}
-
+
return TRUE;
}
@@ -111,12 +111,12 @@ PeimDispatchReadiness ( while (TRUE) {
switch (*(Iterator++)) {
-
+
//
- // For performance reason we put the frequently used items in front of
+ // For performance reason we put the frequently used items in front of
// the rarely used items
//
-
+
case (EFI_DEP_PUSH):
//
// Check to make sure the dependency grammar doesn't overflow the
@@ -137,8 +137,8 @@ PeimDispatchReadiness ( StackPtr++;
break;
- case (EFI_DEP_AND):
- case (EFI_DEP_OR):
+ case (EFI_DEP_AND):
+ case (EFI_DEP_OR):
if (*(Iterator - 1) == EFI_DEP_AND) {
DEBUG ((DEBUG_DISPATCH, " AND\n"));
} else {
@@ -163,11 +163,11 @@ PeimDispatchReadiness ( // evaluation of the POPed operator. Otherwise, don't POP the second
// operator since it will now evaluate to the final result on the
// next operand that causes a POP.
- //
+ //
StackPtr--;
//
- // Iterator has increased by 1 after we retrieve the operand, so here we
- // should get the value pointed by (Iterator - 1), in order to obtain the
+ // Iterator has increased by 1 after we retrieve the operand, so here we
+ // should get the value pointed by (Iterator - 1), in order to obtain the
// same operand.
//
if (*(Iterator - 1) == EFI_DEP_AND) {
@@ -182,7 +182,7 @@ PeimDispatchReadiness ( }
}
break;
-
+
case (EFI_DEP_END):
DEBUG ((DEBUG_DISPATCH, " END\n"));
StackPtr--;
@@ -197,7 +197,7 @@ PeimDispatchReadiness ( DEBUG ((DEBUG_DISPATCH, " RESULT = %a\n", IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));
return IsPpiInstalled (PeiServices, StackPtr);
- case (EFI_DEP_NOT):
+ case (EFI_DEP_NOT):
DEBUG ((DEBUG_DISPATCH, " NOT\n"));
//
// Check to make sure the dependency grammar doesn't underflow the
@@ -229,8 +229,8 @@ PeimDispatchReadiness ( return FALSE;
}
//
- // Iterator has increased by 1 after we retrieve the operand, so here we
- // should get the value pointed by (Iterator - 1), in order to obtain the
+ // Iterator has increased by 1 after we retrieve the operand, so here we
+ // should get the value pointed by (Iterator - 1), in order to obtain the
// same operand.
//
if (*(Iterator - 1) == EFI_DEP_TRUE) {
diff --git a/MdeModulePkg/Core/Pei/Dependency/Dependency.h b/MdeModulePkg/Core/Pei/Dependency/Dependency.h index 5021ce056b..1c648b501d 100644 --- a/MdeModulePkg/Core/Pei/Dependency/Dependency.h +++ b/MdeModulePkg/Core/Pei/Dependency/Dependency.h @@ -1,15 +1,15 @@ /** @file
This module contains data specific to dependency expressions
and local function prototypes.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index c4f629dadf..f6bb35a5fe 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -1,7 +1,7 @@ /** @file
EFI PEI Core dispatch services
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -44,9 +44,9 @@ DiscoverPeimsAndOrderWithApriori ( EFI_GUID *FileGuid;
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
EFI_FV_FILE_INFO FileInfo;
-
+
FvPpi = CoreFileHandle->FvPpi;
-
+
//
// Walk the FV and find all the PEIMs and the Apriori file.
//
@@ -182,15 +182,15 @@ DiscoverPeimsAndOrderWithApriori ( //
// This is the minimum memory required by DxeCore initialization. When LMFA feature enabled,
-// This part of memory still need reserved on the very top of memory so that the DXE Core could
+// This part of memory still need reserved on the very top of memory so that the DXE Core could
// use these memory for data initialization. This macro should be sync with the same marco
// defined in DXE Core.
//
#define MINIMUM_INITIAL_MEMORY_SIZE 0x10000
/**
- This function is to test if the memory range described in resource HOB is available or not.
-
- This function should only be invoked when Loading Module at Fixed Address(LMFA) feature is enabled. Some platform may allocate the
+ This function is to test if the memory range described in resource HOB is available or not.
+
+ This function should only be invoked when Loading Module at Fixed Address(LMFA) feature is enabled. Some platform may allocate the
memory before PeiLoadFixAddressHook in invoked. so this function is to test if the memory range described by the input resource HOB is
available or not.
@@ -203,41 +203,41 @@ PeiLoadFixAddressIsMemoryRangeAvailable ( IN EFI_HOB_RESOURCE_DESCRIPTOR *ResourceHob
)
{
- EFI_HOB_MEMORY_ALLOCATION *MemoryHob;
- BOOLEAN IsAvailable;
- EFI_PEI_HOB_POINTERS Hob;
-
+ EFI_HOB_MEMORY_ALLOCATION *MemoryHob;
+ BOOLEAN IsAvailable;
+ EFI_PEI_HOB_POINTERS Hob;
+
IsAvailable = TRUE;
- if (PrivateData == NULL || ResourceHob == NULL) {
- return FALSE;
- }
- //
+ if (PrivateData == NULL || ResourceHob == NULL) {
+ return FALSE;
+ }
+ //
// test if the memory range describe in the HOB is already allocated.
//
for (Hob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
- //
- // See if this is a memory allocation HOB
//
- if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
+ // See if this is a memory allocation HOB
+ //
+ if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
MemoryHob = Hob.MemoryAllocation;
- if(MemoryHob->AllocDescriptor.MemoryBaseAddress == ResourceHob->PhysicalStart &&
+ if(MemoryHob->AllocDescriptor.MemoryBaseAddress == ResourceHob->PhysicalStart &&
MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength == ResourceHob->PhysicalStart + ResourceHob->ResourceLength) {
IsAvailable = FALSE;
- break;
+ break;
}
}
}
-
+
return IsAvailable;
-
+
}
/**
Hook function for Loading Module at Fixed Address feature
-
+
This function should only be invoked when Loading Module at Fixed Address(LMFA) feature is enabled. When feature is
- configured as Load Modules at Fix Absolute Address, this function is to validate the top address assigned by user. When
- feature is configured as Load Modules at Fixed Offset, the functino is to find the top address which is TOLM-TSEG in general.
- And also the function will re-install PEI memory.
+ configured as Load Modules at Fix Absolute Address, this function is to validate the top address assigned by user. When
+ feature is configured as Load Modules at Fixed Offset, the functino is to find the top address which is TOLM-TSEG in general.
+ And also the function will re-install PEI memory.
@param PrivateData Pointer to the private data passed in from caller
@@ -251,7 +251,7 @@ PeiLoadFixAddressHook( UINT64 PeiMemorySize;
UINT64 TotalReservedMemorySize;
UINT64 MemoryRangeEnd;
- EFI_PHYSICAL_ADDRESS HighAddress;
+ EFI_PHYSICAL_ADDRESS HighAddress;
EFI_HOB_RESOURCE_DESCRIPTOR *ResourceHob;
EFI_HOB_RESOURCE_DESCRIPTOR *NextResourceHob;
EFI_HOB_RESOURCE_DESCRIPTOR *CurrentResourceHob;
@@ -273,89 +273,89 @@ PeiLoadFixAddressHook( //
// The top reserved memory include 3 parts: the topest range is for DXE core initialization with the size MINIMUM_INITIAL_MEMORY_SIZE
// then RuntimeCodePage range and Boot time code range.
- //
+ //
TotalReservedMemorySize = MINIMUM_INITIAL_MEMORY_SIZE + EFI_PAGES_TO_SIZE(PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber));
- TotalReservedMemorySize+= EFI_PAGES_TO_SIZE(PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber)) ;
+ TotalReservedMemorySize+= EFI_PAGES_TO_SIZE(PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber)) ;
//
// PEI memory range lies below the top reserved memory
- //
+ //
TotalReservedMemorySize += PeiMemorySize;
-
+
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressRuntimeCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber)));
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressBootTimeCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber)));
- DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressPeiCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressPeiCodePageNumber)));
+ DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressPeiCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressPeiCodePageNumber)));
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Total Reserved Memory Size = 0x%lx.\n", TotalReservedMemorySize));
//
- // Loop through the system memory typed hob to merge the adjacent memory range
+ // Loop through the system memory typed hob to merge the adjacent memory range
//
for (Hob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
- //
- // See if this is a resource descriptor HOB
+ //
+ // See if this is a resource descriptor HOB
//
if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
-
- ResourceHob = Hob.ResourceDescriptor;
+
+ ResourceHob = Hob.ResourceDescriptor;
//
// If range described in this hob is not system memory or heigher than MAX_ADDRESS, ignored.
//
if (ResourceHob->ResourceType != EFI_RESOURCE_SYSTEM_MEMORY ||
ResourceHob->PhysicalStart + ResourceHob->ResourceLength > MAX_ADDRESS) {
continue;
- }
-
- for (NextHob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(NextHob); NextHob.Raw = GET_NEXT_HOB(NextHob)) {
+ }
+
+ for (NextHob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(NextHob); NextHob.Raw = GET_NEXT_HOB(NextHob)) {
if (NextHob.Raw == Hob.Raw){
continue;
- }
+ }
//
// See if this is a resource descriptor HOB
//
if (GET_HOB_TYPE (NextHob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
-
+
NextResourceHob = NextHob.ResourceDescriptor;
//
// test if range described in this NextResourceHob is system memory and have the same attribute.
// Note: Here is a assumption that system memory should always be healthy even without test.
- //
+ //
if (NextResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
(((NextResourceHob->ResourceAttribute^ResourceHob->ResourceAttribute)&(~EFI_RESOURCE_ATTRIBUTE_TESTED)) == 0)){
-
+
//
// See if the memory range described in ResourceHob and NextResourceHob is adjacent
//
- if ((ResourceHob->PhysicalStart <= NextResourceHob->PhysicalStart &&
- ResourceHob->PhysicalStart + ResourceHob->ResourceLength >= NextResourceHob->PhysicalStart)||
+ if ((ResourceHob->PhysicalStart <= NextResourceHob->PhysicalStart &&
+ ResourceHob->PhysicalStart + ResourceHob->ResourceLength >= NextResourceHob->PhysicalStart)||
(ResourceHob->PhysicalStart >= NextResourceHob->PhysicalStart&&
ResourceHob->PhysicalStart <= NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength)) {
-
+
MemoryRangeEnd = ((ResourceHob->PhysicalStart + ResourceHob->ResourceLength)>(NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength)) ?
(ResourceHob->PhysicalStart + ResourceHob->ResourceLength):(NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength);
-
- ResourceHob->PhysicalStart = (ResourceHob->PhysicalStart < NextResourceHob->PhysicalStart) ?
+
+ ResourceHob->PhysicalStart = (ResourceHob->PhysicalStart < NextResourceHob->PhysicalStart) ?
ResourceHob->PhysicalStart : NextResourceHob->PhysicalStart;
-
-
+
+
ResourceHob->ResourceLength = (MemoryRangeEnd - ResourceHob->PhysicalStart);
-
+
ResourceHob->ResourceAttribute = ResourceHob->ResourceAttribute & (~EFI_RESOURCE_ATTRIBUTE_TESTED);
//
// Delete the NextResourceHob by marking it as unused.
//
GET_HOB_TYPE (NextHob) = EFI_HOB_TYPE_UNUSED;
-
+
}
}
- }
+ }
}
- }
+ }
}
//
// Some platform is already allocated pages before the HOB re-org. Here to build dedicated resource HOB to describe
// the allocated memory range
//
for (Hob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
- //
- // See if this is a memory allocation HOB
+ //
+ // See if this is a memory allocation HOB
//
if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
MemoryHob = Hob.MemoryAllocation;
@@ -364,7 +364,7 @@ PeiLoadFixAddressHook( // See if this is a resource descriptor HOB
//
if (GET_HOB_TYPE (NextHob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
- NextResourceHob = NextHob.ResourceDescriptor;
+ NextResourceHob = NextHob.ResourceDescriptor;
//
// If range described in this hob is not system memory or heigher than MAX_ADDRESS, ignored.
//
@@ -373,26 +373,26 @@ PeiLoadFixAddressHook( }
//
// If the range describe in memory allocation HOB belongs to the memroy range described by the resource hob
- //
- if (MemoryHob->AllocDescriptor.MemoryBaseAddress >= NextResourceHob->PhysicalStart &&
+ //
+ if (MemoryHob->AllocDescriptor.MemoryBaseAddress >= NextResourceHob->PhysicalStart &&
MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength <= NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength) {
//
// Build seperate resource hob for this allocated range
- //
+ //
if (MemoryHob->AllocDescriptor.MemoryBaseAddress > NextResourceHob->PhysicalStart) {
BuildResourceDescriptorHob (
- EFI_RESOURCE_SYSTEM_MEMORY,
+ EFI_RESOURCE_SYSTEM_MEMORY,
NextResourceHob->ResourceAttribute,
- NextResourceHob->PhysicalStart,
- (MemoryHob->AllocDescriptor.MemoryBaseAddress - NextResourceHob->PhysicalStart)
+ NextResourceHob->PhysicalStart,
+ (MemoryHob->AllocDescriptor.MemoryBaseAddress - NextResourceHob->PhysicalStart)
);
}
if (MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength < NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength) {
BuildResourceDescriptorHob (
- EFI_RESOURCE_SYSTEM_MEMORY,
+ EFI_RESOURCE_SYSTEM_MEMORY,
NextResourceHob->ResourceAttribute,
- MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength,
- (NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength -(MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength))
+ MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength,
+ (NextResourceHob->PhysicalStart + NextResourceHob->ResourceLength -(MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength))
);
}
NextResourceHob->PhysicalStart = MemoryHob->AllocDescriptor.MemoryBaseAddress;
@@ -406,7 +406,7 @@ PeiLoadFixAddressHook( //
// Try to find and validate the TOP address.
- //
+ //
if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) > 0 ) {
//
// The LMFA feature is enabled as load module at fixed absolute address.
@@ -417,11 +417,11 @@ PeiLoadFixAddressHook( // validate the Address. Loop the resource descriptor HOB to make sure the address is in valid memory range
//
if ((TopLoadingAddress & EFI_PAGE_MASK) != 0) {
- DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address 0x%lx is invalid since top address should be page align. \n", TopLoadingAddress));
- ASSERT (FALSE);
+ DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address 0x%lx is invalid since top address should be page align. \n", TopLoadingAddress));
+ ASSERT (FALSE);
}
//
- // Search for a memory region that is below MAX_ADDRESS and in which TopLoadingAddress lies
+ // Search for a memory region that is below MAX_ADDRESS and in which TopLoadingAddress lies
//
for (Hob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
//
@@ -432,61 +432,61 @@ PeiLoadFixAddressHook( ResourceHob = Hob.ResourceDescriptor;
//
// See if this resource descrior HOB describes tested system memory below MAX_ADDRESS
- //
+ //
if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
ResourceHob->PhysicalStart + ResourceHob->ResourceLength <= MAX_ADDRESS) {
//
// See if Top address specified by user is valid.
//
- if (ResourceHob->PhysicalStart + TotalReservedMemorySize < TopLoadingAddress &&
- (ResourceHob->PhysicalStart + ResourceHob->ResourceLength - MINIMUM_INITIAL_MEMORY_SIZE) >= TopLoadingAddress &&
+ if (ResourceHob->PhysicalStart + TotalReservedMemorySize < TopLoadingAddress &&
+ (ResourceHob->PhysicalStart + ResourceHob->ResourceLength - MINIMUM_INITIAL_MEMORY_SIZE) >= TopLoadingAddress &&
PeiLoadFixAddressIsMemoryRangeAvailable(PrivateData, ResourceHob)) {
- CurrentResourceHob = ResourceHob;
+ CurrentResourceHob = ResourceHob;
CurrentHob = Hob;
break;
}
}
- }
- }
+ }
+ }
if (CurrentResourceHob != NULL) {
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO:Top Address 0x%lx is valid \n", TopLoadingAddress));
- TopLoadingAddress += MINIMUM_INITIAL_MEMORY_SIZE;
+ TopLoadingAddress += MINIMUM_INITIAL_MEMORY_SIZE;
} else {
- DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address 0x%lx is invalid \n", TopLoadingAddress));
- DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:The recommended Top Address for the platform is: \n"));
+ DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address 0x%lx is invalid \n", TopLoadingAddress));
+ DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:The recommended Top Address for the platform is: \n"));
//
// Print the recomended Top address range.
- //
+ //
for (Hob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
//
// See if this is a resource descriptor HOB
//
if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
-
+
ResourceHob = Hob.ResourceDescriptor;
//
// See if this resource descrior HOB describes tested system memory below MAX_ADDRESS
- //
+ //
if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
ResourceHob->PhysicalStart + ResourceHob->ResourceLength <= MAX_ADDRESS) {
//
// See if Top address specified by user is valid.
//
if (ResourceHob->ResourceLength > TotalReservedMemorySize && PeiLoadFixAddressIsMemoryRangeAvailable(PrivateData, ResourceHob)) {
- DEBUG ((EFI_D_INFO, "(0x%lx, 0x%lx)\n",
- (ResourceHob->PhysicalStart + TotalReservedMemorySize -MINIMUM_INITIAL_MEMORY_SIZE),
- (ResourceHob->PhysicalStart + ResourceHob->ResourceLength -MINIMUM_INITIAL_MEMORY_SIZE)
- ));
+ DEBUG ((EFI_D_INFO, "(0x%lx, 0x%lx)\n",
+ (ResourceHob->PhysicalStart + TotalReservedMemorySize -MINIMUM_INITIAL_MEMORY_SIZE),
+ (ResourceHob->PhysicalStart + ResourceHob->ResourceLength -MINIMUM_INITIAL_MEMORY_SIZE)
+ ));
}
}
}
- }
+ }
//
- // Assert here
+ // Assert here
//
- ASSERT (FALSE);
- return;
- }
+ ASSERT (FALSE);
+ return;
+ }
} else {
//
// The LMFA feature is enabled as load module at fixed offset relative to TOLM
@@ -497,15 +497,15 @@ PeiLoadFixAddressHook( //
for (Hob.Raw = PrivateData->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
//
- // See if this is a resource descriptor HOB
+ // See if this is a resource descriptor HOB
//
if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
-
- ResourceHob = Hob.ResourceDescriptor;
+
+ ResourceHob = Hob.ResourceDescriptor;
//
// See if this resource descrior HOB describes tested system memory below MAX_ADDRESS
//
- if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
+ if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&
ResourceHob->PhysicalStart + ResourceHob->ResourceLength <= MAX_ADDRESS &&
ResourceHob->ResourceLength > TotalReservedMemorySize && PeiLoadFixAddressIsMemoryRangeAvailable(PrivateData, ResourceHob)) {
//
@@ -517,26 +517,26 @@ PeiLoadFixAddressHook( HighAddress = CurrentResourceHob->PhysicalStart;
}
}
- }
+ }
}
if (CurrentResourceHob == NULL) {
- DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:The System Memory is too small\n"));
+ DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:The System Memory is too small\n"));
//
- // Assert here
+ // Assert here
//
ASSERT (FALSE);
- return;
+ return;
} else {
- TopLoadingAddress = CurrentResourceHob->PhysicalStart + CurrentResourceHob->ResourceLength ;
- }
+ TopLoadingAddress = CurrentResourceHob->PhysicalStart + CurrentResourceHob->ResourceLength ;
+ }
}
-
+
if (CurrentResourceHob != NULL) {
//
// rebuild resource HOB for PEI memmory and reserved memory
//
BuildResourceDescriptorHob (
- EFI_RESOURCE_SYSTEM_MEMORY,
+ EFI_RESOURCE_SYSTEM_MEMORY,
(
EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
@@ -546,15 +546,15 @@ PeiLoadFixAddressHook( EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
),
- (TopLoadingAddress - TotalReservedMemorySize),
- TotalReservedMemorySize
+ (TopLoadingAddress - TotalReservedMemorySize),
+ TotalReservedMemorySize
);
//
// rebuild resource for the remain memory if necessary
//
if (CurrentResourceHob->PhysicalStart < TopLoadingAddress - TotalReservedMemorySize) {
BuildResourceDescriptorHob (
- EFI_RESOURCE_SYSTEM_MEMORY,
+ EFI_RESOURCE_SYSTEM_MEMORY,
(
EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
@@ -563,13 +563,13 @@ PeiLoadFixAddressHook( EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
),
- CurrentResourceHob->PhysicalStart,
- (TopLoadingAddress - TotalReservedMemorySize - CurrentResourceHob->PhysicalStart)
+ CurrentResourceHob->PhysicalStart,
+ (TopLoadingAddress - TotalReservedMemorySize - CurrentResourceHob->PhysicalStart)
);
}
if (CurrentResourceHob->PhysicalStart + CurrentResourceHob->ResourceLength > TopLoadingAddress ) {
BuildResourceDescriptorHob (
- EFI_RESOURCE_SYSTEM_MEMORY,
+ EFI_RESOURCE_SYSTEM_MEMORY,
(
EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
@@ -578,21 +578,21 @@ PeiLoadFixAddressHook( EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
),
- TopLoadingAddress,
- (CurrentResourceHob->PhysicalStart + CurrentResourceHob->ResourceLength - TopLoadingAddress)
+ TopLoadingAddress,
+ (CurrentResourceHob->PhysicalStart + CurrentResourceHob->ResourceLength - TopLoadingAddress)
);
}
//
// Delete CurrentHob by marking it as unused since the the memory range described by is rebuilt.
//
- GET_HOB_TYPE (CurrentHob) = EFI_HOB_TYPE_UNUSED;
+ GET_HOB_TYPE (CurrentHob) = EFI_HOB_TYPE_UNUSED;
}
//
// Cache the top address for Loading Module at Fixed Address feature
//
PrivateData->LoadModuleAtFixAddressTopAddress = TopLoadingAddress - MINIMUM_INITIAL_MEMORY_SIZE;
- DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Top address = 0x%lx\n", PrivateData->LoadModuleAtFixAddressTopAddress));
+ DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Top address = 0x%lx\n", PrivateData->LoadModuleAtFixAddressTopAddress));
//
// reinstall the PEI memory relative to TopLoadingAddress
//
@@ -729,7 +729,7 @@ PeiCheckAndSwitchStack ( ASSERT (NewStackSize >= SecCoreData->StackSize);
//
- // Calculate stack offset and heap offset between temporary memory and new permement
+ // Calculate stack offset and heap offset between temporary memory and new permement
// memory seperately.
//
TopOfOldStack = (UINTN)SecCoreData->StackBase + SecCoreData->StackSize;
@@ -796,9 +796,9 @@ PeiCheckAndSwitchStack ( }
//
- // Temporary Ram Support PPI is provided by platform, it will copy
+ // Temporary Ram Support PPI is provided by platform, it will copy
// temporary memory to permanent memory and do stack switching.
- // After invoking Temporary Ram Support PPI, the following code's
+ // After invoking Temporary Ram Support PPI, the following code's
// stack is in permanent memory.
//
TemporaryRamSupportPpi->TemporaryRamMigration (
@@ -961,7 +961,7 @@ PeiDispatcher ( EFI_PEI_FILE_HANDLE SaveCurrentFileHandle;
EFI_FV_FILE_INFO FvFileInfo;
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
PeiServices = (CONST EFI_PEI_SERVICES **) &Private->Ps;
PeimEntryPoint = NULL;
PeimFileHandle = NULL;
@@ -1028,7 +1028,7 @@ PeiDispatcher ( //
do {
//
- // In case that reenter PeiCore happens, the last pass record is still available.
+ // In case that reenter PeiCore happens, the last pass record is still available.
//
if (!Private->PeimDispatcherReenter) {
Private->PeimNeedingDispatch = FALSE;
@@ -1036,18 +1036,18 @@ PeiDispatcher ( } else {
Private->PeimDispatcherReenter = FALSE;
}
-
+
for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {
CoreFvHandle = FindNextCoreFvHandle (Private, FvCount);
ASSERT (CoreFvHandle != NULL);
-
+
//
// If the FV has corresponding EFI_PEI_FIRMWARE_VOLUME_PPI instance, then dispatch it.
//
if (CoreFvHandle->FvPpi == NULL) {
continue;
}
-
+
Private->CurrentPeimFvCount = FvCount;
if (Private->CurrentPeimCount == 0) {
@@ -1297,7 +1297,7 @@ DepexSatisfied ( } else {
DEBUG ((DEBUG_DISPATCH, "Evaluate PEI DEPEX for FFS(%g)\n", &FileInfo.FileName));
}
-
+
if (PeimCount < Private->AprioriCount) {
//
// If its in the A priori file then we set Depex to TRUE
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index 4150b338b2..65c4855497 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -1,15 +1,15 @@ /** @file
Pei Core Firmware File System service routines.
-
+
Copyright (c) 2015 HP Development Company, L.P.
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -19,12 +19,12 @@ EFI_PEI_NOTIFY_DESCRIPTOR mNotifyOnFvInfoList[] = { {
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
&gEfiPeiFirmwareVolumeInfoPpiGuid,
- FirmwareVolmeInfoPpiNotifyCallback
+ FirmwareVolmeInfoPpiNotifyCallback
},
{
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiFirmwareVolumeInfo2PpiGuid,
- FirmwareVolmeInfoPpiNotifyCallback
+ FirmwareVolmeInfoPpiNotifyCallback
}
};
@@ -61,7 +61,7 @@ PEI_FW_VOL_INSTANCE mPeiFfs3FwVol = { EFI_PEI_FIRMWARE_VOLUME_PPI_REVISION
}
};
-
+
EFI_PEI_PPI_DESCRIPTOR mPeiFfs2FvPpiList = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiFirmwareFileSystem2Guid,
@@ -136,7 +136,7 @@ FfsAttributes2FvFileAttributes ( in the Attributes field.
@param FfsHeader Pointer to FFS File Header.
- @retval EFI_FFS_FILE_STATE File state is set by the highest none zero bit
+ @retval EFI_FFS_FILE_STATE File state is set by the highest none zero bit
in the header State field.
**/
EFI_FFS_FILE_STATE
@@ -153,7 +153,7 @@ GetFileState( if (ErasePolarity != 0) {
FileState = (EFI_FFS_FILE_STATE)~FileState;
}
-
+
//
// Get file state set by its highest none zero bit.
//
@@ -163,7 +163,7 @@ GetFileState( }
return HighestBit;
-}
+}
/**
Calculates the checksum of the header of a file.
@@ -206,7 +206,7 @@ CalculateHeaderChecksum ( Find FV handler according to FileHandle in that FV.
@param FileHandle Handle of file image
-
+
@return Pointer to instance of PEI_CORE_FV_HANDLE.
**/
PEI_CORE_FV_HANDLE*
@@ -221,10 +221,10 @@ FileHandleToVolume ( PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer ());
BestIndex = PrivateData->FvCount;
-
+
//
// Find the best matched FV image that includes this FileHandle.
- // FV may include the child FV, and they are in the same continuous space.
+ // FV may include the child FV, and they are in the same continuous space.
// If FileHandle is from the child FV, the updated logic can find its matched FV.
//
for (Index = 0; Index < PrivateData->FvCount; Index++) {
@@ -253,8 +253,8 @@ FileHandleToVolume ( FFS volume as defined by SearchType. The search starts from FileHeader inside
the Firmware Volume defined by FwVolHeader.
If SearchType is EFI_FV_FILETYPE_ALL, the first FFS file will return without check its file type.
- If SearchType is PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE,
- the first PEIM, or COMBINED PEIM or FV file type FFS file will return.
+ If SearchType is PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE,
+ the first PEIM, or COMBINED PEIM or FV file type FFS file will return.
@param FvHandle Pointer to the FV header of the volume to search
@param FileName File name
@@ -288,7 +288,7 @@ FindFileEx ( UINT8 FileState;
UINT8 DataCheckSum;
BOOLEAN IsFfs3Fv;
-
+
//
// Convert the handle of FV to FV header for memory-mapped firmware volume
//
@@ -303,7 +303,7 @@ FindFileEx ( } else {
ErasePolarity = 0;
}
-
+
//
// If FileHeader is not specified (NULL) or FileName is not NULL,
// start with the first file in the firmware volume. Otherwise,
@@ -336,13 +336,13 @@ FindFileEx ( FileOccupiedSize = GET_OCCUPIED_SIZE (FileLength, 8);
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)*FileHeader + FileOccupiedSize);
}
-
+
FileOffset = (UINT32) ((UINT8 *)FfsFileHeader - (UINT8 *)FwVolHeader);
ASSERT (FileOffset <= 0xFFFFFFFF);
while (FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {
//
- // Get FileState which is the highest bit of the State
+ // Get FileState which is the highest bit of the State
//
FileState = GetFileState (ErasePolarity, FfsFileHeader);
switch (FileState) {
@@ -360,7 +360,7 @@ FindFileEx ( FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER));
}
break;
-
+
case EFI_FILE_DATA_VALID:
case EFI_FILE_MARKED_FOR_UPDATE:
if (CalculateHeaderChecksum (FfsFileHeader) != 0) {
@@ -404,29 +404,29 @@ FindFileEx ( return EFI_SUCCESS;
}
} else if (SearchType == PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE) {
- if ((FfsFileHeader->Type == EFI_FV_FILETYPE_PEIM) ||
+ if ((FfsFileHeader->Type == EFI_FV_FILETYPE_PEIM) ||
(FfsFileHeader->Type == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER) ||
- (FfsFileHeader->Type == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE)) {
-
+ (FfsFileHeader->Type == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE)) {
+
*FileHeader = FfsFileHeader;
return EFI_SUCCESS;
} else if (AprioriFile != NULL) {
if (FfsFileHeader->Type == EFI_FV_FILETYPE_FREEFORM) {
if (CompareGuid (&FfsFileHeader->Name, &gPeiAprioriFileNameGuid)) {
*AprioriFile = FfsFileHeader;
- }
- }
+ }
+ }
}
- } else if (((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) &&
- (FfsFileHeader->Type != EFI_FV_FILETYPE_FFS_PAD)) {
+ } else if (((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) &&
+ (FfsFileHeader->Type != EFI_FV_FILETYPE_FFS_PAD)) {
*FileHeader = FfsFileHeader;
return EFI_SUCCESS;
}
- FileOffset += FileOccupiedSize;
+ FileOffset += FileOccupiedSize;
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)FfsFileHeader + FileOccupiedSize);
break;
-
+
case EFI_FILE_DELETED:
if (IS_FFS_FILE2 (FfsFileHeader)) {
if (!IsFfs3Fv) {
@@ -445,11 +445,11 @@ FindFileEx ( default:
*FileHeader = NULL;
return EFI_NOT_FOUND;
- }
+ }
}
-
+
*FileHeader = NULL;
- return EFI_NOT_FOUND;
+ return EFI_NOT_FOUND;
}
/**
@@ -458,7 +458,7 @@ FindFileEx ( @param PrivateData - Pointer to PEI_CORE_INSTANCE.
@param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
**/
-VOID
+VOID
PeiInitializeFv (
IN PEI_CORE_INSTANCE *PrivateData,
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData
@@ -468,7 +468,7 @@ PeiInitializeFv ( EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
EFI_PEI_FV_HANDLE FvHandle;
EFI_FIRMWARE_VOLUME_HEADER *BfvHeader;
-
+
//
// Install FV_PPI for FFS2 file system.
//
@@ -480,7 +480,7 @@ PeiInitializeFv ( PeiServicesInstallPpi (&mPeiFfs3FvPpiList);
BfvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SecCoreData->BootFirmwareVolumeBase;
-
+
//
// The FV_PPI in BFV's format should be installed.
//
@@ -491,7 +491,7 @@ PeiInitializeFv ( (VOID**)&FvPpi
);
ASSERT_EFI_ERROR (Status);
-
+
//
// Get handle of BFV
//
@@ -511,15 +511,15 @@ PeiInitializeFv ( PrivateData->Fv[PrivateData->FvCount].FvHandle = FvHandle;
PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = 0;
DEBUG ((
- EFI_D_INFO,
- "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
- (UINT32) PrivateData->FvCount,
- (VOID *) BfvHeader,
+ EFI_D_INFO,
+ "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
+ (UINT32) PrivateData->FvCount,
+ (VOID *) BfvHeader,
(UINT32) BfvHeader->FvLength,
FvHandle
- ));
+ ));
PrivateData->FvCount ++;
-
+
//
// Post a call-back for the FvInfoPPI and FvInfo2PPI services to expose
// additional Fvs to PeiCore.
@@ -528,7 +528,7 @@ PeiInitializeFv ( ASSERT_EFI_ERROR (Status);
}
-
+
/**
Process Firmware Volum Information once FvInfoPPI or FvInfo2PPI install.
The FV Info will be registered into PeiCore private data structure.
@@ -619,7 +619,7 @@ FirmwareVolmeInfoPpiNotifyCallback ( if (PrivateData->Fv[FvIndex].FvHandle == FvHandle) {
if (IsFvInfo2 && (FvInfo2Ppi.AuthenticationStatus != PrivateData->Fv[FvIndex].AuthenticationStatus)) {
PrivateData->Fv[FvIndex].AuthenticationStatus = FvInfo2Ppi.AuthenticationStatus;
- DEBUG ((EFI_D_INFO, "Update AuthenticationStatus of the %dth FV to 0x%x!\n", FvIndex, FvInfo2Ppi.AuthenticationStatus));
+ DEBUG ((EFI_D_INFO, "Update AuthenticationStatus of the %dth FV to 0x%x!\n", FvIndex, FvInfo2Ppi.AuthenticationStatus));
}
DEBUG ((EFI_D_INFO, "The Fv %p has already been processed!\n", FvInfo2Ppi.FvInfo));
return EFI_SUCCESS;
@@ -641,17 +641,17 @@ FirmwareVolmeInfoPpiNotifyCallback ( PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = FvInfo2Ppi.AuthenticationStatus;
CurFvCount = PrivateData->FvCount;
DEBUG ((
- EFI_D_INFO,
- "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
+ EFI_D_INFO,
+ "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
(UINT32) CurFvCount,
- (VOID *) FvInfo2Ppi.FvInfo,
+ (VOID *) FvInfo2Ppi.FvInfo,
FvInfo2Ppi.FvInfoSize,
FvHandle
- ));
+ ));
PrivateData->FvCount ++;
//
- // Scan and process the new discoveried FV for EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
+ // Scan and process the new discoveried FV for EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
//
FileHandle = NULL;
do {
@@ -676,17 +676,17 @@ FirmwareVolmeInfoPpiNotifyCallback ( continue;
}
}
-
+
DEBUG ((EFI_D_INFO, "Found firmware volume Image File %p in FV[%d] %p\n", FileHandle, CurFvCount, FvHandle));
ProcessFvFile (PrivateData, &PrivateData->Fv[CurFvCount], FileHandle);
}
} while (FileHandle != NULL);
} else {
DEBUG ((EFI_D_ERROR, "Fail to process FV %p because no corresponding EFI_FIRMWARE_VOLUME_PPI is found!\n", FvInfo2Ppi.FvInfo));
-
+
AddUnknownFormatFvInfo (PrivateData, &FvInfo2Ppi);
}
-
+
return EFI_SUCCESS;
}
@@ -699,7 +699,7 @@ FirmwareVolmeInfoPpiNotifyCallback ( @return TRUE The GuidedSectionGuid could be identified, and the pointer to
the Guided Section Extraction Ppi will be returned to *GuidedSectionExtraction.
- @return FALSE The GuidedSectionGuid could not be identified, or
+ @return FALSE The GuidedSectionGuid could not be identified, or
the Guided Section Extraction Ppi has not been installed yet.
**/
@@ -740,10 +740,10 @@ VerifyGuidedSectionGuid ( }
/**
- Go through the file to search SectionType section.
- Search within encapsulation sections (compression and GUIDed) recursively,
+ Go through the file to search SectionType section.
+ Search within encapsulation sections (compression and GUIDed) recursively,
until the match section is found.
-
+
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@param SectionType Filter to find only section of this type.
@param SectionInstance Pointer to the filter to find the specific instance of section.
@@ -862,8 +862,8 @@ ProcessSection ( PeiServices,
SectionType,
SectionInstance,
- PpiOutput,
- PpiOutputSize,
+ PpiOutput,
+ PpiOutputSize,
&TempOutputBuffer,
&TempAuthenticationStatus,
IsFfs3Fv
@@ -946,8 +946,8 @@ ProcessSection ( PeiServices,
SectionType,
SectionInstance,
- PpiOutput,
- PpiOutputSize,
+ PpiOutput,
+ PpiOutputSize,
&TempOutputBuffer,
&TempAuthenticationStatus,
IsFfs3Fv
@@ -975,7 +975,7 @@ ProcessSection ( ParsedLength += SectionLength;
Section = (EFI_COMMON_SECTION_HEADER *)((UINT8 *)Section + SectionLength);
}
-
+
return EFI_NOT_FOUND;
}
@@ -1003,12 +1003,12 @@ PeiFfsFindSectionData ( )
{
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
CoreFvHandle = FileHandleToVolume (FileHandle);
if ((CoreFvHandle == NULL) || (CoreFvHandle->FvPpi == NULL)) {
return EFI_NOT_FOUND;
}
-
+
return CoreFvHandle->FvPpi->FindSectionByType (CoreFvHandle->FvPpi, SectionType, FileHandle, SectionData);
}
@@ -1038,7 +1038,7 @@ PeiFfsFindSectionData3 ( )
{
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
CoreFvHandle = FileHandleToVolume (FileHandle);
if ((CoreFvHandle == NULL) || (CoreFvHandle->FvPpi == NULL)) {
return EFI_NOT_FOUND;
@@ -1081,9 +1081,9 @@ PeiFfsFindNextFile ( )
{
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
CoreFvHandle = FvHandleToCoreHandle (FvHandle);
-
+
//
// To make backward compatiblity, if can not find corresponding the handle of FV
// then treat FV as build-in FFS2/FFS3 format and memory mapped FV that FV handle is pointed
@@ -1091,12 +1091,12 @@ PeiFfsFindNextFile ( //
if ((CoreFvHandle == NULL) && FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {
return FindFileEx (FvHandle, NULL, SearchType, FileHandle, NULL);
- }
-
+ }
+
if ((CoreFvHandle == NULL) || CoreFvHandle->FvPpi == NULL) {
return EFI_NOT_FOUND;
}
-
+
return CoreFvHandle->FvPpi->FindFileByType (CoreFvHandle->FvPpi, SearchType, FvHandle, FileHandle);
}
@@ -1114,7 +1114,7 @@ PeiFfsFindNextFile ( @retval EFI_SUCCESS The volume was found.
**/
-EFI_STATUS
+EFI_STATUS
EFIAPI
PeiFfsFindNextVolume (
IN CONST EFI_PEI_SERVICES **PeiServices,
@@ -1124,21 +1124,21 @@ PeiFfsFindNextVolume ( {
PEI_CORE_INSTANCE *Private;
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
if (VolumeHandle == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
Private = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
-
+
CoreFvHandle = FindNextCoreFvHandle (Private, Instance);
if (CoreFvHandle == NULL) {
*VolumeHandle = NULL;
return EFI_NOT_FOUND;
}
-
+
*VolumeHandle = CoreFvHandle->FvHandle;
-
+
return EFI_SUCCESS;
}
@@ -1148,7 +1148,7 @@ PeiFfsFindNextVolume ( @param FileName A pointer to the name of the file to find within the firmware volume.
@param VolumeHandle The firmware volume to search
- @param FileHandle Upon exit, points to the found file's handle
+ @param FileHandle Upon exit, points to the found file's handle
or NULL if it could not be found.
@retval EFI_SUCCESS File was found.
@@ -1157,7 +1157,7 @@ PeiFfsFindNextVolume ( **/
EFI_STATUS
-EFIAPI
+EFIAPI
PeiFfsFindFileByName (
IN CONST EFI_GUID *FileName,
IN EFI_PEI_FV_HANDLE VolumeHandle,
@@ -1165,16 +1165,16 @@ PeiFfsFindFileByName ( )
{
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
if ((VolumeHandle == NULL) || (FileName == NULL) || (FileHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
-
+
CoreFvHandle = FvHandleToCoreHandle (VolumeHandle);
if ((CoreFvHandle == NULL) || (CoreFvHandle->FvPpi == NULL)) {
return EFI_NOT_FOUND;
}
-
+
return CoreFvHandle->FvPpi->FindFileByName (CoreFvHandle->FvPpi, FileName, &VolumeHandle, FileHandle);
}
@@ -1190,14 +1190,14 @@ PeiFfsFindFileByName ( **/
EFI_STATUS
-EFIAPI
+EFIAPI
PeiFfsGetFileInfo (
IN EFI_PEI_FILE_HANDLE FileHandle,
OUT EFI_FV_FILE_INFO *FileInfo
)
{
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
if ((FileHandle == NULL) || (FileInfo == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1225,14 +1225,14 @@ PeiFfsGetFileInfo ( **/
EFI_STATUS
-EFIAPI
+EFIAPI
PeiFfsGetFileInfo2 (
IN EFI_PEI_FILE_HANDLE FileHandle,
OUT EFI_FV_FILE_INFO2 *FileInfo
)
{
PEI_CORE_FV_HANDLE *CoreFvHandle;
-
+
if ((FileHandle == NULL) || (FileInfo == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1274,24 +1274,24 @@ PeiFfsGetFileInfo2 ( **/
EFI_STATUS
-EFIAPI
+EFIAPI
PeiFfsGetVolumeInfo (
IN EFI_PEI_FV_HANDLE VolumeHandle,
OUT EFI_FV_INFO *VolumeInfo
)
{
PEI_CORE_FV_HANDLE *CoreHandle;
-
+
if ((VolumeInfo == NULL) || (VolumeHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
-
+
CoreHandle = FvHandleToCoreHandle (VolumeHandle);
-
+
if ((CoreHandle == NULL) || (CoreHandle->FvPpi == NULL)) {
return EFI_INVALID_PARAMETER;
}
-
+
return CoreHandle->FvPpi->GetVolumeInfo (CoreHandle->FvPpi, VolumeHandle, VolumeInfo);
}
@@ -1369,7 +1369,7 @@ GetFvUsedSize ( @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
@retval EFI_SECURITY_VIOLATION Image is illegal
@retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
-
+
**/
EFI_STATUS
ProcessFvFile (
@@ -1410,7 +1410,7 @@ ProcessFvFile ( ParentFvHandle = ParentFvCoreHandle->FvHandle;
ParentFvPpi = ParentFvCoreHandle->FvPpi;
-
+
//
// Find FvImage in FvFile
//
@@ -1492,10 +1492,10 @@ ProcessFvFile ( Status = ParentFvPpi->GetVolumeInfo (ParentFvPpi, ParentFvHandle, &ParentFvImageInfo);
ASSERT_EFI_ERROR (Status);
-
+
Status = ParentFvPpi->GetFileInfo (ParentFvPpi, ParentFvFileHandle, &FileInfo);
ASSERT_EFI_ERROR (Status);
-
+
//
// Install FvInfo(2) Ppi
// NOTE: FvInfo2 must be installed before FvInfo so that recursive processing of encapsulated
@@ -1562,15 +1562,15 @@ ProcessFvFile ( buffer which contains the necessary information for creating
the firmware volume handle. Normally, these values are derived
from the EFI_FIRMWARE_VOLUME_INFO_PPI.
-
-
+
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param Buffer Points to the start of the buffer.
@param BufferSize Size of the buffer.
@param FvHandle Points to the returned firmware volume
handle. The firmware volume handle must
- be unique within the system.
+ be unique within the system.
@retval EFI_SUCCESS Firmware volume handle created.
@retval EFI_VOLUME_CORRUPTED Volume was corrupt.
@@ -1586,19 +1586,19 @@ PeiFfsFvPpiProcessVolume ( )
{
EFI_STATUS Status;
-
+
ASSERT (FvHandle != NULL);
-
+
if (Buffer == NULL) {
return EFI_VOLUME_CORRUPTED;
}
-
+
//
// The build-in EFI_PEI_FIRMWARE_VOLUME_PPI for FFS2/FFS3 support memory-mapped
// FV image and the handle is pointed to Fv image's buffer.
//
*FvHandle = (EFI_PEI_FV_HANDLE) Buffer;
-
+
//
// Do verify for given FV buffer.
//
@@ -1609,12 +1609,12 @@ PeiFfsFvPpiProcessVolume ( }
return EFI_SUCCESS;
-}
+}
/**
Finds the next file of the specified type.
- This service enables PEI modules to discover additional firmware files.
+ This service enables PEI modules to discover additional firmware files.
The FileHandle must be unique within the system.
@param This Points to this instance of the
@@ -1641,13 +1641,13 @@ PeiFfsFvPpiFindFileByType ( IN EFI_PEI_FV_HANDLE FvHandle,
IN OUT EFI_PEI_FILE_HANDLE *FileHandle
)
-{
+{
return FindFileEx (FvHandle, NULL, SearchType, FileHandle, NULL);
}
/**
- Find a file within a volume by its name.
-
+ Find a file within a volume by its name.
+
This service searches for files with a specific name, within
either the specified firmware volume or all firmware volumes.
@@ -1676,28 +1676,28 @@ PeiFfsFvPpiFindFileByName ( IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
IN CONST EFI_GUID *FileName,
IN EFI_PEI_FV_HANDLE *FvHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
+ OUT EFI_PEI_FILE_HANDLE *FileHandle
)
{
EFI_STATUS Status;
PEI_CORE_INSTANCE *PrivateData;
UINTN Index;
-
+
if ((FvHandle == NULL) || (FileName == NULL) || (FileHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
-
+
if (*FvHandle != NULL) {
Status = FindFileEx (*FvHandle, FileName, 0, FileHandle, NULL);
if (Status == EFI_NOT_FOUND) {
*FileHandle = NULL;
}
- } else {
+ } else {
//
// If *FvHandle = NULL, so search all FV for given filename
//
Status = EFI_NOT_FOUND;
-
+
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer());
for (Index = 0; Index < PrivateData->FvCount; Index ++) {
//
@@ -1712,17 +1712,17 @@ PeiFfsFvPpiFindFileByName ( }
}
}
-
- return Status;
-}
+
+ return Status;
+}
/**
Returns information about a specific file.
This function returns information about a specific
file, including its file name, type, attributes, starting
- address and size.
-
+ address and size.
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param FileHandle Handle of the file.
@@ -1733,13 +1733,13 @@ PeiFfsFvPpiFindFileByName ( @retval EFI_INVALID_PARAMETER If FileHandle does not
represent a valid file.
@retval EFI_INVALID_PARAMETER If FileInfo is NULL.
-
-**/
+
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiGetFileInfo (
- IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
- IN EFI_PEI_FILE_HANDLE FileHandle,
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
OUT EFI_FV_FILE_INFO *FileInfo
)
{
@@ -1770,14 +1770,14 @@ PeiFfsFvPpiGetFileInfo ( }
//
- // Get FileState which is the highest bit of the State
+ // Get FileState which is the highest bit of the State
//
FileState = GetFileState (ErasePolarity, (EFI_FFS_FILE_HEADER*)FileHandle);
switch (FileState) {
case EFI_FILE_DATA_VALID:
case EFI_FILE_MARKED_FOR_UPDATE:
- break;
+ break;
default:
return EFI_INVALID_PARAMETER;
}
@@ -1826,8 +1826,8 @@ PeiFfsFvPpiGetFileInfo ( EFI_STATUS
EFIAPI
PeiFfsFvPpiGetFileInfo2 (
- IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
- IN EFI_PEI_FILE_HANDLE FileHandle,
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
OUT EFI_FV_FILE_INFO2 *FileInfo
)
{
@@ -1856,7 +1856,7 @@ PeiFfsFvPpiGetFileInfo2 ( /**
This function returns information about the firmware volume.
-
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param FvHandle Handle to the firmware handle.
@@ -1867,12 +1867,12 @@ PeiFfsFvPpiGetFileInfo2 ( @retval EFI_INVALID_PARAMETER FvHandle does not indicate a valid
firmware volume or VolumeInfo is NULL.
-**/
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiGetVolumeInfo (
- IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
- IN EFI_PEI_FV_HANDLE FvHandle,
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_PEI_FV_HANDLE FvHandle,
OUT EFI_FV_INFO *VolumeInfo
)
{
@@ -1882,10 +1882,10 @@ PeiFfsFvPpiGetVolumeInfo ( if ((VolumeInfo == NULL) || (FvHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
-
+
//
- // VolumeHandle may not align at 8 byte,
- // but FvLength is UINT64 type, which requires FvHeader align at least 8 byte.
+ // VolumeHandle may not align at 8 byte,
+ // but FvLength is UINT64 type, which requires FvHeader align at least 8 byte.
// So, Copy FvHeader into the local FvHeader structure.
//
CopyMem (&FwVolHeader, FvHandle, sizeof (EFI_FIRMWARE_VOLUME_HEADER));
@@ -1907,16 +1907,16 @@ PeiFfsFvPpiGetVolumeInfo ( FwVolExHeaderInfo = (EFI_FIRMWARE_VOLUME_EXT_HEADER*)(((UINT8 *)FvHandle) + FwVolHeader.ExtHeaderOffset);
CopyMem (&VolumeInfo->FvName, &FwVolExHeaderInfo->FvName, sizeof(EFI_GUID));
}
-
- return EFI_SUCCESS;
-}
+
+ return EFI_SUCCESS;
+}
/**
Find the next matching section in the firmware file.
-
+
This service enables PEI modules to discover sections
of a given type within a valid file.
-
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param SearchType A filter to find only sections of this
@@ -1925,7 +1925,7 @@ PeiFfsFvPpiGetVolumeInfo ( search.
@param SectionData Updated upon return to point to the
section found.
-
+
@retval EFI_SUCCESS Section was found.
@retval EFI_NOT_FOUND Section of the specified type was not
found. SectionData contains NULL.
@@ -2021,8 +2021,8 @@ PeiFfsFvPpiFindSectionByType2 ( GetPeiServicesTablePointer (),
SearchType,
&Instance,
- Section,
- FileSize,
+ Section,
+ FileSize,
SectionData,
&ExtractedAuthenticationStatus,
FwVolInstance->IsFfs3Fv
@@ -2038,11 +2038,11 @@ PeiFfsFvPpiFindSectionByType2 ( /**
Convert the handle of FV to pointer of corresponding PEI_CORE_FV_HANDLE.
-
+
@param FvHandle The handle of a FV.
-
+
@retval NULL if can not find.
- @return Pointer of corresponding PEI_CORE_FV_HANDLE.
+ @return Pointer of corresponding PEI_CORE_FV_HANDLE.
**/
PEI_CORE_FV_HANDLE *
FvHandleToCoreHandle (
@@ -2051,25 +2051,25 @@ FvHandleToCoreHandle ( {
UINTN Index;
PEI_CORE_INSTANCE *PrivateData;
-
- PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer());
+
+ PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer());
for (Index = 0; Index < PrivateData->FvCount; Index ++) {
if (FvHandle == PrivateData->Fv[Index].FvHandle) {
return &PrivateData->Fv[Index];
}
}
-
+
return NULL;
-}
+}
/**
Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
-
+
This routine also will install FvInfo ppi for FV hob in PI ways.
-
+
@param Private Pointer of PEI_CORE_INSTANCE
@param Instance The index of FV want to be searched.
-
+
@return Instance of PEI_CORE_FV_HANDLE.
**/
PEI_CORE_FV_HANDLE *
@@ -2081,7 +2081,7 @@ FindNextCoreFvHandle ( UINTN Index;
BOOLEAN Match;
EFI_HOB_FIRMWARE_VOLUME *FvHob;
-
+
//
// Handle Framework FvHob and Install FvInfo Ppi for it.
//
@@ -2101,7 +2101,7 @@ FindNextCoreFvHandle ( break;
}
}
-
+
//
// Search whether FvHob has been cached into PeiCore's Unknown FV database.
// If found, no need install new FvInfoPpi for it.
@@ -2129,8 +2129,8 @@ FindNextCoreFvHandle ( NULL
);
}
-
- FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength));
+
+ FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength));
}
}
@@ -2140,16 +2140,16 @@ FindNextCoreFvHandle ( }
return &Private->Fv[Instance];
-}
+}
/**
After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
- be re-installed with the instance in permanent memory and all cached FvPpi pointers in
+ be re-installed with the instance in permanent memory and all cached FvPpi pointers in
PrivateData->Fv[] array should be fixed up to be pointed to the one in permanent
memory.
-
+
@param PrivateData Pointer to PEI_CORE_INSTANCE.
-**/
+**/
VOID
PeiReinitializeFv (
IN PEI_CORE_INSTANCE *PrivateData
@@ -2219,17 +2219,17 @@ PeiReinitializeFv ( /**
Report the information for a new discoveried FV in unknown third-party format.
-
+
If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for third-party FV format, but
the FV in this format has been discoveried, then this FV's information will be cached into
PEI_CORE_INSTANCE's UnknownFvInfo array.
Also a notification would be installed for unknown third-party FV format guid, if EFI_PEI_FIRMWARE_VOLUME_PPI
is installed later by platform's PEIM, the original unknown third-party FV will be processed by
using new installed EFI_PEI_FIRMWARE_VOLUME_PPI.
-
+
@param PrivateData Point to instance of PEI_CORE_INSTANCE
@param FvInfo2Ppi Point to FvInfo2 PPI.
-
+
@retval EFI_OUT_OF_RESOURCES The FV info array in PEI_CORE_INSTANCE has no more spaces.
@retval EFI_SUCCESS Success to add the information for unknown FV.
**/
@@ -2240,14 +2240,14 @@ AddUnknownFormatFvInfo ( )
{
PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv;
-
+
if (PrivateData->UnknownFvInfoCount + 1 >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {
return EFI_OUT_OF_RESOURCES;
}
-
+
NewUnknownFv = &PrivateData->UnknownFvInfo[PrivateData->UnknownFvInfoCount];
PrivateData->UnknownFvInfoCount ++;
-
+
CopyGuid (&NewUnknownFv->FvFormat, &FvInfo2Ppi->FvFormat);
NewUnknownFv->FvInfo = FvInfo2Ppi->FvInfo;
NewUnknownFv->FvInfoSize = FvInfo2Ppi->FvInfoSize;
@@ -2255,23 +2255,23 @@ AddUnknownFormatFvInfo ( NewUnknownFv->NotifyDescriptor.Flags = (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST);
NewUnknownFv->NotifyDescriptor.Guid = &NewUnknownFv->FvFormat;
NewUnknownFv->NotifyDescriptor.Notify = ThirdPartyFvPpiNotifyCallback;
-
+
PeiServicesNotifyPpi (&NewUnknownFv->NotifyDescriptor);
return EFI_SUCCESS;
}
/**
Find the FV information according to third-party FV format guid.
-
+
This routine also will remove the FV information found by given FV format guid from
PrivateData->UnknownFvInfo[].
-
+
@param PrivateData Point to instance of PEI_CORE_INSTANCE
@param Format Point to given FV format guid
@param FvInfo On return, the pointer of FV information buffer
@param FvInfoSize On return, the size of FV information buffer.
@param AuthenticationStatus On return, the authentication status of FV information buffer.
-
+
@retval EFI_NOT_FOUND The FV is not found for new installed EFI_PEI_FIRMWARE_VOLUME_PPI
@retval EFI_SUCCESS Success to find a FV which could be processed by new installed EFI_PEI_FIRMWARE_VOLUME_PPI.
**/
@@ -2293,15 +2293,15 @@ FindUnknownFormatFvInfo ( break;
}
}
-
+
if (Index == PrivateData->UnknownFvInfoCount) {
return EFI_NOT_FOUND;
}
-
+
*FvInfo = PrivateData->UnknownFvInfo[Index].FvInfo;
*FvInfoSize = PrivateData->UnknownFvInfo[Index].FvInfoSize;
*AuthenticationStatus = PrivateData->UnknownFvInfo[Index].AuthenticationStatus;
-
+
//
// Remove an entry from UnknownFvInfo array.
//
@@ -2311,18 +2311,18 @@ FindUnknownFormatFvInfo ( }
PrivateData->UnknownFvInfoCount --;
return EFI_SUCCESS;
-}
+}
/**
Notification callback function for EFI_PEI_FIRMWARE_VOLUME_PPI.
-
- When a EFI_PEI_FIRMWARE_VOLUME_PPI is installed to support new FV format, this
+
+ When a EFI_PEI_FIRMWARE_VOLUME_PPI is installed to support new FV format, this
routine is called to process all discoveried FVs in this format.
-
+
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
@param NotifyDescriptor Address of the notification descriptor data structure.
@param Ppi Address of the PPI that was installed.
-
+
@retval EFI_SUCCESS The notification callback is processed correctly.
**/
EFI_STATUS
@@ -2343,18 +2343,18 @@ ThirdPartyFvPpiNotifyCallback ( BOOLEAN IsProcessed;
UINTN FvIndex;
EFI_PEI_FILE_HANDLE FileHandle;
- VOID *DepexData;
+ VOID *DepexData;
UINTN CurFvCount;
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
FvPpi = (EFI_PEI_FIRMWARE_VOLUME_PPI*) Ppi;
-
+
do {
Status = FindUnknownFormatFvInfo (PrivateData, NotifyDescriptor->Guid, &FvInfo, &FvInfoSize, &AuthenticationStatus);
if (EFI_ERROR (Status)) {
return EFI_SUCCESS;
}
-
+
//
// Process new found FV and get FV handle.
//
@@ -2375,17 +2375,17 @@ ThirdPartyFvPpiNotifyCallback ( break;
}
}
-
+
if (IsProcessed) {
continue;
}
-
+
if (PrivateData->FvCount >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {
DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, PcdGet32 (PcdPeiCoreMaxFvSupported)));
DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));
ASSERT (FALSE);
}
-
+
//
// Update internal PEI_CORE_FV array.
//
@@ -2395,17 +2395,17 @@ ThirdPartyFvPpiNotifyCallback ( PrivateData->Fv[PrivateData->FvCount].AuthenticationStatus = AuthenticationStatus;
CurFvCount = PrivateData->FvCount;
DEBUG ((
- EFI_D_INFO,
- "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
+ EFI_D_INFO,
+ "The %dth FV start address is 0x%11p, size is 0x%08x, handle is 0x%p\n",
(UINT32) CurFvCount,
- (VOID *) FvInfo,
+ (VOID *) FvInfo,
FvInfoSize,
FvHandle
- ));
+ ));
PrivateData->FvCount ++;
//
- // Scan and process the new discoveried FV for EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
+ // Scan and process the new discoveried FV for EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
//
FileHandle = NULL;
do {
@@ -2430,7 +2430,7 @@ ThirdPartyFvPpiNotifyCallback ( continue;
}
}
-
+
DEBUG ((EFI_D_INFO, "Found firmware volume Image File %p in FV[%d] %p\n", FileHandle, CurFvCount, FvHandle));
ProcessFvFile (PrivateData, &PrivateData->Fv[CurFvCount], FileHandle);
}
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h b/MdeModulePkg/Core/Pei/FwVol/FwVol.h index 1daeb6d97b..4a2451d71c 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h @@ -1,14 +1,14 @@ /** @file
The internal header file for firmware volume related definitions.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -43,15 +43,15 @@ typedef struct { buffer which contains the necessary information for creating
the firmware volume handle. Normally, these values are derived
from the EFI_FIRMWARE_VOLUME_INFO_PPI.
-
-
+
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param Buffer Points to the start of the buffer.
@param BufferSize Size of the buffer.
@param FvHandle Points to the returned firmware volume
handle. The firmware volume handle must
- be unique within the system.
+ be unique within the system.
@retval EFI_SUCCESS Firmware volume handle created.
@retval EFI_VOLUME_CORRUPTED Volume was corrupt.
@@ -65,11 +65,11 @@ PeiFfsFvPpiProcessVolume ( IN UINTN BufferSize,
OUT EFI_PEI_FV_HANDLE *FvHandle
);
-
+
/**
Finds the next file of the specified type.
- This service enables PEI modules to discover additional firmware files.
+ This service enables PEI modules to discover additional firmware files.
The FileHandle must be unique within the system.
@param This Points to this instance of the
@@ -87,7 +87,7 @@ PeiFfsFvPpiProcessVolume ( @retval EFI_SUCCESS The file was found.
@retval EFI_NOT_FOUND The file was not found. FileHandle contains NULL.
-**/
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiFindFileByType (
@@ -98,8 +98,8 @@ PeiFfsFvPpiFindFileByType ( );
/**
- Find a file within a volume by its name.
-
+ Find a file within a volume by its name.
+
This service searches for files with a specific name, within
either the specified firmware volume or all firmware volumes.
@@ -121,22 +121,22 @@ PeiFfsFvPpiFindFileByType ( FileName was NULL.
-**/
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiFindFileByName (
IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
IN CONST EFI_GUID *FileName,
IN EFI_PEI_FV_HANDLE *FvHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
+ OUT EFI_PEI_FILE_HANDLE *FileHandle
);
/**
Find the next matching section in the firmware file.
-
+
This service enables PEI modules to discover sections
of a given type within a valid file.
-
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param SearchType A filter to find only sections of this
@@ -145,11 +145,11 @@ PeiFfsFvPpiFindFileByName ( search.
@param SectionData Updated upon return to point to the
section found.
-
+
@retval EFI_SUCCESS Section was found.
@retval EFI_NOT_FOUND Section of the specified type was not
found. SectionData contains NULL.
-**/
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiFindSectionByType (
@@ -198,8 +198,8 @@ PeiFfsFvPpiFindSectionByType2 ( This function returns information about a specific
file, including its file name, type, attributes, starting
- address and size.
-
+ address and size.
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param FileHandle Handle of the file.
@@ -210,13 +210,13 @@ PeiFfsFvPpiFindSectionByType2 ( @retval EFI_INVALID_PARAMETER If FileHandle does not
represent a valid file.
@retval EFI_INVALID_PARAMETER If FileInfo is NULL.
-
-**/
+
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiGetFileInfo (
- IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
- IN EFI_PEI_FILE_HANDLE FileHandle,
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
OUT EFI_FV_FILE_INFO *FileInfo
);
@@ -249,7 +249,7 @@ PeiFfsFvPpiGetFileInfo2 ( /**
This function returns information about the firmware volume.
-
+
@param This Points to this instance of the
EFI_PEI_FIRMWARE_VOLUME_PPI.
@param FvHandle Handle to the firmware handle.
@@ -260,28 +260,28 @@ PeiFfsFvPpiGetFileInfo2 ( @retval EFI_INVALID_PARAMETER FvHandle does not indicate a valid
firmware volume or VolumeInfo is NULL.
-**/
+**/
EFI_STATUS
EFIAPI
PeiFfsFvPpiGetVolumeInfo (
- IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
- IN EFI_PEI_FV_HANDLE FvHandle,
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_PEI_FV_HANDLE FvHandle,
OUT EFI_FV_INFO *VolumeInfo
);
/**
Convert the handle of FV to pointer of corresponding PEI_CORE_FV_HANDLE.
-
+
@param FvHandle The handle of a FV.
-
+
@retval NULL if can not find.
- @return Pointer of corresponding PEI_CORE_FV_HANDLE.
+ @return Pointer of corresponding PEI_CORE_FV_HANDLE.
**/
PEI_CORE_FV_HANDLE *
FvHandleToCoreHandle (
IN EFI_PEI_FV_HANDLE FvHandle
);
-
+
/**
Given the input file pointer, search for the next matching file in the
FFS volume as defined by SearchType. The search starts from FileHeader inside
@@ -310,17 +310,17 @@ FindFileEx ( /**
Report the information for a new discoveried FV in unknown format.
-
+
If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for specifical FV format, but
the FV in this FV format has been discoveried, then the information of this FV
will be cached into PEI_CORE_INSTANCE's UnknownFvInfo array.
Also a notification would be installed for unknown FV format guid, if EFI_PEI_FIRMWARE_VOLUME_PPI
is installed later by platform's PEIM, the original unknown FV will be processed by
using new installed EFI_PEI_FIRMWARE_VOLUME_PPI.
-
+
@param PrivateData Point to instance of PEI_CORE_INSTANCE
@param FvInfo2Ppi Point to FvInfo2 PPI.
-
+
@retval EFI_OUT_OF_RESOURCES The FV info array in PEI_CORE_INSTANCE has no more spaces.
@retval EFI_SUCCESS Success to add the information for unknown FV.
**/
@@ -329,19 +329,19 @@ AddUnknownFormatFvInfo ( IN PEI_CORE_INSTANCE *PrivateData,
IN EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI *FvInfo2Ppi
);
-
+
/**
Find the FV information according to FV format guid.
-
+
This routine also will remove the FV information found by given FV format guid from
PrivateData->UnknownFvInfo[].
-
+
@param PrivateData Point to instance of PEI_CORE_INSTANCE
@param Format Point to given FV format guid
@param FvInfo On return, the pointer of FV information buffer in given FV format guid
@param FvInfoSize On return, the size of FV information buffer.
@param AuthenticationStatus On return, the authentication status of FV information buffer.
-
+
@retval EFI_NOT_FOUND The FV is not found for new installed EFI_PEI_FIRMWARE_VOLUME_PPI
@retval EFI_SUCCESS Success to find a FV which could be processed by new installed EFI_PEI_FIRMWARE_VOLUME_PPI.
**/
@@ -353,17 +353,17 @@ FindUnknownFormatFvInfo ( OUT UINT32 *FvInfoSize,
OUT UINT32 *AuthenticationStatus
);
-
+
/**
Notification callback function for EFI_PEI_FIRMWARE_VOLUME_PPI.
-
- When a EFI_PEI_FIRMWARE_VOLUME_PPI is installed to support new FV format, this
+
+ When a EFI_PEI_FIRMWARE_VOLUME_PPI is installed to support new FV format, this
routine is called to process all discoveried FVs in this format.
-
+
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
@param NotifyDescriptor Address of the notification descriptor data structure.
@param Ppi Address of the PPI that was installed.
-
+
@retval EFI_SUCCESS The notification callback is processed correctly.
**/
EFI_STATUS
@@ -372,6 +372,6 @@ ThirdPartyFvPpiNotifyCallback ( IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
IN VOID *Ppi
- );
-
-#endif
+ );
+
+#endif
diff --git a/MdeModulePkg/Core/Pei/Hob/Hob.c b/MdeModulePkg/Core/Pei/Hob/Hob.c index bb9f3f744e..ed49e5be4a 100644 --- a/MdeModulePkg/Core/Pei/Hob/Hob.c +++ b/MdeModulePkg/Core/Pei/Hob/Hob.c @@ -1,14 +1,14 @@ /** @file
This module provide Hand-Off Block manupulation.
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -34,22 +34,22 @@ PeiGetHobList ( )
{
PEI_CORE_INSTANCE *PrivateData;
-
+
//
// Only check this parameter in debug mode
//
-
- DEBUG_CODE_BEGIN ();
+
+ DEBUG_CODE_BEGIN ();
if (HobList == NULL) {
return EFI_INVALID_PARAMETER;
}
DEBUG_CODE_END ();
-
+
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
*HobList = PrivateData->HobList.Raw;
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
@@ -90,7 +90,7 @@ PeiCreateHob ( HandOffHob = *Hob;
//
- // Check Length to avoid data overflow.
+ // Check Length to avoid data overflow.
//
if (0x10000 - Length <= 0x7) {
return EFI_INVALID_PARAMETER;
@@ -106,7 +106,7 @@ PeiCreateHob ( DEBUG ((EFI_D_ERROR, " FreeMemoryBottom - 0x%08x\n", (UINTN)HandOffHob->EfiFreeMemoryBottom));
return EFI_OUT_OF_RESOURCES;
}
-
+
*Hob = (VOID*) (UINTN) HandOffHob->EfiEndOfHobList;
((EFI_HOB_GENERIC_HEADER*) *Hob)->HobType = Type;
((EFI_HOB_GENERIC_HEADER*) *Hob)->HobLength = Length;
@@ -114,14 +114,14 @@ PeiCreateHob ( HobEnd = (EFI_HOB_GENERIC_HEADER*) ((UINTN) *Hob + Length);
HandOffHob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;
-
+
HobEnd->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST;
HobEnd->HobLength = (UINT16) sizeof (EFI_HOB_GENERIC_HEADER);
HobEnd->Reserved = 0;
HobEnd++;
HandOffHob->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
/**
@@ -222,14 +222,14 @@ PeiCoreBuildHobHandoffInfoTable ( Hob->Header.HobType = EFI_HOB_TYPE_HANDOFF;
Hob->Header.HobLength = (UINT16) sizeof (EFI_HOB_HANDOFF_INFO_TABLE);
Hob->Header.Reserved = 0;
-
+
HobEnd->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST;
HobEnd->HobLength = (UINT16) sizeof (EFI_HOB_GENERIC_HEADER);
HobEnd->Reserved = 0;
Hob->Version = EFI_HOB_HANDOFF_TABLE_VERSION;
Hob->BootMode = BootMode;
-
+
Hob->EfiMemoryTop = MemoryBegin + MemoryLength;
Hob->EfiMemoryBottom = MemoryBegin;
Hob->EfiFreeMemoryTop = MemoryBegin + MemoryLength;
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index f07f488231..f84f2c77ad 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -50,7 +50,7 @@ PeiImageRead ( {
CHAR8 *Destination8;
CHAR8 *Source8;
-
+
Destination8 = Buffer;
Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
if (Destination8 != Source8) {
@@ -119,10 +119,10 @@ GetImageReadFunction ( Private = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer ());
MemoryBuffer = 0;
- if (Private->PeiMemoryInstalled && (((Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)) ||
+ if (Private->PeiMemoryInstalled && (((Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)) ||
((Private->HobList.HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnS3Boot)))) {
- //
- // Shadow algorithm makes lots of non ANSI C assumptions and only works for IA32 and X64
+ //
+ // Shadow algorithm makes lots of non ANSI C assumptions and only works for IA32 and X64
// compilers that have been tested
//
if (Private->ShadowedImageRead == NULL) {
@@ -144,12 +144,12 @@ GetImageReadFunction ( /**
To check memory usage bit map array to figure out if the memory range the image will be loaded in is available or not. If
memory range is available, the function will mark the corresponding bits to 1 which indicates the memory range is used.
- The function is only invoked when load modules at fixed address feature is enabled.
-
+ The function is only invoked when load modules at fixed address feature is enabled.
+
@param Private Pointer to the private data passed in from caller
@param ImageBase The base address the image will be loaded at.
@param ImageSize The size of the image
-
+
@retval EFI_SUCCESS The memory range the image will be loaded in is available
@retval EFI_NOT_FOUND The memory range the image will be loaded in is not available
**/
@@ -167,7 +167,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap ( UINT32 TopOffsetPageNumber;
UINT32 Index;
UINT64 *MemoryUsageBitMap;
-
+
//
// The reserved code range includes RuntimeCodePage range, Boot time code range and PEI code range.
@@ -176,19 +176,19 @@ CheckAndMarkFixLoadingMemoryUsageBitMap ( DxeCodePageNumber += PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
ReservedCodeSize = EFI_PAGES_TO_SIZE(DxeCodePageNumber + PcdGet32(PcdLoadFixAddressPeiCodePageNumber));
PeiCodeBase = Private->LoadModuleAtFixAddressTopAddress - ReservedCodeSize;
-
+
//
// Test the memory range for loading the image in the PEI code range.
//
if ((Private->LoadModuleAtFixAddressTopAddress - EFI_PAGES_TO_SIZE(DxeCodePageNumber)) < (ImageBase + ImageSize) ||
- (PeiCodeBase > ImageBase)) {
- return EFI_NOT_FOUND;
+ (PeiCodeBase > ImageBase)) {
+ return EFI_NOT_FOUND;
}
-
+
//
// Test if the memory is avalaible or not.
//
- MemoryUsageBitMap = Private->PeiCodeMemoryRangeUsageBitMap;
+ MemoryUsageBitMap = Private->PeiCodeMemoryRangeUsageBitMap;
BaseOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase - PeiCodeBase));
TopOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase + ImageSize - PeiCodeBase));
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index ++) {
@@ -196,17 +196,17 @@ CheckAndMarkFixLoadingMemoryUsageBitMap ( //
// This page is already used.
//
- return EFI_NOT_FOUND;
+ return EFI_NOT_FOUND;
}
}
-
+
//
// Being here means the memory range is available. So mark the bits for the memory range
- //
+ //
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index ++) {
MemoryUsageBitMap[Index / 64] |= LShiftU64(1, (Index % 64));
}
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
/**
@@ -236,7 +236,7 @@ GetPeCoffImageFixLoadingAssignedAddress( UINTN Size;
UINT16 NumberOfSections;
UINT64 ValueInSectionHeader;
-
+
FixLoadingAddress = 0;
Status = EFI_NOT_FOUND;
@@ -338,7 +338,7 @@ GetPeCoffImageFixLoadingAssignedAddress( @retval EFI_SUCCESS The file was loaded and relocated
@retval EFI_OUT_OF_RESOURCES There was not enough memory to load and relocate the PE/COFF file
- @retval EFI_WARN_BUFFER_TOO_SMALL
+ @retval EFI_WARN_BUFFER_TOO_SMALL
There is not enough heap to allocate the requested size.
This will not prevent the XIP image from being invoked.
@@ -377,7 +377,7 @@ LoadAndRelocatePeCoffImage ( if (EFI_ERROR (Status)) {
return Status;
}
-
+
//
// Initilize local IsS3Boot and IsRegisterForShadow variable
//
@@ -386,7 +386,7 @@ LoadAndRelocatePeCoffImage ( IsS3Boot = TRUE;
}
IsRegisterForShadow = FALSE;
- if ((Private->CurrentFileHandle == FileHandle)
+ if ((Private->CurrentFileHandle == FileHandle)
&& (Private->Fv[Private->CurrentPeimFvCount].PeimState[Private->CurrentPeimCount] == PEIM_STATE_REGISTER_FOR_SHADOW)) {
IsRegisterForShadow = TRUE;
}
@@ -403,13 +403,13 @@ LoadAndRelocatePeCoffImage ( //
Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo);
ASSERT_EFI_ERROR (Status);
-
+
//
// Check whether the file type is PEI module.
//
IsPeiModule = FALSE;
- if (FileInfo.FileType == EFI_FV_FILETYPE_PEI_CORE ||
- FileInfo.FileType == EFI_FV_FILETYPE_PEIM ||
+ if (FileInfo.FileType == EFI_FV_FILETYPE_PEI_CORE ||
+ FileInfo.FileType == EFI_FV_FILETYPE_PEIM ||
FileInfo.FileType == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER) {
IsPeiModule = TRUE;
}
@@ -548,7 +548,7 @@ LoadAndRelocatePeCoffImage ( @retval EFI_SUCCESS Image is successfully loaded.
@retval EFI_NOT_FOUND Fail to locate necessary PPI.
@retval EFI_UNSUPPORTED Image Machine Type is not supported.
- @retval EFI_WARN_BUFFER_TOO_SMALL
+ @retval EFI_WARN_BUFFER_TOO_SMALL
There is not enough heap to allocate the requested size.
This will not prevent the XIP image from being invoked.
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index 516311d091..4dc62d2262 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -1,14 +1,14 @@ /** @file
EFI PEI Core memory services
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -33,7 +33,7 @@ InitializeMemoryServices ( IN PEI_CORE_INSTANCE *OldCoreData
)
{
-
+
PrivateData->SwitchStackSignal = FALSE;
//
@@ -44,7 +44,7 @@ InitializeMemoryServices ( PrivateData->PeiMemoryInstalled = FALSE;
PrivateData->HobList.Raw = SecCoreData->PeiTemporaryRamBase;
-
+
PeiCoreBuildHobHandoffInfoTable (
BOOT_WITH_FULL_CONFIGURATION,
(EFI_PHYSICAL_ADDRESS) (UINTN) SecCoreData->PeiTemporaryRamBase,
@@ -56,7 +56,7 @@ InitializeMemoryServices ( //
PrivateData->Ps = &(PrivateData->ServiceTableShadow);
}
-
+
return;
}
@@ -68,7 +68,7 @@ InitializeMemoryServices ( This routine will hold discoveried memory information into PeiCore's private data,
and set SwitchStackSignal flag. After PEIM who discovery memory is dispatched,
PeiDispatcher will migrate temporary memory to permenement memory.
-
+
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@param MemoryBegin Start of memory address.
@param MemoryLength Length of memory.
@@ -93,20 +93,20 @@ PeiInstallPeiMemory ( // PEI_SERVICE.InstallPeiMemory should only be called one time during whole PEI phase.
// If it is invoked more than one time, ASSERT information is given for developer debugging in debug tip and
// simply return EFI_SUCESS in release tip to ignore it.
- //
+ //
if (PrivateData->PeiMemoryInstalled) {
DEBUG ((EFI_D_ERROR, "ERROR: PeiInstallPeiMemory is called more than once!\n"));
ASSERT (FALSE);
return EFI_SUCCESS;
}
-
+
PrivateData->PhysicalMemoryBegin = MemoryBegin;
PrivateData->PhysicalMemoryLength = MemoryLength;
PrivateData->FreePhysicalMemoryTop = MemoryBegin + MemoryLength;
-
+
PrivateData->SwitchStackSignal = TRUE;
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
/**
@@ -765,8 +765,8 @@ PeiFreePages ( /**
Pool allocation service. Before permanent memory is discoveried, the pool will
- be allocated the heap in the temporary memory. Genenrally, the size of heap in temporary
- memory does not exceed to 64K, so the biggest pool size could be allocated is
+ be allocated the heap in the temporary memory. Genenrally, the size of heap in temporary
+ memory does not exceed to 64K, so the biggest pool size could be allocated is
64K.
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@@ -793,7 +793,7 @@ PeiAllocatePool ( // If some "post-memory" PEIM wishes to allocate larger pool,
// it should use AllocatePages service instead.
//
-
+
//
// Generally, the size of heap in temporary memory does not exceed to 64K,
// HobLength is multiples of 8 bytes, so the maxmium size of pool is 0xFFF8 - sizeof (EFI_HOB_MEMORY_POOL)
@@ -801,14 +801,14 @@ PeiAllocatePool ( if (Size > (0xFFF8 - sizeof (EFI_HOB_MEMORY_POOL))) {
return EFI_OUT_OF_RESOURCES;
}
-
+
Status = PeiServicesCreateHob (
EFI_HOB_TYPE_MEMORY_POOL,
(UINT16)(sizeof (EFI_HOB_MEMORY_POOL) + Size),
(VOID **)&Hob
);
ASSERT_EFI_ERROR (Status);
- *Buffer = Hob+1;
+ *Buffer = Hob+1;
return Status;
}
diff --git a/MdeModulePkg/Core/Pei/PciCfg2/PciCfg2.c b/MdeModulePkg/Core/Pei/PciCfg2/PciCfg2.c index a20e7c00c5..a6a6ad379b 100644 --- a/MdeModulePkg/Core/Pei/PciCfg2/PciCfg2.c +++ b/MdeModulePkg/Core/Pei/PciCfg2/PciCfg2.c @@ -1,26 +1,26 @@ /** @file
The default version of EFI_PEI_PCI_CFG2_PPI support published by PeiServices in
PeiCore initialization phase.
-
- EFI_PEI_PCI_CFG2_PPI is installed by the PEIM which supports a PCI root bridge.
- When PeiCore is started, the default version of EFI_PEI_PCI_CFG2_PPI will be assigned
+
+ EFI_PEI_PCI_CFG2_PPI is installed by the PEIM which supports a PCI root bridge.
+ When PeiCore is started, the default version of EFI_PEI_PCI_CFG2_PPI will be assigned
to PeiServices table.
-
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "PeiMain.h"
///
-/// This default instance of EFI_PEI_PCI_CFG2_PPI install assigned to EFI_PEI_SERVICE.PciCfg
+/// This default instance of EFI_PEI_PCI_CFG2_PPI install assigned to EFI_PEI_SERVICE.PciCfg
/// when PeiCore's initialization.
///
EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi = {
@@ -32,9 +32,9 @@ EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi = { /**
Reads from a given location in the PCI configuration space.
- If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Width The width of the access. Enumerated in bytes.
@@ -46,7 +46,7 @@ EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi = { @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER The invalid access width.
@retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
-
+
**/
EFI_STATUS
EFIAPI
@@ -64,9 +64,9 @@ PeiDefaultPciCfg2Read ( /**
Write to a given location in the PCI configuration space.
- If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Width The width of the access. Enumerated in bytes.
@@ -90,13 +90,13 @@ PeiDefaultPciCfg2Write ( )
{
return EFI_NOT_AVAILABLE_YET;
-}
+}
/**
This function performs a read-modify-write operation on the contents from a given
location in the PCI configuration space.
- If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
+ If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@@ -125,4 +125,4 @@ PeiDefaultPciCfg2Modify ( )
{
return EFI_NOT_AVAILABLE_YET;
-}
+}
diff --git a/MdeModulePkg/Core/Pei/PeiCoreExtra.uni b/MdeModulePkg/Core/Pei/PeiCoreExtra.uni index ec430fccae..f2cea6ca81 100644 --- a/MdeModulePkg/Core/Pei/PeiCoreExtra.uni +++ b/MdeModulePkg/Core/Pei/PeiCoreExtra.uni @@ -1,7 +1,7 @@ // /** @file
// PeiCore Localized Strings and Content
//
-// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -12,8 +12,8 @@ //
// **/
-#string STR_PROPERTIES_MODULE_NAME
-#language en-US
+#string STR_PROPERTIES_MODULE_NAME
+#language en-US
"Core PEI Services Module"
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index a1cdbc15d9..e2f8cd9c77 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -1,7 +1,7 @@ /** @file
Definition of Pei Core Structures and Services
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -88,7 +88,7 @@ typedef struct { INTN LastDispatchedInstall;
///
/// index of last dispatched notify in Notify link list.
- ///
+ ///
INTN LastDispatchedNotify;
///
/// Ppi database has the PcdPeiCoreMaxPpiSupported number of entries.
@@ -157,7 +157,7 @@ typedef struct _PEI_CORE_INSTANCE PEI_CORE_INSTANCE; /**
Function Pointer type for PeiCore function.
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
and location of temporary RAM, the stack location and the BFV location.
@param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
An empty PPI list consists of a single descriptor with the end-tag
@@ -183,18 +183,18 @@ EFI_STATUS ///
struct _PEI_CORE_INSTANCE {
UINTN Signature;
-
+
///
/// Point to ServiceTableShadow
///
EFI_PEI_SERVICES *Ps;
PEI_PPI_DATABASE PpiData;
-
+
///
/// The count of FVs which contains FFS and could be dispatched by PeiCore.
///
UINTN FvCount;
-
+
///
/// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries.
/// Each entry is for one FV which contains FFS and could be dispatched by PeiCore.
@@ -207,7 +207,7 @@ struct _PEI_CORE_INSTANCE { ///
PEI_CORE_UNKNOW_FORMAT_FV_INFO *UnknownFvInfo;
UINTN UnknownFvInfoCount;
-
+
///
/// Pointer to the buffer with the PcdPeiCoreMaxPeimPerFv number of entries.
///
@@ -240,15 +240,15 @@ struct _PEI_CORE_INSTANCE { PEICORE_FUNCTION_POINTER ShadowedPeiCore;
CACHE_SECTION_DATA CacheSection;
//
- // For Loading modules at fixed address feature to cache the top address below which the
- // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
- // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
+ // For Loading modules at fixed address feature to cache the top address below which the
+ // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
+ // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
//
EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress;
//
// The field is define for Loading modules at fixed address feature to tracker the PEI code
// memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
- // available or not.
+ // available or not.
//
UINT64 *PeiCodeMemoryRangeUsageBitMap;
//
@@ -307,7 +307,7 @@ typedef struct { with the old core data.
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
and location of temporary RAM, the stack location and the BFV location.
@param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
An empty PPI list consists of a single descriptor with the end-tag
@@ -415,7 +415,7 @@ DepexSatisfied ( Initialize PPI services.
@param PrivateData Pointer to the PEI Core data.
- @param OldCoreData Pointer to old PEI Core data.
+ @param OldCoreData Pointer to old PEI Core data.
NULL if being run in non-permament memory mode.
**/
@@ -429,7 +429,7 @@ InitializePpiServices ( Migrate the Hob list from the temporary memory to PEI installed memory.
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
and location of temporary RAM, the stack location and the BFV location.
@param PrivateData Pointer to PeiCore's private data structure.
@@ -847,7 +847,7 @@ PeiFfsFindNextVolume ( Initialize the memory services.
@param PrivateData PeiCore's private data structure
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
and location of temporary RAM, the stack location and the BFV location.
@param OldCoreData Pointer to the PEI Core data.
NULL if being run in non-permament memory mode.
@@ -1158,7 +1158,7 @@ PeiFfsGetFileInfo ( **/
EFI_STATUS
-EFIAPI
+EFIAPI
PeiFfsGetFileInfo2 (
IN EFI_PEI_FILE_HANDLE FileHandle,
OUT EFI_FV_FILE_INFO2 *FileInfo
@@ -1269,7 +1269,7 @@ SecurityPpiNotifyCallback ( @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
@retval EFI_SECURITY_VIOLATION Image is illegal
@retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
-
+
**/
EFI_STATUS
ProcessFvFile (
@@ -1277,15 +1277,15 @@ ProcessFvFile ( IN PEI_CORE_FV_HANDLE *ParentFvCoreHandle,
IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
);
-
+
/**
Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
-
+
This routine also will install FvInfo ppi for FV hob in PI ways.
-
+
@param Private Pointer of PEI_CORE_INSTANCE
@param Instance The index of FV want to be searched.
-
+
@return Instance of PEI_CORE_FV_HANDLE.
**/
PEI_CORE_FV_HANDLE *
@@ -1293,19 +1293,19 @@ FindNextCoreFvHandle ( IN PEI_CORE_INSTANCE *Private,
IN UINTN Instance
);
-
+
//
// Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
-//
+//
/**
Memory-based read services.
-
- This function is to perform the Memory Access Read service based on installed
- instance of the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+
+ This function is to perform the Memory Access Read service based on installed
+ instance of the EFI_PEI_CPU_IO_PPI.
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -1315,7 +1315,7 @@ FindNextCoreFvHandle ( @param Buffer A pointer to the buffer of data.
@retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
**/
EFI_STATUS
EFIAPI
@@ -1327,15 +1327,15 @@ PeiDefaultMemRead ( IN UINTN Count,
IN OUT VOID *Buffer
);
-
+
/**
Memory-based write services.
-
- This function is to perform the Memory Access Write service based on installed
- instance of the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+
+ This function is to perform the Memory Access Write service based on installed
+ instance of the EFI_PEI_CPU_IO_PPI.
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -1345,7 +1345,7 @@ PeiDefaultMemRead ( @param Buffer A pointer to the buffer of data.
@retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
**/
EFI_STATUS
EFIAPI
@@ -1357,14 +1357,14 @@ PeiDefaultMemWrite ( IN UINTN Count,
IN OUT VOID *Buffer
);
-
+
/**
IO-based read services.
-
+
This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -1386,14 +1386,14 @@ PeiDefaultIoRead ( IN UINTN Count,
IN OUT VOID *Buffer
);
-
+
/**
IO-based write services.
-
+
This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This Pointer to local data for the interface.
@@ -1415,13 +1415,13 @@ PeiDefaultIoWrite ( IN UINTN Count,
IN OUT VOID *Buffer
);
-
+
/**
8-bit I/O read operations.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1435,13 +1435,13 @@ PeiDefaultIoRead8 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
Reads an 16-bit I/O port.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1455,13 +1455,13 @@ PeiDefaultIoRead16 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
Reads an 32-bit I/O port.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1475,13 +1475,13 @@ PeiDefaultIoRead32 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
Reads an 64-bit I/O port.
-
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1495,7 +1495,7 @@ PeiDefaultIoRead64 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
8-bit I/O write operations.
@@ -1512,7 +1512,7 @@ PeiDefaultIoWrite8 ( IN UINT64 Address,
IN UINT8 Data
);
-
+
/**
16-bit I/O write operations.
@@ -1529,7 +1529,7 @@ PeiDefaultIoWrite16 ( IN UINT64 Address,
IN UINT16 Data
);
-
+
/**
32-bit I/O write operations.
@@ -1546,7 +1546,7 @@ PeiDefaultIoWrite32 ( IN UINT64 Address,
IN UINT32 Data
);
-
+
/**
64-bit I/O write operations.
@@ -1563,13 +1563,13 @@ PeiDefaultIoWrite64 ( IN UINT64 Address,
IN UINT64 Data
);
-
+
/**
8-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1584,13 +1584,13 @@ PeiDefaultMemRead8 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
16-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1605,13 +1605,13 @@ PeiDefaultMemRead16 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
32-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1626,13 +1626,13 @@ PeiDefaultMemRead32 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
64-bit memory read operations.
- If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
return 0.
-
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Address The physical address of the access.
@@ -1647,7 +1647,7 @@ PeiDefaultMemRead64 ( IN CONST EFI_PEI_CPU_IO_PPI *This,
IN UINT64 Address
);
-
+
/**
8-bit memory write operations.
@@ -1665,7 +1665,7 @@ PeiDefaultMemWrite8 ( IN UINT64 Address,
IN UINT8 Data
);
-
+
/**
16-bit memory write operations.
@@ -1701,7 +1701,7 @@ PeiDefaultMemWrite32 ( IN UINT64 Address,
IN UINT32 Data
);
-
+
/**
64-bit memory write operations.
@@ -1719,19 +1719,19 @@ PeiDefaultMemWrite64 ( IN UINT64 Address,
IN UINT64 Data
);
-
-extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi;
+
+extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi;
//
// Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
-//
+//
/**
Reads from a given location in the PCI configuration space.
- If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Width The width of the access. Enumerated in bytes.
@@ -1743,7 +1743,7 @@ extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi; @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER The invalid access width.
@retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
-
+
**/
EFI_STATUS
EFIAPI
@@ -1754,13 +1754,13 @@ PeiDefaultPciCfg2Read ( IN UINT64 Address,
IN OUT VOID *Buffer
);
-
+
/**
Write to a given location in the PCI configuration space.
- If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
- return EFI_NOT_YET_AVAILABLE.
-
+ If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
+ return EFI_NOT_YET_AVAILABLE.
+
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@param This Pointer to local data for the interface.
@param Width The width of the access. Enumerated in bytes.
@@ -1782,7 +1782,7 @@ PeiDefaultPciCfg2Write ( IN UINT64 Address,
IN OUT VOID *Buffer
);
-
+
/**
This function performs a read-modify-write operation on the contents from a given
location in the PCI configuration space.
@@ -1811,21 +1811,21 @@ PeiDefaultPciCfg2Modify ( IN UINT64 Address,
IN VOID *SetBits,
IN VOID *ClearBits
- );
-
+ );
+
extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi;
/**
After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
- be re-installed with the instance in permanent memory and all cached FvPpi pointers in
+ be re-installed with the instance in permanent memory and all cached FvPpi pointers in
PrivateData->Fv[] array should be fixed up to be pointed to the one in permanent
memory.
-
+
@param PrivateData Pointer to PEI_CORE_INSTANCE.
-**/
+**/
VOID
PeiReinitializeFv (
IN PEI_CORE_INSTANCE *PrivateData
);
-
+
#endif
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 7d9cdaa2f0..2fb01958e5 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -6,7 +6,7 @@ # 2) Dispatch PEIM from discovered FV.
# 3) Handoff control to DxeIpl to load DXE core and enter DXE phase.
#
-# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -81,10 +81,10 @@ ## CONSUMES ## UNDEFINED # Locate ppi
## CONSUMES ## GUID # Used to compare with FV's file system guid and get the FV's file system format
gEfiFirmwareFileSystem3Guid
-
+
[Ppis]
gEfiPeiStatusCodePpiGuid ## SOMETIMES_CONSUMES # PeiReportStatusService is not ready if this PPI doesn't exist
- gEfiPeiResetPpiGuid ## SOMETIMES_CONSUMES # PeiResetService is not ready if this PPI doesn't exist
+ gEfiPeiResetPpiGuid ## SOMETIMES_CONSUMES # PeiResetService is not ready if this PPI doesn't exist
gEfiDxeIplPpiGuid ## CONSUMES
gEfiPeiMemoryDiscoveredPpiGuid ## PRODUCES
gEfiPeiDecompressPpiGuid ## SOMETIMES_CONSUMES
@@ -103,7 +103,7 @@ gEfiPeiReset2PpiGuid ## SOMETIMES_CONSUMES
gEfiSecHobDataPpiGuid ## SOMETIMES_CONSUMES
-[Pcd]
+[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES
@@ -114,8 +114,8 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnS3Boot ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnS3Boot ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack ## CONSUMES
# [BootMode]
diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index a52e6f0201..e3a301dfe0 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -1,7 +1,7 @@ /** @file
Pei Core Main Entry Point
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -46,7 +46,7 @@ EFI_PEI_SERVICES gPs = { PeiFfsFindNextFile,
PeiFfsFindSectionData,
- PeiInstallPeiMemory,
+ PeiInstallPeiMemory,
PeiAllocatePages,
PeiAllocatePool,
(EFI_PEI_COPY_MEM)CopyMem,
@@ -70,7 +70,7 @@ EFI_PEI_SERVICES gPs = { /**
Shadow PeiCore module from flash to installed memory.
-
+
@param PrivateData PeiCore's private data structure
@return PeiCore function address after shadowing.
@@ -155,7 +155,7 @@ PeiCore ( EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;
EFI_PEI_TEMPORARY_RAM_DONE_PPI *TemporaryRamDonePpi;
UINTN Index;
-
+
//
// Retrieve context passed into PEI Core
//
@@ -252,7 +252,7 @@ PeiCore ( // Indicate that PeiCore reenter
//
OldCoreData->PeimDispatcherReenter = TRUE;
-
+
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 && (OldCoreData->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
//
// if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array.
@@ -270,12 +270,12 @@ PeiCore ( || (HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME && PcdGetBool (PcdShadowPeimOnBoot))) {
OldCoreData->ShadowedPeiCore = ShadowPeiCore (OldCoreData);
}
-
+
//
// PEI Core has now been shadowed to memory. Restart PEI Core in memory.
//
OldCoreData->ShadowedPeiCore (SecCoreData, PpiList, OldCoreData);
-
+
//
// Should never reach here.
//
@@ -295,13 +295,13 @@ PeiCore ( CpuIo = (VOID*)PrivateData.ServiceTableShadow.CpuIo;
PciCfg = (VOID*)PrivateData.ServiceTableShadow.PciCfg;
-
+
CopyMem (&PrivateData.ServiceTableShadow, &gPs, sizeof (gPs));
-
+
PrivateData.ServiceTableShadow.CpuIo = CpuIo;
PrivateData.ServiceTableShadow.PciCfg = PciCfg;
}
-
+
//
// Cache a pointer to the PEI Services Table that is either in temporary memory or permanent memory
//
@@ -347,9 +347,9 @@ PeiCore ( ASSERT (PrivateData.FileHandles != NULL);
}
InitializePpiServices (&PrivateData, OldCoreData);
-
+
//
- // Update performance measurements
+ // Update performance measurements
//
if (OldCoreData == NULL) {
PERF_EVENT ("SEC"); // Means the end of SEC phase.
@@ -367,14 +367,14 @@ PeiCore ( //
// Complete PEI Core Service initialization
- //
+ //
InitializeSecurityServices (&PrivateData.Ps, OldCoreData);
InitializeDispatcherData (&PrivateData, OldCoreData, SecCoreData);
InitializeImageServices (&PrivateData, OldCoreData);
//
// Perform PEI Core Phase specific actions
- //
+ //
if (OldCoreData == NULL) {
//
// Report Status Code EFI_SW_PC_INIT
@@ -383,7 +383,7 @@ PeiCore ( EFI_PROGRESS_CODE,
(EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT)
);
-
+
//
// If SEC provided the PpiList, process it.
//
diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index 082c379458..139cfeda05 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -1,7 +1,7 @@ /** @file
EFI PEI Core PPI services
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Initialize PPI services.
@param PrivateData Pointer to the PEI Core data.
- @param OldCoreData Pointer to old PEI Core data.
+ @param OldCoreData Pointer to old PEI Core data.
NULL if being run in non-permament memory mode.
**/
@@ -44,7 +44,7 @@ InitializePpiServices ( @param TempBottom Base of old temporary memory
@param TempTop Top of old temporary memory
@param Offset Offset of new memory to old temporary memory.
- @param OffsetPositive Positive flag of Offset value.
+ @param OffsetPositive Positive flag of Offset value.
**/
VOID
@@ -105,7 +105,7 @@ ConvertSinglePpiPointer ( Migrate PPI Pointers from the temporary memory to PEI installed memory.
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
and location of temporary RAM, the stack location and the BFV location.
@param PrivateData Pointer to PeiCore's private data structure.
@@ -145,7 +145,7 @@ ConvertPpiPointers ( PrivateData->HeapOffset,
PrivateData->HeapOffsetPositive
);
-
+
//
// Convert PPI pointer in old Stack
//
@@ -156,7 +156,7 @@ ConvertPpiPointers ( PrivateData->StackOffset,
PrivateData->StackOffsetPositive
);
-
+
//
// Convert PPI pointer in old TempRam Hole
//
@@ -164,7 +164,7 @@ ConvertPpiPointers ( if (PrivateData->HoleData[IndexHole].Size == 0) {
continue;
}
-
+
ConvertSinglePpiPointer (
&PrivateData->PpiData.PpiListPtrs[Index],
(UINTN)PrivateData->HoleData[IndexHole].Base,
@@ -179,7 +179,7 @@ ConvertPpiPointers ( /**
- This function installs an interface in the PEI PPI database by GUID.
+ This function installs an interface in the PEI PPI database by GUID.
The purpose of the service is to publish an interface that other parties
can use to call additional PEIMs.
@@ -280,7 +280,7 @@ InternalPeiInstallPpi ( /**
- This function installs an interface in the PEI PPI database by GUID.
+ This function installs an interface in the PEI PPI database by GUID.
The purpose of the service is to publish an interface that other parties
can use to call additional PEIMs.
@@ -305,9 +305,9 @@ PeiInstallPpi ( /**
- This function reinstalls an interface in the PEI PPI database by GUID.
- The purpose of the service is to publish an interface that other parties can
- use to replace an interface of the same name in the protocol database with a
+ This function reinstalls an interface in the PEI PPI database by GUID.
+ The purpose of the service is to publish an interface that other parties can
+ use to replace an interface of the same name in the protocol database with a
different interface.
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@@ -450,8 +450,8 @@ PeiLocatePpi ( /**
- This function installs a notification service to be called back when a given
- interface is installed or reinstalled. The purpose of the service is to publish
+ This function installs a notification service to be called back when a given
+ interface is installed or reinstalled. The purpose of the service is to publish
an interface that other parties can use to call additional PPIs that may materialize later.
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@@ -579,8 +579,8 @@ InternalPeiNotifyPpi ( /**
- This function installs a notification service to be called back when a given
- interface is installed or reinstalled. The purpose of the service is to publish
+ This function installs a notification service to be called back when a given
+ interface is installed or reinstalled. The purpose of the service is to publish
an interface that other parties can use to call additional PPIs that may materialize later.
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
diff --git a/MdeModulePkg/Core/Pei/Security/Security.c b/MdeModulePkg/Core/Pei/Security/Security.c index 763126057d..13c6368ffe 100644 --- a/MdeModulePkg/Core/Pei/Security/Security.c +++ b/MdeModulePkg/Core/Pei/Security/Security.c @@ -1,14 +1,14 @@ /** @file
EFI PEI Core Security services
-
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -45,7 +45,7 @@ InitializeSecurityServices ( Provide a callback for when the security PPI is installed.
This routine will cache installed security PPI into PeiCore's private data.
-
+
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@param NotifyDescriptor The descriptor for the notification event.
@param Ppi Pointer to the PPI in question.
@@ -67,7 +67,7 @@ SecurityPpiNotifyCallback ( // Get PEI Core private data
//
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
-
+
//
// If there isn't a security PPI installed, use the one from notification
//
diff --git a/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c b/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c index a7fb524ff4..5877b75055 100644 --- a/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c +++ b/MdeModulePkg/Core/Pei/StatusCode/StatusCode.c @@ -1,14 +1,14 @@ /** @file
Pei Core Status Code Support
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -35,7 +35,7 @@ EFIAPI PeiReportStatusCode (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
+ IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN CONST EFI_GUID *CallerId,
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
@@ -48,10 +48,10 @@ PeiReportStatusCode ( // Locate StatusCode Ppi.
//
Status = PeiServicesLocatePpi (
- &gEfiPeiStatusCodePpiGuid,
- 0,
- NULL,
- (VOID **)&StatusCodePpi
+ &gEfiPeiStatusCodePpiGuid,
+ 0,
+ NULL,
+ (VOID **)&StatusCodePpi
);
if (!EFI_ERROR (Status)) {
@@ -63,11 +63,11 @@ PeiReportStatusCode ( CallerId,
Data
);
-
- return Status;
- }
-
- return EFI_NOT_AVAILABLE_YET;
+
+ return Status;
+ }
+
+ return EFI_NOT_AVAILABLE_YET;
}
|