MdeModulePkg: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Liming Gao
2018-06-27 21:08:52 +08:00
parent ca79bab7af
commit d1102dba72
1010 changed files with 13588 additions and 13588 deletions

View File

@@ -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;
HandOffHob = (PrivateData->HobList.HandoffInformationTable);
*BootMode = HandOffHob->BootMode;
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;
}

View File

@@ -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
)
{
}
}

View File

@@ -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) {

View File

@@ -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.
**/

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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;

View File

@@ -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.

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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"

View File

@@ -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

View File

@@ -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]

View File

@@ -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.
//

View File

@@ -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.

View File

@@ -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
//

View File

@@ -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;
}