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:
@@ -5,7 +5,7 @@
|
||||
if a driver can be scheduled for execution. The criteria for
|
||||
schedulability is that the dependency expression is satisfied.
|
||||
|
||||
Copyright (c) 2006 - 2010, 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
|
||||
@@ -409,7 +409,7 @@ CoreIsSchedulable (
|
||||
case EFI_DEP_REPLACE_TRUE:
|
||||
CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID));
|
||||
DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = TRUE\n", &DriverGuid));
|
||||
|
||||
|
||||
Status = PushBool (TRUE);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Unexpected error)\n"));
|
||||
|
@@ -26,7 +26,7 @@
|
||||
Depex - Dependency Expresion.
|
||||
SOR - Schedule On Request - Don't schedule if this bit is set.
|
||||
|
||||
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
|
||||
@@ -335,13 +335,13 @@ CoreSchedule (
|
||||
CoreReleaseDispatcherLock ();
|
||||
|
||||
DEBUG ((DEBUG_DISPATCH, "Schedule FFS(%g) - EFI_SUCCESS\n", DriverName));
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DEBUG ((DEBUG_DISPATCH, "Schedule FFS(%g) - EFI_NOT_FOUND\n", DriverName));
|
||||
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ CoreDispatcher (
|
||||
EFI_CORE_DRIVER_ENTRY *DriverEntry;
|
||||
BOOLEAN ReadyToRun;
|
||||
EFI_EVENT DxeDispatchEvent;
|
||||
|
||||
|
||||
PERF_FUNCTION_BEGIN ();
|
||||
|
||||
if (gDispatcherRunning) {
|
||||
@@ -512,10 +512,10 @@ CoreDispatcher (
|
||||
|
||||
CoreReleaseDispatcherLock ();
|
||||
|
||||
|
||||
|
||||
if (DriverEntry->IsFvImage) {
|
||||
//
|
||||
// Produce a firmware volume block protocol for FvImage so it gets dispatched from.
|
||||
// Produce a firmware volume block protocol for FvImage so it gets dispatched from.
|
||||
//
|
||||
Status = CoreProcessFvImageFile (DriverEntry->Fv, DriverEntry->FvHandle, &DriverEntry->FileName);
|
||||
} else {
|
||||
@@ -526,9 +526,9 @@ CoreDispatcher (
|
||||
sizeof (DriverEntry->ImageHandle)
|
||||
);
|
||||
ASSERT (DriverEntry->ImageHandle != NULL);
|
||||
|
||||
|
||||
Status = CoreStartImage (DriverEntry->ImageHandle, NULL, NULL);
|
||||
|
||||
|
||||
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
|
||||
EFI_PROGRESS_CODE,
|
||||
(EFI_SOFTWARE_DXE_CORE | EFI_SW_PC_INIT_END),
|
||||
@@ -692,17 +692,17 @@ FvHasBeenProcessed (
|
||||
|
||||
/**
|
||||
Remember that Fv protocol on FvHandle has had it's drivers placed on the
|
||||
mDiscoveredList. This fucntion adds entries on the mFvHandleList if new
|
||||
mDiscoveredList. This fucntion adds entries on the mFvHandleList if new
|
||||
entry is different from one in mFvHandleList by checking FvImage Guid.
|
||||
Items are never removed/freed from the mFvHandleList.
|
||||
|
||||
@param FvHandle The handle of a FV that has been processed
|
||||
|
||||
@return A point to new added FvHandle entry. If FvHandle with the same FvImage guid
|
||||
has been added, NULL will return.
|
||||
has been added, NULL will return.
|
||||
|
||||
**/
|
||||
KNOWN_HANDLE *
|
||||
KNOWN_HANDLE *
|
||||
FvIsBeingProcesssed (
|
||||
IN EFI_HANDLE FvHandle
|
||||
)
|
||||
@@ -1247,7 +1247,7 @@ CoreFwVolEventProtocolNotify (
|
||||
KnownHandle = FvIsBeingProcesssed (FvHandle);
|
||||
if (KnownHandle == NULL) {
|
||||
//
|
||||
// The FV with the same FV name guid has already been processed.
|
||||
// The FV with the same FV name guid has already been processed.
|
||||
// So lets skip it!
|
||||
//
|
||||
continue;
|
||||
@@ -1337,7 +1337,7 @@ CoreFwVolEventProtocolNotify (
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// If SMM depex section is found, this FV image is invalid to be supported.
|
||||
// ASSERT FALSE to report this FV image.
|
||||
// ASSERT FALSE to report this FV image.
|
||||
//
|
||||
FreePool (DepexBuffer);
|
||||
ASSERT (FALSE);
|
||||
@@ -1359,7 +1359,7 @@ CoreFwVolEventProtocolNotify (
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// If no depex section, produce a firmware volume block protocol for it so it gets dispatched from.
|
||||
// If no depex section, produce a firmware volume block protocol for it so it gets dispatched from.
|
||||
//
|
||||
CoreProcessFvImageFile (Fv, FvHandle, &NameGuid);
|
||||
} else {
|
||||
|
@@ -3,13 +3,13 @@
|
||||
//
|
||||
// It provides an implementation of DXE Core that is compliant with DXE CIS.
|
||||
//
|
||||
// Copyright (c) 2006 - 2014, 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
|
||||
// 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.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// DxeCore 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
|
||||
@@ -13,8 +13,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"Core DXE Services Driver"
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
The internal header file includes the common header files, defines
|
||||
internal structure and functions used by DxeCore module.
|
||||
|
||||
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
|
||||
@@ -198,43 +198,43 @@ typedef struct {
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
/// Image handle
|
||||
EFI_HANDLE Handle;
|
||||
EFI_HANDLE Handle;
|
||||
/// Image type
|
||||
UINTN Type;
|
||||
UINTN Type;
|
||||
/// If entrypoint has been called
|
||||
BOOLEAN Started;
|
||||
BOOLEAN Started;
|
||||
/// The image's entry point
|
||||
EFI_IMAGE_ENTRY_POINT EntryPoint;
|
||||
EFI_IMAGE_ENTRY_POINT EntryPoint;
|
||||
/// loaded image protocol
|
||||
EFI_LOADED_IMAGE_PROTOCOL Info;
|
||||
EFI_LOADED_IMAGE_PROTOCOL Info;
|
||||
/// Location in memory
|
||||
EFI_PHYSICAL_ADDRESS ImageBasePage;
|
||||
EFI_PHYSICAL_ADDRESS ImageBasePage;
|
||||
/// Number of pages
|
||||
UINTN NumberOfPages;
|
||||
UINTN NumberOfPages;
|
||||
/// Original fixup data
|
||||
CHAR8 *FixupData;
|
||||
CHAR8 *FixupData;
|
||||
/// Tpl of started image
|
||||
EFI_TPL Tpl;
|
||||
EFI_TPL Tpl;
|
||||
/// Status returned by started image
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
/// Size of ExitData from started image
|
||||
UINTN ExitDataSize;
|
||||
UINTN ExitDataSize;
|
||||
/// Pointer to exit data from started image
|
||||
VOID *ExitData;
|
||||
VOID *ExitData;
|
||||
/// Pointer to pool allocation for context save/restore
|
||||
VOID *JumpBuffer;
|
||||
VOID *JumpBuffer;
|
||||
/// Pointer to buffer for context save/restore
|
||||
BASE_LIBRARY_JUMP_BUFFER *JumpContext;
|
||||
BASE_LIBRARY_JUMP_BUFFER *JumpContext;
|
||||
/// Machine type from PE image
|
||||
UINT16 Machine;
|
||||
UINT16 Machine;
|
||||
/// EBC Protocol pointer
|
||||
EFI_EBC_PROTOCOL *Ebc;
|
||||
EFI_EBC_PROTOCOL *Ebc;
|
||||
/// Runtime image list
|
||||
EFI_RUNTIME_IMAGE_ENTRY *RuntimeData;
|
||||
EFI_RUNTIME_IMAGE_ENTRY *RuntimeData;
|
||||
/// Pointer to Loaded Image Device Path Protocol
|
||||
EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;
|
||||
/// PeCoffLoader ImageContext
|
||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||
/// Status returned by LoadImage() service.
|
||||
EFI_STATUS LoadImageStatus;
|
||||
} LOADED_IMAGE_PRIVATE_DATA;
|
||||
@@ -1180,8 +1180,8 @@ CoreConnectHandlesByKey (
|
||||
@retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
|
||||
present in the system.
|
||||
2) No drivers were connected to ControllerHandle.
|
||||
@retval EFI_SECURITY_VIOLATION
|
||||
The user has no permission to start UEFI device drivers on the device path
|
||||
@retval EFI_SECURITY_VIOLATION
|
||||
The user has no permission to start UEFI device drivers on the device path
|
||||
associated with the ControllerHandle or specified by the RemainingDevicePath.
|
||||
|
||||
**/
|
||||
@@ -1426,10 +1426,10 @@ CoreInternalFreePool (
|
||||
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
|
||||
understood.
|
||||
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
image from being loaded. NULL is returned in *ImageHandle.
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
platform policy specifies that the image should not be started.
|
||||
|
||||
**/
|
||||
@@ -1836,7 +1836,7 @@ CoreGetMemorySpaceDescriptor (
|
||||
@param Attributes Specified attributes
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
@retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
|
||||
resource range specified by BaseAddress and Length.
|
||||
@retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource
|
||||
@@ -2671,7 +2671,7 @@ CoreReleaseLock (
|
||||
);
|
||||
|
||||
/**
|
||||
Read data from Firmware Block by FVB protocol Read.
|
||||
Read data from Firmware Block by FVB protocol Read.
|
||||
The data may cross the multi block ranges.
|
||||
|
||||
@param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to read data.
|
||||
|
@@ -2,16 +2,16 @@
|
||||
# This is core module in DXE phase.
|
||||
#
|
||||
# It provides an implementation of DXE Core that is compliant with DXE CIS.
|
||||
#
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
@@ -182,7 +182,7 @@
|
||||
gEfiWatchdogTimerArchProtocolGuid ## CONSUMES
|
||||
|
||||
[FeaturePcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES
|
||||
|
@@ -260,7 +260,7 @@ DxeMain (
|
||||
}
|
||||
Status = InitializeCpuExceptionHandlersEx (VectorInfoList, NULL);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
//
|
||||
// Initialize Debug Agent to support source level debug in DXE phase
|
||||
//
|
||||
@@ -532,7 +532,7 @@ DxeMain (
|
||||
REPORT_STATUS_CODE (
|
||||
EFI_ERROR_CODE | EFI_ERROR_MAJOR,
|
||||
(EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH)
|
||||
);
|
||||
);
|
||||
}
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
@@ -780,7 +780,7 @@ CoreExitBootServices (
|
||||
Status = CoreTerminateMemoryMap (MapKey);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Notify other drivers that ExitBootServices fail
|
||||
// Notify other drivers that ExitBootServices fail
|
||||
//
|
||||
CoreNotifySignalList (&gEventExitBootServicesFailedGuid);
|
||||
return Status;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
the Dxe Core. The mArchProtocols[] array represents a list of
|
||||
events that represent the Architectural Protocols.
|
||||
|
||||
Copyright (c) 2006 - 2014, 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
|
||||
@@ -206,7 +206,7 @@ GenericProtocolNotify (
|
||||
}
|
||||
|
||||
/**
|
||||
Creates an event for each entry in a table that is fired everytime a Protocol
|
||||
Creates an event for each entry in a table that is fired everytime a Protocol
|
||||
of a specific type is installed.
|
||||
|
||||
@param Entry Pointer to EFI_CORE_PROTOCOL_NOTIFY_ENTRY.
|
||||
@@ -245,7 +245,7 @@ CoreNotifyOnProtocolEntryTable (
|
||||
}
|
||||
|
||||
/**
|
||||
Creates an events for the Architectural Protocols and the optional protocols
|
||||
Creates an events for the Architectural Protocols and the optional protocols
|
||||
that are fired everytime a Protocol of a specific type is installed.
|
||||
|
||||
**/
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Task priority (TPL) functions.
|
||||
|
||||
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
|
||||
@@ -28,7 +28,7 @@ CoreSetInterruptState (
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN InSmm;
|
||||
|
||||
|
||||
if (gCpu == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
Layers on top of Firmware Block protocol to produce a file abstraction
|
||||
of FV based files.
|
||||
|
||||
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
|
||||
@@ -34,8 +34,8 @@ FV_DEVICE mFvDevice = {
|
||||
FvReadFile,
|
||||
FvReadFileSection,
|
||||
FvWriteFile,
|
||||
FvGetNextFile,
|
||||
sizeof (UINTN),
|
||||
FvGetNextFile,
|
||||
sizeof (UINTN),
|
||||
NULL,
|
||||
FvGetVolumeInfo,
|
||||
FvSetVolumeInfo
|
||||
@@ -56,7 +56,7 @@ FV_DEVICE mFvDevice = {
|
||||
// FFS helper functions
|
||||
//
|
||||
/**
|
||||
Read data from Firmware Block by FVB protocol Read.
|
||||
Read data from Firmware Block by FVB protocol Read.
|
||||
The data may cross the multi block ranges.
|
||||
|
||||
@param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to read data.
|
||||
@@ -86,7 +86,7 @@ ReadFvbData (
|
||||
UINTN BlockIndex;
|
||||
UINTN ReadDataSize;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
||||
//
|
||||
// Try read data in current block
|
||||
//
|
||||
@@ -102,7 +102,7 @@ ReadFvbData (
|
||||
//
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Data crosses the blocks, read data from next block
|
||||
//
|
||||
@@ -118,7 +118,7 @@ ReadFvbData (
|
||||
//
|
||||
// Read data from the crossing blocks
|
||||
//
|
||||
BlockIndex = 0;
|
||||
BlockIndex = 0;
|
||||
while (BlockIndex < NumberOfBlocks && DataSize >= BlockSize) {
|
||||
Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &BlockSize, Data);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -128,20 +128,20 @@ ReadFvbData (
|
||||
DataSize -= BlockSize;
|
||||
BlockIndex ++;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Data doesn't exceed the current block range.
|
||||
//
|
||||
if (DataSize < BlockSize) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Data must be got from the next block range.
|
||||
//
|
||||
*StartLba += NumberOfBlocks;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// read the remaining data
|
||||
//
|
||||
@@ -151,7 +151,7 @@ ReadFvbData (
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Update Lba and Offset used by the following read.
|
||||
//
|
||||
@@ -189,7 +189,7 @@ GetFwVolHeader (
|
||||
EFI_LBA StartLba;
|
||||
UINTN Offset;
|
||||
UINT8 *Buffer;
|
||||
|
||||
|
||||
//
|
||||
// Read the standard FV header
|
||||
//
|
||||
@@ -418,9 +418,9 @@ FvCheck (
|
||||
HeaderSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// read the FV data
|
||||
// read the FV data
|
||||
//
|
||||
for (; Index < BlockMap->NumBlocks; Index ++) {
|
||||
Status = Fvb->Read (Fvb,
|
||||
@@ -715,7 +715,7 @@ NotifyFwVolBlock (
|
||||
// Inherit the authentication status from FVB.
|
||||
//
|
||||
FvDevice->AuthenticationStatus = GetFvbAuthenticationStatus (Fvb);
|
||||
|
||||
|
||||
if (!EFI_ERROR (FvCheck (FvDevice))) {
|
||||
//
|
||||
// Install an New FV protocol on the existing handle
|
||||
|
@@ -4,7 +4,7 @@
|
||||
It consumes FV HOBs and creates read-only Firmare Volume Block protocol
|
||||
instances for each of them.
|
||||
|
||||
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
|
||||
@@ -542,7 +542,7 @@ ProduceFVBProtocolOnBuffer (
|
||||
CoreFreePool (FvbDev);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Last, fill in the cache with the linear address of the blocks
|
||||
//
|
||||
@@ -582,11 +582,11 @@ ProduceFVBProtocolOnBuffer (
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
CopyGuid (
|
||||
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName,
|
||||
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName,
|
||||
(GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// Attach FvVolBlock Protocol to new handle
|
||||
|
@@ -126,7 +126,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mGcdIoTypeNames[] = {
|
||||
"NonExist", // EfiGcdIoTypeNonExistent
|
||||
"Reserved", // EfiGcdIoTypeReserved
|
||||
"I/O ", // EfiGcdIoTypeIo
|
||||
"Unknown " // EfiGcdIoTypeMaximum
|
||||
"Unknown " // EfiGcdIoTypeMaximum
|
||||
};
|
||||
|
||||
///
|
||||
@@ -146,7 +146,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mGcdAllocationTypeNames[] = {
|
||||
PcdDebugPrintErrorLevel has the DEBUG_GCD bit set.
|
||||
|
||||
@param InitialMap TRUE if the initial GCD Memory Map is being dumped. Otherwise, FALSE.
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -159,7 +159,7 @@ CoreDumpGcdMemorySpaceMap (
|
||||
UINTN NumberOfDescriptors;
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
|
||||
UINTN Index;
|
||||
|
||||
|
||||
Status = CoreGetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||
ASSERT (Status == EFI_SUCCESS && MemorySpaceMap != NULL);
|
||||
|
||||
@@ -169,11 +169,11 @@ CoreDumpGcdMemorySpaceMap (
|
||||
DEBUG ((DEBUG_GCD, "GCDMemType Range Capabilities Attributes \n"));
|
||||
DEBUG ((DEBUG_GCD, "========== ================================= ================ ================\n"));
|
||||
for (Index = 0; Index < NumberOfDescriptors; Index++) {
|
||||
DEBUG ((DEBUG_GCD, "%a %016lx-%016lx %016lx %016lx%c\n",
|
||||
DEBUG ((DEBUG_GCD, "%a %016lx-%016lx %016lx %016lx%c\n",
|
||||
mGcdMemoryTypeNames[MIN (MemorySpaceMap[Index].GcdMemoryType, EfiGcdMemoryTypeMaximum)],
|
||||
MemorySpaceMap[Index].BaseAddress,
|
||||
MemorySpaceMap[Index].BaseAddress,
|
||||
MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - 1,
|
||||
MemorySpaceMap[Index].Capabilities,
|
||||
MemorySpaceMap[Index].Capabilities,
|
||||
MemorySpaceMap[Index].Attributes,
|
||||
MemorySpaceMap[Index].ImageHandle == NULL ? ' ' : '*'
|
||||
));
|
||||
@@ -184,11 +184,11 @@ CoreDumpGcdMemorySpaceMap (
|
||||
}
|
||||
|
||||
/**
|
||||
Dump the entire contents if the GCD I/O Space Map using DEBUG() macros when
|
||||
Dump the entire contents if the GCD I/O Space Map using DEBUG() macros when
|
||||
PcdDebugPrintErrorLevel has the DEBUG_GCD bit set.
|
||||
|
||||
@param InitialMap TRUE if the initial GCD I/O Map is being dumped. Otherwise, FALSE.
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -201,20 +201,20 @@ CoreDumpGcdIoSpaceMap (
|
||||
UINTN NumberOfDescriptors;
|
||||
EFI_GCD_IO_SPACE_DESCRIPTOR *IoSpaceMap;
|
||||
UINTN Index;
|
||||
|
||||
|
||||
Status = CoreGetIoSpaceMap (&NumberOfDescriptors, &IoSpaceMap);
|
||||
ASSERT (Status == EFI_SUCCESS && IoSpaceMap != NULL);
|
||||
|
||||
|
||||
if (InitialMap) {
|
||||
DEBUG ((DEBUG_GCD, "GCD:Initial GCD I/O Space Map\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_GCD, "GCDIoType Range \n"));
|
||||
DEBUG ((DEBUG_GCD, "========== =================================\n"));
|
||||
for (Index = 0; Index < NumberOfDescriptors; Index++) {
|
||||
DEBUG ((DEBUG_GCD, "%a %016lx-%016lx%c\n",
|
||||
DEBUG ((DEBUG_GCD, "%a %016lx-%016lx%c\n",
|
||||
mGcdIoTypeNames[MIN (IoSpaceMap[Index].GcdIoType, EfiGcdIoTypeMaximum)],
|
||||
IoSpaceMap[Index].BaseAddress,
|
||||
IoSpaceMap[Index].BaseAddress,
|
||||
IoSpaceMap[Index].BaseAddress + IoSpaceMap[Index].Length - 1,
|
||||
IoSpaceMap[Index].ImageHandle == NULL ? ' ' : '*'
|
||||
));
|
||||
@@ -223,11 +223,11 @@ CoreDumpGcdIoSpaceMap (
|
||||
FreePool (IoSpaceMap);
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Validate resource descriptor HOB's attributes.
|
||||
|
||||
If Attributes includes some memory resource's settings, it should include
|
||||
If Attributes includes some memory resource's settings, it should include
|
||||
the corresponding capabilites also.
|
||||
|
||||
@param Attributes Resource descriptor HOB attributes.
|
||||
@@ -876,13 +876,13 @@ CoreConvertSpace (
|
||||
//
|
||||
CpuArchAttributes = ConverToCpuArchAttributes (Attributes);
|
||||
//
|
||||
// CPU arch attributes include page attributes and cache attributes.
|
||||
// CPU arch attributes include page attributes and cache attributes.
|
||||
// Only page attributes supports to be cleared, but not cache attributes.
|
||||
// Caller is expected to use GetMemorySpaceDescriptor() to get the current
|
||||
// attributes, AND/OR attributes, and then calls SetMemorySpaceAttributes()
|
||||
// to set the new attributes.
|
||||
// So 0 CPU arch attributes should not happen as memory should always have
|
||||
// a cache attribute (no matter UC or WB, etc).
|
||||
// a cache attribute (no matter UC or WB, etc).
|
||||
//
|
||||
// Here, 0 CPU arch attributes will be filtered to be compatible with the
|
||||
// case that caller just calls SetMemorySpaceAttributes() with none CPU
|
||||
@@ -1293,7 +1293,7 @@ Done:
|
||||
DEBUG ((DEBUG_GCD, " (BaseAddress = %016lx)", *BaseAddress));
|
||||
}
|
||||
DEBUG ((DEBUG_GCD, "\n"));
|
||||
|
||||
|
||||
if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {
|
||||
CoreReleaseGcdMemoryLock ();
|
||||
CoreDumpGcdMemorySpaceMap (FALSE);
|
||||
@@ -1384,7 +1384,7 @@ CoreAllocateMemorySpace (
|
||||
DEBUG ((DEBUG_GCD, " Alignment = %016lx\n", LShiftU64 (1, Alignment)));
|
||||
DEBUG ((DEBUG_GCD, " ImageHandle = %p\n", ImageHandle));
|
||||
DEBUG ((DEBUG_GCD, " DeviceHandle = %p\n", DeviceHandle));
|
||||
|
||||
|
||||
return CoreAllocateSpace (
|
||||
GCD_ALLOCATE_MEMORY_OPERATION,
|
||||
GcdAllocateType,
|
||||
@@ -1516,7 +1516,7 @@ CoreRemoveMemorySpace (
|
||||
)
|
||||
{
|
||||
DEBUG ((DEBUG_GCD, "GCD:RemoveMemorySpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
|
||||
|
||||
|
||||
return CoreConvertSpace (GCD_REMOVE_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
|
||||
}
|
||||
|
||||
@@ -1605,7 +1605,7 @@ CoreGetMemorySpaceDescriptor (
|
||||
@param Attributes Specified attributes
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
@retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
|
||||
resource range specified by BaseAddress and Length.
|
||||
@retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource
|
||||
@@ -1762,7 +1762,7 @@ CoreAddIoSpace (
|
||||
{
|
||||
DEBUG ((DEBUG_GCD, "GCD:AddIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
|
||||
DEBUG ((DEBUG_GCD, " GcdIoType = %a\n", mGcdIoTypeNames[MIN (GcdIoType, EfiGcdIoTypeMaximum)]));
|
||||
|
||||
|
||||
//
|
||||
// Make sure parameters are valid
|
||||
//
|
||||
@@ -1812,7 +1812,7 @@ CoreAllocateIoSpace (
|
||||
DEBUG ((DEBUG_GCD, " Alignment = %016lx\n", LShiftU64 (1, Alignment)));
|
||||
DEBUG ((DEBUG_GCD, " ImageHandle = %p\n", ImageHandle));
|
||||
DEBUG ((DEBUG_GCD, " DeviceHandle = %p\n", DeviceHandle));
|
||||
|
||||
|
||||
return CoreAllocateSpace (
|
||||
GCD_ALLOCATE_IO_OPERATION,
|
||||
GcdAllocateType,
|
||||
@@ -1868,7 +1868,7 @@ CoreRemoveIoSpace (
|
||||
)
|
||||
{
|
||||
DEBUG ((DEBUG_GCD, "GCD:RemoveIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));
|
||||
|
||||
|
||||
return CoreConvertSpace (GCD_REMOVE_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);
|
||||
}
|
||||
|
||||
@@ -2138,15 +2138,15 @@ CoreInitializeMemoryServices (
|
||||
// Cache the PHIT HOB for later use
|
||||
//
|
||||
PhitHob = Hob.HandoffInformationTable;
|
||||
|
||||
|
||||
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||
ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
||||
ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
|
||||
|
||||
//
|
||||
// cache the Top address for loading modules at Fixed Address
|
||||
//
|
||||
gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress = PhitHob->EfiMemoryTop
|
||||
ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
||||
ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
|
||||
|
||||
//
|
||||
// cache the Top address for loading modules at Fixed Address
|
||||
//
|
||||
gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress = PhitHob->EfiMemoryTop
|
||||
+ EFI_PAGES_TO_SIZE(ReservedCodePageNumber);
|
||||
}
|
||||
//
|
||||
@@ -2213,14 +2213,14 @@ CoreInitializeMemoryServices (
|
||||
Length = PageAlignLength (ResourceHob->PhysicalStart + ResourceHob->ResourceLength - BaseAddress);
|
||||
if (Length < MinimalMemorySizeNeeded) {
|
||||
//
|
||||
// If that range is not large enough to intialize the DXE Core, then
|
||||
// If that range is not large enough to intialize the DXE Core, then
|
||||
// Compute range between PHIT EfiFreeMemoryBottom and PHIT EfiFreeMemoryTop
|
||||
//
|
||||
BaseAddress = PageAlignAddress (PhitHob->EfiFreeMemoryBottom);
|
||||
Length = PageAlignLength (PhitHob->EfiFreeMemoryTop - BaseAddress);
|
||||
if (Length < MinimalMemorySizeNeeded) {
|
||||
//
|
||||
// If that range is not large enough to intialize the DXE Core, then
|
||||
// If that range is not large enough to intialize the DXE Core, then
|
||||
// Compute range between the start of the Resource Descriptor HOB and the start of the HOB List
|
||||
//
|
||||
BaseAddress = PageAlignAddress (ResourceHob->PhysicalStart);
|
||||
@@ -2297,7 +2297,7 @@ CoreInitializeMemoryServices (
|
||||
//
|
||||
BaseAddress = TestedMemoryBaseAddress;
|
||||
Length = TestedMemoryLength;
|
||||
Attributes = ResourceHob->ResourceAttribute;
|
||||
Attributes = ResourceHob->ResourceAttribute;
|
||||
HighAddress = ResourceHob->PhysicalStart;
|
||||
}
|
||||
}
|
||||
@@ -2403,7 +2403,7 @@ CoreInitializeGcdServices (
|
||||
InsertHeadList (&mGcdMemorySpaceMap, &Entry->Link);
|
||||
|
||||
CoreDumpGcdMemorySpaceMap (TRUE);
|
||||
|
||||
|
||||
//
|
||||
// Initialize the GCD I/O Space Map
|
||||
//
|
||||
@@ -2415,7 +2415,7 @@ CoreInitializeGcdServices (
|
||||
InsertHeadList (&mGcdIoSpaceMap, &Entry->Link);
|
||||
|
||||
CoreDumpGcdIoSpaceMap (TRUE);
|
||||
|
||||
|
||||
//
|
||||
// Walk the HOB list and add all resource descriptors to the GCD
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Support functions to connect/disconnect UEFI Driver model Protocol
|
||||
|
||||
Copyright (c) 2006 - 2014, 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
|
||||
@@ -40,8 +40,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
@retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
|
||||
present in the system.
|
||||
2) No drivers were connected to ControllerHandle.
|
||||
@retval EFI_SECURITY_VIOLATION
|
||||
The user has no permission to start UEFI device drivers on the device path
|
||||
@retval EFI_SECURITY_VIOLATION
|
||||
The user has no permission to start UEFI device drivers on the device path
|
||||
associated with the ControllerHandle or specified by the RemainingDevicePath.
|
||||
|
||||
**/
|
||||
@@ -112,7 +112,7 @@ CoreConnectController (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Handle = ControllerHandle;
|
||||
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
UEFI handle & protocol handling.
|
||||
|
||||
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
|
||||
@@ -604,7 +604,7 @@ CoreInstallMultipleProtocolInterfaces (
|
||||
CoreUninstallProtocolInterface (*Handle, Protocol, Interface);
|
||||
}
|
||||
VA_END (Args);
|
||||
|
||||
|
||||
*Handle = OldHandle;
|
||||
}
|
||||
|
||||
@@ -1314,7 +1314,7 @@ Done:
|
||||
form of EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
|
||||
@param EntryCount Number of EntryBuffer entries
|
||||
|
||||
@retval EFI_SUCCESS The open protocol information was returned in EntryBuffer,
|
||||
@retval EFI_SUCCESS The open protocol information was returned in EntryBuffer,
|
||||
and the number of entries was returned EntryCount.
|
||||
@retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.
|
||||
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Support functions for managing protocol.
|
||||
|
||||
Copyright (c) 2006 - 2008, 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
|
||||
@@ -26,7 +26,7 @@ typedef struct {
|
||||
/// All handles list of IHANDLE
|
||||
LIST_ENTRY AllHandles;
|
||||
/// List of PROTOCOL_INTERFACE's for this handle
|
||||
LIST_ENTRY Protocols;
|
||||
LIST_ENTRY Protocols;
|
||||
UINTN LocateRequest;
|
||||
/// The Handle Database Key value when this handle was last created or modified
|
||||
UINT64 Key;
|
||||
@@ -44,13 +44,13 @@ typedef struct {
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
/// Link Entry inserted to mProtocolDatabase
|
||||
LIST_ENTRY AllEntries;
|
||||
LIST_ENTRY AllEntries;
|
||||
/// ID of the protocol
|
||||
EFI_GUID ProtocolID;
|
||||
EFI_GUID ProtocolID;
|
||||
/// All protocol interfaces
|
||||
LIST_ENTRY Protocols;
|
||||
LIST_ENTRY Protocols;
|
||||
/// Registerd notification handlers
|
||||
LIST_ENTRY Notify;
|
||||
LIST_ENTRY Notify;
|
||||
} PROTOCOL_ENTRY;
|
||||
|
||||
|
||||
@@ -63,17 +63,17 @@ typedef struct {
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
/// Link on IHANDLE.Protocols
|
||||
LIST_ENTRY Link;
|
||||
LIST_ENTRY Link;
|
||||
/// Back pointer
|
||||
IHANDLE *Handle;
|
||||
IHANDLE *Handle;
|
||||
/// Link on PROTOCOL_ENTRY.Protocols
|
||||
LIST_ENTRY ByProtocol;
|
||||
LIST_ENTRY ByProtocol;
|
||||
/// The protocol ID
|
||||
PROTOCOL_ENTRY *Protocol;
|
||||
PROTOCOL_ENTRY *Protocol;
|
||||
/// The interface value
|
||||
VOID *Interface;
|
||||
VOID *Interface;
|
||||
/// OPEN_PROTOCOL_DATA list
|
||||
LIST_ENTRY OpenList;
|
||||
LIST_ENTRY OpenList;
|
||||
UINTN OpenListCount;
|
||||
|
||||
} PROTOCOL_INTERFACE;
|
||||
@@ -83,7 +83,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
///Link on PROTOCOL_INTERFACE.OpenList
|
||||
LIST_ENTRY Link;
|
||||
LIST_ENTRY Link;
|
||||
|
||||
EFI_HANDLE AgentHandle;
|
||||
EFI_HANDLE ControllerHandle;
|
||||
@@ -101,11 +101,11 @@ typedef struct {
|
||||
UINTN Signature;
|
||||
PROTOCOL_ENTRY *Protocol;
|
||||
/// All notifications for this protocol
|
||||
LIST_ENTRY Link;
|
||||
LIST_ENTRY Link;
|
||||
/// Event to notify
|
||||
EFI_EVENT Event;
|
||||
EFI_EVENT Event;
|
||||
/// Last position notified
|
||||
LIST_ENTRY *Position;
|
||||
LIST_ENTRY *Position;
|
||||
} PROTOCOL_NOTIFY;
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Locate handle functions
|
||||
|
||||
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
|
||||
@@ -457,7 +457,7 @@ CoreLocateDevicePath (
|
||||
if (IsDevicePathEndInstance (TmpDevicePath)) {
|
||||
//
|
||||
// If DevicePath is a multi-instance device path,
|
||||
// the function will operate on the first instance
|
||||
// the function will operate on the first instance
|
||||
//
|
||||
break;
|
||||
}
|
||||
@@ -522,7 +522,7 @@ CoreLocateDevicePath (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
*Device = BestDevice;
|
||||
|
||||
|
||||
//
|
||||
// Return the remaining part of the device path
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Core image handling services to load and unload PeImage.
|
||||
|
||||
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
|
||||
@@ -73,7 +73,7 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage = {
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINT64 *mDxeCodeMemoryRangeUsageBitMap=NULL;
|
||||
|
||||
@@ -108,7 +108,7 @@ GetMachineTypeName (
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
|
||||
for (Index = 0; Index < sizeof(mMachineTypeInfo)/sizeof(mMachineTypeInfo[0]); Index++) {
|
||||
if (mMachineTypeInfo[Index].MachineType == MachineType) {
|
||||
return mMachineTypeInfo[Index].MachineTypeName;
|
||||
@@ -138,7 +138,7 @@ CoreInitializeImageServices (
|
||||
UINT64 DxeCoreImageLength;
|
||||
VOID *DxeCoreEntryPoint;
|
||||
EFI_PEI_HOB_POINTERS DxeCoreHob;
|
||||
|
||||
|
||||
//
|
||||
// Searching for image hob
|
||||
//
|
||||
@@ -158,7 +158,7 @@ CoreInitializeImageServices (
|
||||
DxeCoreImageLength = DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.MemoryLength;
|
||||
DxeCoreEntryPoint = (VOID *) (UINTN) DxeCoreHob.MemoryAllocationModule->EntryPoint;
|
||||
gDxeCoreFileName = &DxeCoreHob.MemoryAllocationModule->ModuleName;
|
||||
|
||||
|
||||
//
|
||||
// Initialize the fields for an internal driver
|
||||
//
|
||||
@@ -263,11 +263,11 @@ CoreReadImageFile (
|
||||
/**
|
||||
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 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
|
||||
**/
|
||||
@@ -278,23 +278,23 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
)
|
||||
{
|
||||
UINT32 DxeCodePageNumber;
|
||||
UINT64 DxeCodeSize;
|
||||
UINT64 DxeCodeSize;
|
||||
EFI_PHYSICAL_ADDRESS DxeCodeBase;
|
||||
UINTN BaseOffsetPageNumber;
|
||||
UINTN TopOffsetPageNumber;
|
||||
UINTN Index;
|
||||
//
|
||||
// The DXE code range includes RuntimeCodePage range and Boot time code range.
|
||||
//
|
||||
//
|
||||
DxeCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
||||
DxeCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
|
||||
DxeCodeSize = EFI_PAGES_TO_SIZE(DxeCodePageNumber);
|
||||
DxeCodeBase = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress - DxeCodeSize;
|
||||
|
||||
|
||||
//
|
||||
// If the memory usage bit map is not initialized, do it. Every bit in the array
|
||||
// If the memory usage bit map is not initialized, do it. Every bit in the array
|
||||
// indicate the status of the corresponding memory page, available or not
|
||||
//
|
||||
//
|
||||
if (mDxeCodeMemoryRangeUsageBitMap == NULL) {
|
||||
mDxeCodeMemoryRangeUsageBitMap = AllocateZeroPool(((DxeCodePageNumber/64) + 1)*sizeof(UINT64));
|
||||
}
|
||||
@@ -309,11 +309,11 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
//
|
||||
if (gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress < ImageBase + ImageSize ||
|
||||
DxeCodeBase > ImageBase) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
//
|
||||
// Test if the memory is avalaible or not.
|
||||
//
|
||||
//
|
||||
BaseOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase - DxeCodeBase));
|
||||
TopOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase + ImageSize - DxeCodeBase));
|
||||
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index ++) {
|
||||
@@ -321,17 +321,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 ++) {
|
||||
mDxeCodeMemoryRangeUsageBitMap[Index / 64] |= LShiftU64(1, (Index % 64));
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -358,10 +358,10 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
UINT16 NumberOfSections;
|
||||
IMAGE_FILE_HANDLE *Handle;
|
||||
UINT64 ValueInSectionHeader;
|
||||
|
||||
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
|
||||
|
||||
//
|
||||
// Get PeHeader pointer
|
||||
//
|
||||
@@ -395,30 +395,30 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
}
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
|
||||
|
||||
if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_CNT_CODE) == 0) {
|
||||
//
|
||||
// Build tool will save the address in PointerToRelocations & PointerToLineNumbers fields in the first section header
|
||||
// that doesn't point to code section in image header, as well as ImageBase field of image header. And there is an
|
||||
// assumption that when the feature is enabled, if a module is assigned a loading address by tools, PointerToRelocations
|
||||
// that doesn't point to code section in image header, as well as ImageBase field of image header. And there is an
|
||||
// assumption that when the feature is enabled, if a module is assigned a loading address by tools, PointerToRelocations
|
||||
// & PointerToLineNumbers fields should NOT be Zero, or else, these 2 fields should be set to Zero
|
||||
//
|
||||
ValueInSectionHeader = ReadUnaligned64((UINT64*)&SectionHeader.PointerToRelocations);
|
||||
if (ValueInSectionHeader != 0) {
|
||||
//
|
||||
// When the feature is configured as load module at fixed absolute address, the ImageAddress field of ImageContext
|
||||
// When the feature is configured as load module at fixed absolute address, the ImageAddress field of ImageContext
|
||||
// hold the spcified address. If the feature is configured as load module at fixed offset, ImageAddress hold an offset
|
||||
// relative to top address
|
||||
//
|
||||
if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) < 0) {
|
||||
ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)(INTN)ImageContext->ImageAddress;
|
||||
ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)(INTN)ImageContext->ImageAddress;
|
||||
}
|
||||
//
|
||||
// Check if the memory range is available.
|
||||
//
|
||||
Status = CheckAndMarkFixLoadingMemoryUsageBitMap (ImageContext->ImageAddress, (UINTN)(ImageContext->ImageSize + ImageContext->SectionAlignment));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
|
||||
}
|
||||
@@ -541,17 +541,17 @@ CoreLoadPeImage (
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// If the code memory is not ready, invoke CoreAllocatePage with AllocateAnyPages to load the driver.
|
||||
//
|
||||
// If the code memory is not ready, invoke CoreAllocatePage with AllocateAnyPages to load the driver.
|
||||
//
|
||||
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Loading module at fixed address failed since specified memory is not available.\n"));
|
||||
|
||||
|
||||
Status = CoreAllocatePages (
|
||||
AllocateAnyPages,
|
||||
(EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType),
|
||||
Image->NumberOfPages,
|
||||
&Image->ImageContext.ImageAddress
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (Image->ImageContext.ImageAddress >= 0x100000 || Image->ImageContext.RelocationsStripped) {
|
||||
Status = CoreAllocatePages (
|
||||
@@ -1030,10 +1030,10 @@ CoreUnloadAndCloseImage (
|
||||
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
|
||||
understood.
|
||||
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
image from being loaded. NULL is returned in *ImageHandle.
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
platform policy specifies that the image should not be started.
|
||||
|
||||
**/
|
||||
@@ -1145,7 +1145,7 @@ CoreLoadImageCommon (
|
||||
// Get the source file buffer by its device path.
|
||||
//
|
||||
FHand.Source = GetFileBufferByFilePath (
|
||||
BootPolicy,
|
||||
BootPolicy,
|
||||
FilePath,
|
||||
&FHand.SourceSize,
|
||||
&AuthenticationStatus
|
||||
@@ -1417,10 +1417,10 @@ Done:
|
||||
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
|
||||
understood.
|
||||
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
image from being loaded. NULL is returned in *ImageHandle.
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
platform policy specifies that the image should not be started.
|
||||
|
||||
**/
|
||||
@@ -1453,10 +1453,10 @@ CoreLoadImage (
|
||||
EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION | EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION
|
||||
);
|
||||
|
||||
Handle = NULL;
|
||||
Handle = NULL;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// ImageHandle will be valid only Status is success.
|
||||
// ImageHandle will be valid only Status is success.
|
||||
//
|
||||
Handle = *ImageHandle;
|
||||
}
|
||||
@@ -1498,10 +1498,10 @@ CoreLoadImage (
|
||||
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
|
||||
understood.
|
||||
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
image from being loaded. NULL is returned in *ImageHandle.
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
platform policy specifies that the image should not be started.
|
||||
|
||||
**/
|
||||
@@ -1538,10 +1538,10 @@ CoreLoadImageEx (
|
||||
Attribute
|
||||
);
|
||||
|
||||
Handle = NULL;
|
||||
Handle = NULL;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// ImageHandle will be valid only Status is success.
|
||||
// ImageHandle will be valid only Status is success.
|
||||
//
|
||||
Handle = *ImageHandle;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Data structure and functions to load and unload PeImage.
|
||||
|
||||
Copyright (c) 2006 - 2011, 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
|
||||
@@ -21,7 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
/// Image handle
|
||||
EFI_HANDLE Handle;
|
||||
EFI_HANDLE Handle;
|
||||
EFI_PE32_IMAGE_PROTOCOL Pe32Image;
|
||||
} LOAD_PE32_IMAGE_PRIVATE_DATA;
|
||||
|
||||
@@ -70,10 +70,10 @@ typedef struct {
|
||||
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
|
||||
understood.
|
||||
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||
image from being loaded. NULL is returned in *ImageHandle.
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||
platform policy specifies that the image should not be started.
|
||||
|
||||
**/
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Support routines for UEFI memory profile.
|
||||
|
||||
Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 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
|
||||
@@ -76,10 +76,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED UINTN mMemoryProfileDriverPathS
|
||||
@param[in, out] ProfileSize On entry, points to the size in bytes of the ProfileBuffer.
|
||||
On return, points to the size of the data returned in ProfileBuffer.
|
||||
@param[out] ProfileBuffer Profile buffer.
|
||||
|
||||
|
||||
@return EFI_SUCCESS Get the memory profile data successfully.
|
||||
@return EFI_UNSUPPORTED Memory profile is unsupported.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
ProfileSize is updated with the size required.
|
||||
|
||||
**/
|
||||
@@ -514,7 +514,7 @@ NeedRecordThisDriver (
|
||||
//
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Record FilePath without END node.
|
||||
//
|
||||
@@ -1572,10 +1572,10 @@ MemoryProfileCopyData (
|
||||
@param[in, out] ProfileSize On entry, points to the size in bytes of the ProfileBuffer.
|
||||
On return, points to the size of the data returned in ProfileBuffer.
|
||||
@param[out] ProfileBuffer Profile buffer.
|
||||
|
||||
|
||||
@return EFI_SUCCESS Get the memory profile data successfully.
|
||||
@return EFI_UNSUPPORTED Memory profile is unsupported.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
ProfileSize is updated with the size required.
|
||||
|
||||
**/
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
UEFI Memory page management functions.
|
||||
|
||||
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 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
|
||||
@@ -93,7 +93,7 @@ EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1] = {
|
||||
};
|
||||
//
|
||||
// Only used when load module at fixed address feature is enabled. True means the memory is alreay successfully allocated
|
||||
// and ready to load the module in to specified address.or else, the memory is not ready and module will be loaded at a
|
||||
// and ready to load the module in to specified address.or else, the memory is not ready and module will be loaded at a
|
||||
// address assigned by DXE core.
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN gLoadFixedAddressCodeMemoryReady = FALSE;
|
||||
@@ -178,22 +178,22 @@ CoreAddRange (
|
||||
ASSERT_LOCKED (&gMemoryLock);
|
||||
|
||||
DEBUG ((DEBUG_PAGE, "AddRange: %lx-%lx to %d\n", Start, End, Type));
|
||||
|
||||
|
||||
//
|
||||
// If memory of type EfiConventionalMemory is being added that includes the page
|
||||
// starting at address 0, then zero the page starting at address 0. This has
|
||||
// two benifits. It helps find NULL pointer bugs and it also maximizes
|
||||
// compatibility with operating systems that may evaluate memory in this page
|
||||
// for legacy data structures. If memory of any other type is added starting
|
||||
// at address 0, then do not zero the page at address 0 because the page is being
|
||||
// If memory of type EfiConventionalMemory is being added that includes the page
|
||||
// starting at address 0, then zero the page starting at address 0. This has
|
||||
// two benifits. It helps find NULL pointer bugs and it also maximizes
|
||||
// compatibility with operating systems that may evaluate memory in this page
|
||||
// for legacy data structures. If memory of any other type is added starting
|
||||
// at address 0, then do not zero the page at address 0 because the page is being
|
||||
// used for other purposes.
|
||||
//
|
||||
//
|
||||
if (Type == EfiConventionalMemory && Start == 0 && (End >= EFI_PAGE_SIZE - 1)) {
|
||||
if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & BIT0) == 0) {
|
||||
SetMem ((VOID *)(UINTN)Start, EFI_PAGE_SIZE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Memory map being altered so updated key
|
||||
//
|
||||
@@ -454,8 +454,8 @@ PromoteMemoryResource (
|
||||
return Promoted;
|
||||
}
|
||||
/**
|
||||
This function try to allocate Runtime code & Boot time code memory range. If LMFA enabled, 2 patchable PCD
|
||||
PcdLoadFixAddressRuntimeCodePageNumber & PcdLoadFixAddressBootTimeCodePageNumber which are set by tools will record the
|
||||
This function try to allocate Runtime code & Boot time code memory range. If LMFA enabled, 2 patchable PCD
|
||||
PcdLoadFixAddressRuntimeCodePageNumber & PcdLoadFixAddressBootTimeCodePageNumber which are set by tools will record the
|
||||
size of boot time and runtime code.
|
||||
|
||||
**/
|
||||
@@ -473,7 +473,7 @@ CoreLoadingFixedAddressHook (
|
||||
//
|
||||
// Make sure these 2 areas are not initialzied.
|
||||
//
|
||||
if (!gLoadFixedAddressCodeMemoryReady) {
|
||||
if (!gLoadFixedAddressCodeMemoryReady) {
|
||||
RuntimeCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
||||
BootTimeCodePageNumber= PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
|
||||
RuntimeCodeBase = (EFI_PHYSICAL_ADDRESS)(gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress - EFI_PAGES_TO_SIZE (RuntimeCodePageNumber));
|
||||
@@ -489,7 +489,7 @@ CoreLoadingFixedAddressHook (
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
//
|
||||
// Runtime memory allocation failed
|
||||
// Runtime memory allocation failed
|
||||
//
|
||||
return;
|
||||
}
|
||||
@@ -504,19 +504,19 @@ CoreLoadingFixedAddressHook (
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
//
|
||||
// boot memory allocation failed. Free Runtime code range and will try the allocation again when
|
||||
// new memory range is installed.
|
||||
//
|
||||
CoreFreePages (
|
||||
// boot memory allocation failed. Free Runtime code range and will try the allocation again when
|
||||
// new memory range is installed.
|
||||
//
|
||||
CoreFreePages (
|
||||
RuntimeCodeBase,
|
||||
RuntimeCodePageNumber
|
||||
);
|
||||
return;
|
||||
}
|
||||
gLoadFixedAddressCodeMemoryReady = TRUE;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Called to initialize the memory map and add descriptors to
|
||||
@@ -545,7 +545,7 @@ CoreAddMemoryDescriptor (
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
UINTN FreeIndex;
|
||||
|
||||
|
||||
if ((Start & EFI_PAGE_MASK) != 0) {
|
||||
return;
|
||||
}
|
||||
@@ -568,7 +568,7 @@ CoreAddMemoryDescriptor (
|
||||
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||
CoreLoadingFixedAddressHook();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Check to see if the statistics for the different memory types have already been established
|
||||
//
|
||||
@@ -576,7 +576,7 @@ CoreAddMemoryDescriptor (
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Loop through each memory type in the order specified by the gMemoryTypeInformation[] array
|
||||
//
|
||||
@@ -1163,10 +1163,10 @@ FindFreePages (
|
||||
//
|
||||
if ((UINT32)NewType < EfiMaxMemoryType && MaxAddress >= mMemoryTypeStatistics[NewType].MaximumAddress) {
|
||||
Start = CoreFindFreePagesI (
|
||||
mMemoryTypeStatistics[NewType].MaximumAddress,
|
||||
mMemoryTypeStatistics[NewType].BaseAddress,
|
||||
NoPages,
|
||||
NewType,
|
||||
mMemoryTypeStatistics[NewType].MaximumAddress,
|
||||
mMemoryTypeStatistics[NewType].BaseAddress,
|
||||
NoPages,
|
||||
NewType,
|
||||
Alignment,
|
||||
NeedGuard
|
||||
);
|
||||
@@ -1190,9 +1190,9 @@ FindFreePages (
|
||||
}
|
||||
|
||||
//
|
||||
// The allocation did not succeed in any of the prefered bins even after
|
||||
// promoting resources. Attempt to find free pages anywhere is the requested
|
||||
// address range. If this allocation fails, then there are not enough
|
||||
// The allocation did not succeed in any of the prefered bins even after
|
||||
// promoting resources. Attempt to find free pages anywhere is the requested
|
||||
// address range. If this allocation fails, then there are not enough
|
||||
// resources anywhere to satisfy the request.
|
||||
//
|
||||
Start = CoreFindFreePagesI (MaxAddress, 0, NoPages, NewType, Alignment,
|
||||
@@ -1311,7 +1311,7 @@ CoreInternalAllocatePages (
|
||||
End = Start + NumberOfBytes - 1;
|
||||
|
||||
if ((Start >= End) ||
|
||||
(Start > MaxAddress) ||
|
||||
(Start > MaxAddress) ||
|
||||
(End > MaxAddress)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
@@ -1571,7 +1571,7 @@ MergeMemoryMapDescriptor (
|
||||
//
|
||||
// Check to see if MemoryMapDescriptor is immediately above MemoryMap
|
||||
//
|
||||
if (MemoryMap->PhysicalStart + EFI_PAGES_TO_SIZE ((UINTN)MemoryMap->NumberOfPages) == MemoryMapDescriptor->PhysicalStart) {
|
||||
if (MemoryMap->PhysicalStart + EFI_PAGES_TO_SIZE ((UINTN)MemoryMap->NumberOfPages) == MemoryMapDescriptor->PhysicalStart) {
|
||||
//
|
||||
// Merge MemoryMapDescriptor into MemoryMap
|
||||
//
|
||||
@@ -1604,7 +1604,7 @@ MergeMemoryMapDescriptor (
|
||||
//
|
||||
// MemoryMapDescrtiptor could not be merged with any descriptors in MemoryMap.
|
||||
//
|
||||
// Return the slot immediately after MemoryMapDescriptor as the next available
|
||||
// Return the slot immediately after MemoryMapDescriptor as the next available
|
||||
// slot in the MemoryMap array
|
||||
//
|
||||
return NEXT_MEMORY_DESCRIPTOR (MemoryMapDescriptor, DescriptorSize);
|
||||
@@ -1678,7 +1678,7 @@ CoreGetMemoryMap (
|
||||
NumberOfEntries = 0;
|
||||
for (Link = mGcdMemorySpaceMap.ForwardLink; Link != &mGcdMemorySpaceMap; Link = Link->ForwardLink) {
|
||||
GcdMapEntry = CR (Link, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE);
|
||||
if ((GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypePersistent) ||
|
||||
if ((GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypePersistent) ||
|
||||
(GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypeReserved) ||
|
||||
((GcdMapEntry->GcdMemoryType == EfiGcdMemoryTypeMemoryMappedIo) &&
|
||||
((GcdMapEntry->Attributes & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME))) {
|
||||
@@ -1764,13 +1764,13 @@ CoreGetMemoryMap (
|
||||
}
|
||||
|
||||
//
|
||||
// Check to see if the new Memory Map Descriptor can be merged with an
|
||||
// Check to see if the new Memory Map Descriptor can be merged with an
|
||||
// existing descriptor if they are adjacent and have the same attributes
|
||||
//
|
||||
MemoryMap = MergeMemoryMapDescriptor (MemoryMapStart, MemoryMap, Size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZeroMem (&MergeGcdMapEntry, sizeof (MergeGcdMapEntry));
|
||||
GcdMapEntry = NULL;
|
||||
for (Link = mGcdMemorySpaceMap.ForwardLink; ; Link = Link->ForwardLink) {
|
||||
@@ -1779,8 +1779,8 @@ CoreGetMemoryMap (
|
||||
// Merge adjacent same type and attribute GCD memory range
|
||||
//
|
||||
GcdMapEntry = CR (Link, EFI_GCD_MAP_ENTRY, Link, EFI_GCD_MAP_SIGNATURE);
|
||||
|
||||
if ((MergeGcdMapEntry.Capabilities == GcdMapEntry->Capabilities) &&
|
||||
|
||||
if ((MergeGcdMapEntry.Capabilities == GcdMapEntry->Capabilities) &&
|
||||
(MergeGcdMapEntry.Attributes == GcdMapEntry->Attributes) &&
|
||||
(MergeGcdMapEntry.GcdMemoryType == GcdMapEntry->GcdMemoryType) &&
|
||||
(MergeGcdMapEntry.GcdIoType == GcdMapEntry->GcdIoType)) {
|
||||
@@ -1793,19 +1793,19 @@ CoreGetMemoryMap (
|
||||
((MergeGcdMapEntry.GcdMemoryType == EfiGcdMemoryTypeMemoryMappedIo) &&
|
||||
((MergeGcdMapEntry.Attributes & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME))) {
|
||||
//
|
||||
// Page Align GCD range is required. When it is converted to EFI_MEMORY_DESCRIPTOR,
|
||||
// it will be recorded as page PhysicalStart and NumberOfPages.
|
||||
// Page Align GCD range is required. When it is converted to EFI_MEMORY_DESCRIPTOR,
|
||||
// it will be recorded as page PhysicalStart and NumberOfPages.
|
||||
//
|
||||
ASSERT ((MergeGcdMapEntry.BaseAddress & EFI_PAGE_MASK) == 0);
|
||||
ASSERT (((MergeGcdMapEntry.EndAddress - MergeGcdMapEntry.BaseAddress + 1) & EFI_PAGE_MASK) == 0);
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// Create EFI_MEMORY_DESCRIPTOR for every Reserved and runtime MMIO GCD entries
|
||||
//
|
||||
MemoryMap->PhysicalStart = MergeGcdMapEntry.BaseAddress;
|
||||
MemoryMap->VirtualStart = 0;
|
||||
MemoryMap->NumberOfPages = RShiftU64 ((MergeGcdMapEntry.EndAddress - MergeGcdMapEntry.BaseAddress + 1), EFI_PAGE_SHIFT);
|
||||
MemoryMap->Attribute = (MergeGcdMapEntry.Attributes & ~EFI_MEMORY_PORT_IO) |
|
||||
MemoryMap->Attribute = (MergeGcdMapEntry.Attributes & ~EFI_MEMORY_PORT_IO) |
|
||||
(MergeGcdMapEntry.Capabilities & (EFI_MEMORY_RP | EFI_MEMORY_WP | EFI_MEMORY_XP | EFI_MEMORY_RO |
|
||||
EFI_MEMORY_UC | EFI_MEMORY_UCE | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB));
|
||||
|
||||
@@ -1820,33 +1820,33 @@ CoreGetMemoryMap (
|
||||
}
|
||||
|
||||
//
|
||||
// Check to see if the new Memory Map Descriptor can be merged with an
|
||||
// Check to see if the new Memory Map Descriptor can be merged with an
|
||||
// existing descriptor if they are adjacent and have the same attributes
|
||||
//
|
||||
MemoryMap = MergeMemoryMapDescriptor (MemoryMapStart, MemoryMap, Size);
|
||||
}
|
||||
|
||||
|
||||
if (MergeGcdMapEntry.GcdMemoryType == EfiGcdMemoryTypePersistent) {
|
||||
//
|
||||
// Page Align GCD range is required. When it is converted to EFI_MEMORY_DESCRIPTOR,
|
||||
// it will be recorded as page PhysicalStart and NumberOfPages.
|
||||
// Page Align GCD range is required. When it is converted to EFI_MEMORY_DESCRIPTOR,
|
||||
// it will be recorded as page PhysicalStart and NumberOfPages.
|
||||
//
|
||||
ASSERT ((MergeGcdMapEntry.BaseAddress & EFI_PAGE_MASK) == 0);
|
||||
ASSERT (((MergeGcdMapEntry.EndAddress - MergeGcdMapEntry.BaseAddress + 1) & EFI_PAGE_MASK) == 0);
|
||||
|
||||
//
|
||||
//
|
||||
// Create EFI_MEMORY_DESCRIPTOR for every Persistent GCD entries
|
||||
//
|
||||
MemoryMap->PhysicalStart = MergeGcdMapEntry.BaseAddress;
|
||||
MemoryMap->VirtualStart = 0;
|
||||
MemoryMap->NumberOfPages = RShiftU64 ((MergeGcdMapEntry.EndAddress - MergeGcdMapEntry.BaseAddress + 1), EFI_PAGE_SHIFT);
|
||||
MemoryMap->Attribute = MergeGcdMapEntry.Attributes | EFI_MEMORY_NV |
|
||||
MemoryMap->Attribute = MergeGcdMapEntry.Attributes | EFI_MEMORY_NV |
|
||||
(MergeGcdMapEntry.Capabilities & (EFI_MEMORY_RP | EFI_MEMORY_WP | EFI_MEMORY_XP | EFI_MEMORY_RO |
|
||||
EFI_MEMORY_UC | EFI_MEMORY_UCE | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB));
|
||||
MemoryMap->Type = EfiPersistentMemory;
|
||||
|
||||
|
||||
//
|
||||
// Check to see if the new Memory Map Descriptor can be merged with an
|
||||
// Check to see if the new Memory Map Descriptor can be merged with an
|
||||
// existing descriptor if they are adjacent and have the same attributes
|
||||
//
|
||||
MemoryMap = MergeMemoryMapDescriptor (MemoryMapStart, MemoryMap, Size);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Support functions for managing debug image info table when loading and unloading
|
||||
images.
|
||||
|
||||
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
|
||||
@@ -65,9 +65,9 @@ CoreInitializeDebugImageInfoTable (
|
||||
Memory = MAX_ADDRESS;
|
||||
}
|
||||
Status = CoreAllocatePages (
|
||||
AllocateMaxAddress,
|
||||
AllocateMaxAddress,
|
||||
EfiBootServicesData,
|
||||
RealPages,
|
||||
RealPages,
|
||||
&Memory
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -80,16 +80,16 @@ CoreInitializeDebugImageInfoTable (
|
||||
// as close to the top of memory as feasible.
|
||||
//
|
||||
Status = CoreAllocatePages (
|
||||
AllocateAnyPages,
|
||||
AllocateAnyPages,
|
||||
EfiBootServicesData,
|
||||
RealPages,
|
||||
RealPages,
|
||||
&Memory
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Free overallocated pages
|
||||
@@ -121,13 +121,13 @@ CoreInitializeDebugImageInfoTable (
|
||||
|
||||
//
|
||||
// Initialize EFI_SYSTEM_TABLE_POINTER structure
|
||||
//
|
||||
//
|
||||
mDebugTable->Signature = EFI_SYSTEM_TABLE_SIGNATURE;
|
||||
mDebugTable->EfiSystemTableBase = (EFI_PHYSICAL_ADDRESS) (UINTN) gDxeCoreST;
|
||||
mDebugTable->Crc32 = 0;
|
||||
|
||||
|
||||
//
|
||||
// Install the EFI_SYSTEM_TABLE_POINTER structure in the EFI System
|
||||
// Install the EFI_SYSTEM_TABLE_POINTER structure in the EFI System
|
||||
// Configuration Table
|
||||
//
|
||||
Status = CoreInstallConfigurationTable (&gEfiDebugImageInfoTableGuid, &mDebugInfoTableHeader);
|
||||
@@ -182,7 +182,7 @@ CoreNewDebugImageInfoEntry (
|
||||
mDebugInfoTableHeader.UpdateStatus |= EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS;
|
||||
|
||||
Table = mDebugInfoTableHeader.EfiDebugImageInfoTable;
|
||||
|
||||
|
||||
if (mDebugInfoTableHeader.TableSize < mMaxTableEntries) {
|
||||
//
|
||||
// We still have empty entires in the Table, find the first empty entry.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
UEFI MemoryAttributesTable support
|
||||
|
||||
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2016 - 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
|
||||
@@ -201,7 +201,7 @@ InstallMemoryAttributesTable (
|
||||
if (mMemoryAttributesTable != NULL) {
|
||||
FreePool (mMemoryAttributesTable);
|
||||
}
|
||||
mMemoryAttributesTable = MemoryAttributesTable;
|
||||
mMemoryAttributesTable = MemoryAttributesTable;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,7 +237,7 @@ InstallMemoryAttributesTableOnReadyToBoot (
|
||||
)
|
||||
{
|
||||
InstallMemoryAttributesTable ();
|
||||
mMemoryAttributesTableReadyToBoot = TRUE;
|
||||
mMemoryAttributesTableReadyToBoot = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
UEFI Miscellaneous boot Services Stall service implementation
|
||||
|
||||
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,8 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include "DxeMain.h"
|
||||
|
||||
/**
|
||||
Internal worker function to call the Metronome Architectural Protocol for
|
||||
the number of ticks specified by the UINT64 Counter value. WaitForTick()
|
||||
Internal worker function to call the Metronome Architectural Protocol for
|
||||
the number of ticks specified by the UINT64 Counter value. WaitForTick()
|
||||
service of the Metronome Architectural Protocol uses a UINT32 for the number
|
||||
of ticks to wait, so this function loops when Counter is larger than 0xffffffff.
|
||||
|
||||
@@ -69,7 +69,7 @@ CoreStall (
|
||||
//
|
||||
if ((UINT64) Microseconds > 0x1999999999999999ULL) {
|
||||
//
|
||||
// Microseconds is too large to multiple by 10 first. Perform the divide
|
||||
// Microseconds is too large to multiple by 10 first. Perform the divide
|
||||
// operation first and loop 10 times to avoid 64-bit math overflow.
|
||||
//
|
||||
Counter = DivU64x32Remainder (
|
||||
@@ -79,11 +79,11 @@ CoreStall (
|
||||
);
|
||||
for (Index = 0; Index < 10; Index++) {
|
||||
CoreInternalWaitForTick (Counter);
|
||||
}
|
||||
}
|
||||
|
||||
if (Remainder != 0) {
|
||||
//
|
||||
// If Remainder was not zero, then normally, Counter would be rounded
|
||||
// If Remainder was not zero, then normally, Counter would be rounded
|
||||
// up by 1 tick. In this case, since a loop for 10 counts was used
|
||||
// to emulate the multiply by 10 operation, Counter needs to be rounded
|
||||
// up by 10 counts.
|
||||
|
@@ -27,7 +27,7 @@
|
||||
3) A support protocol is not found, and the data is not available to be read
|
||||
without it. This results in EFI_PROTOCOL_ERROR.
|
||||
|
||||
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
|
||||
@@ -67,7 +67,7 @@ typedef struct {
|
||||
UINTN EncapsulatedStreamHandle;
|
||||
EFI_GUID *EncapsulationGuid;
|
||||
//
|
||||
// If the section REQUIRES an extraction protocol, register for RPN
|
||||
// If the section REQUIRES an extraction protocol, register for RPN
|
||||
// when the required GUIDed extraction protocol becomes available.
|
||||
//
|
||||
EFI_EVENT Event;
|
||||
@@ -499,7 +499,7 @@ ChildIsType (
|
||||
|
||||
@return TRUE The GuidedSectionGuid could be identified, and the pointer to
|
||||
the Guided Section Extraction Protocol 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 Protocol has not been installed yet.
|
||||
|
||||
**/
|
||||
@@ -561,9 +561,9 @@ NotifyGuidedExtraction (
|
||||
UINTN NewStreamBufferSize;
|
||||
UINT32 AuthenticationStatus;
|
||||
RPN_EVENT_CONTEXT *Context;
|
||||
|
||||
|
||||
Context = RpnContext;
|
||||
|
||||
|
||||
GuidedHeader = (EFI_GUID_DEFINED_SECTION *) (Context->ParentStream->StreamBuffer + Context->ChildNode->OffsetInStream);
|
||||
ASSERT (GuidedHeader->CommonHeader.Type == EFI_SECTION_GUID_DEFINED);
|
||||
|
||||
@@ -612,7 +612,7 @@ NotifyGuidedExtraction (
|
||||
gBS->CloseEvent (Event);
|
||||
Context->ChildNode->Event = NULL;
|
||||
FreePool (Context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Constructor for RPN event when a missing GUIDED_SECTION_EXTRACTION_PROTOCOL appears...
|
||||
@@ -628,16 +628,16 @@ CreateGuidedExtractionRpnEvent (
|
||||
)
|
||||
{
|
||||
RPN_EVENT_CONTEXT *Context;
|
||||
|
||||
|
||||
//
|
||||
// Allocate new event structure and context
|
||||
//
|
||||
Context = AllocatePool (sizeof (RPN_EVENT_CONTEXT));
|
||||
ASSERT (Context != NULL);
|
||||
|
||||
|
||||
Context->ChildNode = ChildNode;
|
||||
Context->ParentStream = ParentStream;
|
||||
|
||||
|
||||
Context->ChildNode->Event = EfiCreateProtocolNotifyEvent (
|
||||
Context->ChildNode->EncapsulationGuid,
|
||||
TPL_NOTIFY,
|
||||
@@ -893,8 +893,8 @@ CreateChildNode (
|
||||
//
|
||||
if ((GuidedSectionAttributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
|
||||
//
|
||||
// If the section REQUIRES an extraction protocol, register for RPN
|
||||
// when the required GUIDed extraction protocol becomes available.
|
||||
// If the section REQUIRES an extraction protocol, register for RPN
|
||||
// when the required GUIDed extraction protocol becomes available.
|
||||
//
|
||||
CreateGuidedExtractionRpnEvent (Stream, Node);
|
||||
} else {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
ARM specifc functionality for DxeLoad.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
ARM specifc functionality for DxeLoad.
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -65,7 +65,7 @@ HandOffToDxeCore (
|
||||
|
||||
//
|
||||
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.
|
||||
//
|
||||
//
|
||||
UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);
|
||||
|
||||
SwitchStack (
|
||||
|
@@ -5,13 +5,13 @@
|
||||
// PPI to discover and dispatch the DXE Foundation and components that are
|
||||
// needed to run the DXE Foundation.
|
||||
//
|
||||
// Copyright (c) 2006 - 2014, 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
|
||||
// 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.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// DxeIpl 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
|
||||
@@ -13,8 +13,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"Core DXE Services Initial Program Loader"
|
||||
|
||||
|
||||
|
@@ -67,7 +67,7 @@ CONST EFI_PEI_NOTIFY_DESCRIPTOR mMemoryDiscoveredNotifyList = {
|
||||
@param PeiServices Describes the list of possible PEI Services.
|
||||
|
||||
@retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfully.
|
||||
@retval Others Some error occurs during the execution of this function.
|
||||
@retval Others Some error occurs during the execution of this function.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -87,8 +87,8 @@ PeimInitializeDxeIpl (
|
||||
Status = PeiServicesRegisterForShadow (FileHandle);
|
||||
if (Status == EFI_SUCCESS) {
|
||||
//
|
||||
// EFI_SUCESS means it is the first time to call register for shadow.
|
||||
//
|
||||
// EFI_SUCESS means it is the first time to call register for shadow.
|
||||
//
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ PeimInitializeDxeIpl (
|
||||
// and section extraction.
|
||||
//
|
||||
Status = InstallIplPermanentMemoryPpis (NULL, NULL, NULL);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
} else {
|
||||
//
|
||||
// Install memory discovered PPI notification to install PPIs for
|
||||
@@ -160,7 +160,7 @@ InstallIplPermanentMemoryPpis (
|
||||
EFI_PEI_PPI_DESCRIPTOR *GuidPpi;
|
||||
|
||||
//
|
||||
// Get custom extract guided section method guid list
|
||||
// Get custom extract guided section method guid list
|
||||
//
|
||||
ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);
|
||||
|
||||
@@ -189,7 +189,7 @@ InstallIplPermanentMemoryPpis (
|
||||
}
|
||||
|
||||
/**
|
||||
Validate variable data for the MemoryTypeInformation.
|
||||
Validate variable data for the MemoryTypeInformation.
|
||||
|
||||
@param MemoryData Variable data.
|
||||
@param MemoryDataSize Variable data length.
|
||||
@@ -236,16 +236,16 @@ ValidateMemoryTypeInfoVariable (
|
||||
}
|
||||
|
||||
/**
|
||||
Main entry point to last PEIM.
|
||||
Main entry point to last PEIM.
|
||||
|
||||
This function finds DXE Core in the firmware volume and transfer the control to
|
||||
DXE core.
|
||||
|
||||
|
||||
@param This Entry point for DXE IPL PPI.
|
||||
@param PeiServices General purpose services available to every PEIM.
|
||||
@param HobList Address to the Pei HOB list.
|
||||
|
||||
@return EFI_SUCCESS DXE core was successfully loaded.
|
||||
|
||||
@return EFI_SUCCESS DXE core was successfully loaded.
|
||||
@return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.
|
||||
|
||||
**/
|
||||
@@ -295,7 +295,7 @@ DxeLoadCore (
|
||||
);
|
||||
}
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
Status = S3Resume->S3RestoreConfig2 (S3Resume);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
} else if (BootMode == BOOT_IN_RECOVERY_MODE) {
|
||||
@@ -310,7 +310,7 @@ DxeLoadCore (
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "Locate Recovery PPI Failed.(Status = %r)\n", Status));
|
||||
//
|
||||
// Report Status code the failure of locating Recovery PPI
|
||||
// Report Status code the failure of locating Recovery PPI
|
||||
//
|
||||
REPORT_STATUS_CODE (
|
||||
EFI_ERROR_CODE | EFI_ERROR_MAJOR,
|
||||
@@ -350,8 +350,8 @@ DxeLoadCore (
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
DataSize = sizeof (MemoryData);
|
||||
Status = Variable->GetVariable (
|
||||
Variable,
|
||||
Status = Variable->GetVariable (
|
||||
Variable,
|
||||
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
|
||||
&gEfiMemoryTypeInformationGuid,
|
||||
NULL,
|
||||
@@ -441,7 +441,7 @@ DxeLoadCore (
|
||||
instance that contains DxeCore.
|
||||
|
||||
@return FileHandle of DxeCore to load DxeCore.
|
||||
|
||||
|
||||
**/
|
||||
EFI_PEI_FILE_HANDLE
|
||||
DxeIplFindDxeCore (
|
||||
@@ -452,7 +452,7 @@ DxeIplFindDxeCore (
|
||||
UINTN Instance;
|
||||
EFI_PEI_FV_HANDLE VolumeHandle;
|
||||
EFI_PEI_FILE_HANDLE FileHandle;
|
||||
|
||||
|
||||
Instance = 0;
|
||||
while (TRUE) {
|
||||
//
|
||||
@@ -467,7 +467,7 @@ DxeIplFindDxeCore (
|
||||
REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_EC_DXE_CORRUPT));
|
||||
}
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
//
|
||||
// Find the DxeCore file type from the beginning in this firmware volume.
|
||||
//
|
||||
@@ -520,7 +520,7 @@ DxeIplFindDxeCore (
|
||||
output buffer. If the input
|
||||
section's GuidedSectionHeader.
|
||||
Attributes field has the
|
||||
EFI_GUIDED_SECTION_AUTH_STATUS_VALID
|
||||
EFI_GUIDED_SECTION_AUTH_STATUS_VALID
|
||||
bit as clear,
|
||||
AuthenticationStatus must return
|
||||
zero. These bits reflect the
|
||||
@@ -530,14 +530,14 @@ DxeIplFindDxeCore (
|
||||
EFI_SUCCESS, the value of
|
||||
AuthenticationStatus is
|
||||
undefined.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The InputSection was
|
||||
successfully processed and the
|
||||
section contents were returned.
|
||||
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES The system has insufficient
|
||||
resources to process the request.
|
||||
|
||||
|
||||
@retval EFI_INVALID_PARAMETER The GUID in InputSection does
|
||||
not match this instance of the
|
||||
GUIDed Section Extraction PPI.
|
||||
@@ -558,7 +558,7 @@ CustomGuidedSectionExtract (
|
||||
UINT32 ScratchBufferSize;
|
||||
UINT32 OutputBufferSize;
|
||||
UINT16 SectionAttribute;
|
||||
|
||||
|
||||
//
|
||||
// Init local variable
|
||||
//
|
||||
@@ -573,12 +573,12 @@ CustomGuidedSectionExtract (
|
||||
&ScratchBufferSize,
|
||||
&SectionAttribute
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "GetInfo from guided section Failed - %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
if (ScratchBufferSize != 0) {
|
||||
//
|
||||
// Allocate scratch buffer
|
||||
@@ -589,7 +589,7 @@ CustomGuidedSectionExtract (
|
||||
}
|
||||
}
|
||||
|
||||
if (((SectionAttribute & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) && OutputBufferSize > 0) {
|
||||
if (((SectionAttribute & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) && OutputBufferSize > 0) {
|
||||
//
|
||||
// Allocate output buffer
|
||||
//
|
||||
@@ -599,9 +599,9 @@ CustomGuidedSectionExtract (
|
||||
}
|
||||
DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
|
||||
}
|
||||
|
||||
|
||||
Status = ExtractGuidedSectionDecode (
|
||||
InputSection,
|
||||
InputSection,
|
||||
OutputBuffer,
|
||||
ScratchBuffer,
|
||||
AuthenticationStatus
|
||||
@@ -613,9 +613,9 @@ CustomGuidedSectionExtract (
|
||||
DEBUG ((DEBUG_ERROR, "Extract guided section Failed - %r\n", Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
*OutputSize = (UINTN) OutputBufferSize;
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -627,7 +627,7 @@ CustomGuidedSectionExtract (
|
||||
This function looks up the compression type field in the input section and
|
||||
applies the appropriate compression algorithm to compress the section to a
|
||||
callee allocated buffer.
|
||||
|
||||
|
||||
@param This Points to this instance of the
|
||||
EFI_PEI_DECOMPRESS_PEI PPI.
|
||||
@param CompressionSection Points to the compressed section.
|
||||
@@ -635,14 +635,14 @@ CustomGuidedSectionExtract (
|
||||
sections.
|
||||
@param OutputSize Holds the returned size of the decompress
|
||||
section streams.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The section was decompressed successfully.
|
||||
OutputBuffer contains the resulting data and
|
||||
OutputSize contains the resulting size.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EFIAPI
|
||||
Decompress (
|
||||
IN CONST EFI_PEI_DECOMPRESS_PPI *This,
|
||||
IN CONST EFI_COMPRESSION_SECTION *CompressionSection,
|
||||
@@ -676,7 +676,7 @@ Decompress (
|
||||
UncompressedLength = CompressionSection->UncompressedLength;
|
||||
CompressionType = CompressionSection->CompressionType;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// This is a compression set, expand it
|
||||
//
|
||||
@@ -791,8 +791,8 @@ UpdateStackHob (
|
||||
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw)) != NULL) {
|
||||
if (CompareGuid (&gEfiHobMemoryAllocStackGuid, &(Hob.MemoryAllocationStack->AllocDescriptor.Name))) {
|
||||
//
|
||||
// Build a new memory allocation HOB with old stack info with EfiBootServicesData type. Need to
|
||||
// avoid this region be reclaimed by DXE core as the IDT built in SEC might be on stack, and some
|
||||
// Build a new memory allocation HOB with old stack info with EfiBootServicesData type. Need to
|
||||
// avoid this region be reclaimed by DXE core as the IDT built in SEC might be on stack, and some
|
||||
// PEIMs may also keep key information on stack
|
||||
//
|
||||
BuildMemoryAllocationHob (
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
EBC-specific functionality for DxeLoad.
|
||||
|
||||
Copyright (c) 2006 - 2008, 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
|
||||
@@ -58,7 +58,7 @@ HandOffToDxeCore (
|
||||
|
||||
//
|
||||
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.
|
||||
//
|
||||
//
|
||||
UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);
|
||||
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Ia32-specific functionality for DxeLoad.
|
||||
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -73,7 +73,7 @@ Create4GPageTablesIa32Pae (
|
||||
IN EFI_PHYSICAL_ADDRESS StackBase,
|
||||
IN UINTN StackSize
|
||||
)
|
||||
{
|
||||
{
|
||||
UINT8 PhysicalAddressBits;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalAddress;
|
||||
UINTN IndexOfPdpEntries;
|
||||
@@ -112,7 +112,7 @@ Create4GPageTablesIa32Pae (
|
||||
//
|
||||
// Each Directory Pointer entries points to a page of Page Directory entires.
|
||||
// So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
|
||||
//
|
||||
//
|
||||
PageDirectoryEntry = (VOID *) PageAddress;
|
||||
PageAddress += SIZE_4KB;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
x64-specifc functionality for DxeLoad.
|
||||
|
||||
Copyright (c) 2006 - 2015, 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
|
||||
@@ -97,7 +97,7 @@ HandOffToDxeCore (
|
||||
ASSERT (PcdGetBool (PcdSetNxForStack) == FALSE);
|
||||
ASSERT (PcdGetBool (PcdCpuStackGuard) == FALSE);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// End of PEI phase signal
|
||||
//
|
||||
@@ -110,7 +110,7 @@ HandOffToDxeCore (
|
||||
|
||||
//
|
||||
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.
|
||||
//
|
||||
//
|
||||
UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, STACK_SIZE);
|
||||
|
||||
//
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/** @file
|
||||
x64 Virtual Memory Management Services in the form of an IA-32 driver.
|
||||
x64 Virtual Memory Management Services in the form of an IA-32 driver.
|
||||
Used to establish a 1:1 Virtual to Physical Mapping that is required to
|
||||
enter Long Mode (x64 64-bit mode).
|
||||
|
||||
While we make a 1:1 mapping (identity mapping) for all physical pages
|
||||
While we make a 1:1 mapping (identity mapping) for all physical pages
|
||||
we still need to use the MTRR's to ensure that the cachability attributes
|
||||
for all memory regions is correct.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
2) IA-32 Intel(R) Architecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
|
||||
3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
|
||||
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -26,7 +26,7 @@ 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 "DxeIpl.h"
|
||||
#include "VirtualMemory.h"
|
||||
@@ -574,7 +574,7 @@ CreateIdentityMappingPageTables (
|
||||
IN EFI_PHYSICAL_ADDRESS StackBase,
|
||||
IN UINTN StackSize
|
||||
)
|
||||
{
|
||||
{
|
||||
UINT32 RegEax;
|
||||
UINT32 RegEdx;
|
||||
UINT8 PhysicalAddressBits;
|
||||
@@ -647,7 +647,7 @@ CreateIdentityMappingPageTables (
|
||||
}
|
||||
|
||||
//
|
||||
// Pre-allocate big pages to avoid later allocations.
|
||||
// Pre-allocate big pages to avoid later allocations.
|
||||
//
|
||||
if (!Page1GSupport) {
|
||||
TotalPagesNum = (NumberOfPdpEntriesNeeded + 1) * NumberOfPml4EntriesNeeded + 1;
|
||||
@@ -682,7 +682,7 @@ CreateIdentityMappingPageTables (
|
||||
|
||||
if (Page1GSupport) {
|
||||
PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry;
|
||||
|
||||
|
||||
for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) {
|
||||
if (ToSplitPageTable (PageAddress, SIZE_1GB, StackBase, StackSize)) {
|
||||
Split1GPageTo2M (PageAddress, (UINT64 *) PageDirectory1GEntry, StackBase, StackSize);
|
||||
@@ -701,7 +701,7 @@ CreateIdentityMappingPageTables (
|
||||
//
|
||||
// Each Directory Pointer entries points to a page of Page Directory entires.
|
||||
// So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
|
||||
//
|
||||
//
|
||||
PageDirectoryEntry = (VOID *) BigPageAddress;
|
||||
BigPageAddress += SIZE_4KB;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/** @file
|
||||
x64 Long Mode Virtual Memory Management Definitions
|
||||
x64 Long Mode Virtual Memory Management Definitions
|
||||
|
||||
References:
|
||||
1) IA-32 Intel(R) Architecture Software Developer's Manual Volume 1:Basic Architecture, Intel
|
||||
@@ -7,7 +7,7 @@
|
||||
3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
|
||||
4) AMD64 Architecture Programmer's Manual Volume 2: System Programming
|
||||
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -18,7 +18,7 @@ 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.
|
||||
|
||||
**/
|
||||
**/
|
||||
#ifndef _VIRTUAL_MEMORY_H_
|
||||
#define _VIRTUAL_MEMORY_H_
|
||||
|
||||
@@ -110,7 +110,7 @@ typedef union {
|
||||
UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
|
||||
UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
|
||||
UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page
|
||||
UINT64 MustBe1:1; // Must be 1
|
||||
UINT64 MustBe1:1; // Must be 1
|
||||
UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
|
||||
UINT64 Available:3; // Available for use by system software
|
||||
UINT64 PAT:1; //
|
||||
@@ -134,7 +134,7 @@ typedef union {
|
||||
UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
|
||||
UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
|
||||
UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page
|
||||
UINT64 MustBe1:1; // Must be 1
|
||||
UINT64 MustBe1:1; // Must be 1
|
||||
UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
|
||||
UINT64 Available:3; // Available for use by system software
|
||||
UINT64 PAT:1; //
|
||||
@@ -223,9 +223,9 @@ CreateIdentityMappingPageTables (
|
||||
|
||||
|
||||
/**
|
||||
|
||||
|
||||
Fix up the vector number in the vector code.
|
||||
|
||||
|
||||
@param VectorBase Base address of the vector handler.
|
||||
@param VectorNum Index of vector.
|
||||
|
||||
@@ -239,11 +239,11 @@ AsmVectorFixup (
|
||||
|
||||
|
||||
/**
|
||||
|
||||
|
||||
Get the information of vector template.
|
||||
|
||||
|
||||
@param TemplateBase Base address of the template code.
|
||||
|
||||
|
||||
@return Size of the Template code.
|
||||
|
||||
**/
|
||||
@@ -313,4 +313,4 @@ AllocatePageTableMemory (
|
||||
IN UINTN Pages
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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.
|
||||
|
||||
**/
|
||||
|
||||
|
@@ -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
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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.
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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"
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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]
|
||||
|
@@ -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.
|
||||
//
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
//
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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) 2009 - 2010, 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -194,10 +194,10 @@ SmmIsSchedulable (
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_DISPATCH, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry->FileName));
|
||||
|
||||
|
||||
if (DriverEntry->Depex == NULL) {
|
||||
//
|
||||
// A NULL Depex means that the SMM driver is not built correctly.
|
||||
// A NULL Depex means that the SMM driver is not built correctly.
|
||||
// All SMM drivers must have a valid depex expressiion.
|
||||
//
|
||||
DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Depex is empty)\n"));
|
||||
|
@@ -28,14 +28,14 @@
|
||||
Depex - Dependency Expresion.
|
||||
|
||||
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
|
||||
Copyright (c) 2009 - 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -127,18 +127,18 @@ EFI_SECURITY2_ARCH_PROTOCOL *mSecurity2 = NULL;
|
||||
//
|
||||
// The global variable is defined for Loading modules at fixed address feature to track the SMM code
|
||||
// memory range usage. It is a bit mapped array in which every bit indicates the corresponding
|
||||
// memory page available or not.
|
||||
// memory page available or not.
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED UINT64 *mSmmCodeMemoryRangeUsageBitMap=NULL;
|
||||
|
||||
/**
|
||||
To check memory usage bit map array to figure out if the memory range in which the image will be loaded 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 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
|
||||
**/
|
||||
@@ -149,7 +149,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
)
|
||||
{
|
||||
UINT32 SmmCodePageNumber;
|
||||
UINT64 SmmCodeSize;
|
||||
UINT64 SmmCodeSize;
|
||||
EFI_PHYSICAL_ADDRESS SmmCodeBase;
|
||||
UINTN BaseOffsetPageNumber;
|
||||
UINTN TopOffsetPageNumber;
|
||||
@@ -160,11 +160,11 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
SmmCodePageNumber = PcdGet32(PcdLoadFixAddressSmmCodePageNumber);
|
||||
SmmCodeSize = EFI_PAGES_TO_SIZE (SmmCodePageNumber);
|
||||
SmmCodeBase = gLoadModuleAtFixAddressSmramBase;
|
||||
|
||||
|
||||
//
|
||||
// If the memory usage bit map is not initialized, do it. Every bit in the array
|
||||
// If the memory usage bit map is not initialized, do it. Every bit in the array
|
||||
// indicate the status of the corresponding memory page, available or not
|
||||
//
|
||||
//
|
||||
if (mSmmCodeMemoryRangeUsageBitMap == NULL) {
|
||||
mSmmCodeMemoryRangeUsageBitMap = AllocateZeroPool(((SmmCodePageNumber / 64) + 1)*sizeof(UINT64));
|
||||
}
|
||||
@@ -178,11 +178,11 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
// see if the memory range for loading the image is in the SMM code range.
|
||||
//
|
||||
if (SmmCodeBase + SmmCodeSize < ImageBase + ImageSize || SmmCodeBase > ImageBase) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
//
|
||||
// Test if the memory is avalaible or not.
|
||||
//
|
||||
//
|
||||
BaseOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase - SmmCodeBase));
|
||||
TopOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase + ImageSize - SmmCodeBase));
|
||||
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index ++) {
|
||||
@@ -190,22 +190,22 @@ 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 ++) {
|
||||
mSmmCodeMemoryRangeUsageBitMap[Index / 64] |= LShiftU64(1, (Index % 64));
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
/**
|
||||
Get the fixed loading address from image header assigned by build tool. This function only be called
|
||||
when Loading module at Fixed address feature enabled.
|
||||
|
||||
|
||||
@param ImageContext Pointer to the image context structure that describes the PE/COFF
|
||||
image that needs to be examined by this function.
|
||||
@retval EFI_SUCCESS An fixed loading address is assigned to this image by build tools .
|
||||
@@ -398,7 +398,7 @@ SmmLoadImage (
|
||||
&AuthenticationStatus
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (Buffer != NULL) {
|
||||
gBS->FreePool (Buffer);
|
||||
@@ -422,7 +422,7 @@ SmmLoadImage (
|
||||
//
|
||||
// Verify the Authentication Status through the Security Architectural Protocol
|
||||
// Only on images that have been read using Firmware Volume protocol.
|
||||
// All SMM images are from FV protocol.
|
||||
// All SMM images are from FV protocol.
|
||||
//
|
||||
if (!EFI_ERROR (SecurityStatus) && (mSecurity != NULL)) {
|
||||
SecurityStatus = mSecurity->FileAuthenticationState (
|
||||
@@ -436,7 +436,7 @@ SmmLoadImage (
|
||||
Status = SecurityStatus;
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Initialize ImageContext
|
||||
//
|
||||
@@ -468,7 +468,7 @@ SmmLoadImage (
|
||||
// following statements is to bypass SmmFreePages
|
||||
//
|
||||
PageCount = 0;
|
||||
DstBuffer = (UINTN)gLoadModuleAtFixAddressSmramBase;
|
||||
DstBuffer = (UINTN)gLoadModuleAtFixAddressSmramBase;
|
||||
} else {
|
||||
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Failed to load module at fixed address. \n"));
|
||||
//
|
||||
@@ -476,7 +476,7 @@ SmmLoadImage (
|
||||
//
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
DstBuffer = (UINTN)(-1);
|
||||
|
||||
|
||||
Status = SmmAllocatePages (
|
||||
AllocateMaxAddress,
|
||||
EfiRuntimeServicesCode,
|
||||
@@ -486,15 +486,15 @@ SmmLoadImage (
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (Buffer != NULL) {
|
||||
gBS->FreePool (Buffer);
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)DstBuffer;
|
||||
}
|
||||
} else {
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
DstBuffer = (UINTN)(-1);
|
||||
|
||||
|
||||
Status = SmmAllocatePages (
|
||||
AllocateMaxAddress,
|
||||
EfiRuntimeServicesCode,
|
||||
@@ -507,7 +507,7 @@ SmmLoadImage (
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)DstBuffer;
|
||||
}
|
||||
//
|
||||
@@ -549,7 +549,7 @@ SmmLoadImage (
|
||||
// Save Image EntryPoint in DriverEntry
|
||||
//
|
||||
DriverEntry->ImageEntryPoint = ImageContext.EntryPoint;
|
||||
DriverEntry->ImageBuffer = DstBuffer;
|
||||
DriverEntry->ImageBuffer = DstBuffer;
|
||||
DriverEntry->NumberOfPage = PageCount;
|
||||
|
||||
//
|
||||
@@ -698,20 +698,20 @@ SmmLoadImage (
|
||||
//
|
||||
// Free buffer allocated by Fv->ReadSection.
|
||||
//
|
||||
// The UEFI Boot Services FreePool() function must be used because Fv->ReadSection
|
||||
// The UEFI Boot Services FreePool() function must be used because Fv->ReadSection
|
||||
// used the UEFI Boot Services AllocatePool() function
|
||||
//
|
||||
Status = gBS->FreePool(Buffer);
|
||||
if (!EFI_ERROR (Status) && EFI_ERROR (SecurityStatus)) {
|
||||
Status = SecurityStatus;
|
||||
}
|
||||
return Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Preprocess dependency expression and update DriverEntry to reflect the
|
||||
state of Before and After dependencies. If DriverEntry->Before
|
||||
or DriverEntry->After is set it will never be cleared.
|
||||
or DriverEntry->After is set it will never be cleared.
|
||||
|
||||
@param DriverEntry DriverEntry element to update .
|
||||
|
||||
@@ -810,7 +810,7 @@ SmmGetDepexSectionAndPreProccess (
|
||||
drivers to run. Drain the mScheduledQueue and load and start a PE
|
||||
image for each driver. Search the mDiscoveredList to see if any driver can
|
||||
be placed on the mScheduledQueue. If no drivers are placed on the
|
||||
mScheduledQueue exit the function.
|
||||
mScheduledQueue exit the function.
|
||||
|
||||
@retval EFI_SUCCESS All of the SMM Drivers that could be dispatched
|
||||
have been run and the SMM Entry Point has been
|
||||
@@ -945,11 +945,11 @@ SmmDispatcher (
|
||||
|
||||
if (!PreviousSmmEntryPointRegistered && gSmmCorePrivate->SmmEntryPointRegistered) {
|
||||
//
|
||||
// Return immediately if the SMM Entry Point was registered by the SMM
|
||||
// Return immediately if the SMM Entry Point was registered by the SMM
|
||||
// Driver that was just dispatched. The SMM IPL will reinvoke the SMM
|
||||
// Core Dispatcher. This is required so SMM Mode may be enabled as soon
|
||||
// as all the dependent SMM Drivers for SMM Mode have been dispatched.
|
||||
// Once the SMM Entry Point has been registered, then SMM Mode will be
|
||||
// Core Dispatcher. This is required so SMM Mode may be enabled as soon
|
||||
// as all the dependent SMM Drivers for SMM Mode have been dispatched.
|
||||
// Once the SMM Entry Point has been registered, then SMM Mode will be
|
||||
// used.
|
||||
//
|
||||
gRequestDispatch = TRUE;
|
||||
@@ -1437,14 +1437,14 @@ SmmDriverDispatchHandler (
|
||||
//
|
||||
// Free data allocated by Fv->ReadSection ()
|
||||
//
|
||||
// The UEFI Boot Services FreePool() function must be used because Fv->ReadSection
|
||||
// The UEFI Boot Services FreePool() function must be used because Fv->ReadSection
|
||||
// used the UEFI Boot Services AllocatePool() function
|
||||
//
|
||||
gBS->FreePool (AprioriFile);
|
||||
}
|
||||
|
||||
//
|
||||
// Execute the SMM Dispatcher on any newly discovered FVs and previously
|
||||
// Execute the SMM Dispatcher on any newly discovered FVs and previously
|
||||
// discovered SMM drivers that have been discovered but not dispatched.
|
||||
//
|
||||
Status = SmmDispatcher ();
|
||||
@@ -1456,7 +1456,7 @@ SmmDriverDispatchHandler (
|
||||
if (*CommBufferSize > 0) {
|
||||
if (Status == EFI_NOT_READY) {
|
||||
//
|
||||
// If a the SMM Core Entry Point was just registered, then set flag to
|
||||
// If a the SMM Core Entry Point was just registered, then set flag to
|
||||
// request the SMM Dispatcher to be restarted.
|
||||
//
|
||||
*(UINT8 *)CommBuffer = COMM_BUFFER_SMM_DISPATCH_RESTART;
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
SMM handle & protocol handling.
|
||||
|
||||
Copyright (c) 2009 - 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
System Management System Table Services SmmInstallConfigurationTable service
|
||||
|
||||
Copyright (c) 2009 - 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
Locate handle functions
|
||||
|
||||
Copyright (c) 2009 - 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
Support functions for UEFI protocol notification infrastructure.
|
||||
|
||||
Copyright (c) 2009 - 2015, 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -116,7 +116,7 @@ SmmRegisterProtocolNotify (
|
||||
}
|
||||
|
||||
if (Function == NULL) {
|
||||
//
|
||||
//
|
||||
// Get the protocol entry per Protocol
|
||||
//
|
||||
ProtEntry = SmmFindProtocolEntry ((EFI_GUID *) Protocol, FALSE);
|
||||
@@ -126,7 +126,7 @@ SmmRegisterProtocolNotify (
|
||||
Link != &ProtEntry->Notify;
|
||||
Link = Link->ForwardLink) {
|
||||
//
|
||||
// Compare the notification record
|
||||
// Compare the notification record
|
||||
//
|
||||
if (ProtNotify == (CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE))){
|
||||
//
|
||||
@@ -143,7 +143,7 @@ SmmRegisterProtocolNotify (
|
||||
// If the registration is not found
|
||||
//
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
ProtNotify = NULL;
|
||||
|
||||
|
@@ -2,13 +2,13 @@
|
||||
SMM Core Main Entry Point
|
||||
|
||||
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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -65,7 +65,7 @@ EFI_SMM_SYSTEM_TABLE2 gSmmCoreSmst = {
|
||||
|
||||
//
|
||||
// Flag to determine if the platform has performed a legacy boot.
|
||||
// If this flag is TRUE, then the runtime code and runtime data associated with the
|
||||
// If this flag is TRUE, then the runtime code and runtime data associated with the
|
||||
// SMM IPL are converted to free memory, so the SMM Core must guarantee that is
|
||||
// does not touch of the code/data associated with the SMM IPL if this flag is TRUE.
|
||||
//
|
||||
@@ -82,7 +82,7 @@ BOOLEAN mDuringS3Resume = FALSE;
|
||||
//
|
||||
SMM_CORE_SMI_HANDLERS mSmmCoreSmiHandlers[] = {
|
||||
{ SmmDriverDispatchHandler, &gEfiEventDxeDispatchGuid, NULL, TRUE },
|
||||
{ SmmReadyToLockHandler, &gEfiDxeSmmReadyToLockProtocolGuid, NULL, TRUE },
|
||||
{ SmmReadyToLockHandler, &gEfiDxeSmmReadyToLockProtocolGuid, NULL, TRUE },
|
||||
{ SmmLegacyBootHandler, &gEfiEventLegacyBootGuid, NULL, FALSE },
|
||||
{ SmmExitBootServicesHandler, &gEfiEventExitBootServicesGuid, NULL, FALSE },
|
||||
{ SmmReadyToBootHandler, &gEfiEventReadyToBootGuid, NULL, FALSE },
|
||||
@@ -132,7 +132,7 @@ SmmEfiNotAvailableYetArg5 (
|
||||
|
||||
/**
|
||||
Software SMI handler that is called when a Legacy Boot event is signalled. The SMM
|
||||
Core uses this signal to know that a Legacy Boot has been performed and that
|
||||
Core uses this signal to know that a Legacy Boot has been performed and that
|
||||
gSmmCorePrivate that is shared between the UEFI and SMM execution environments can
|
||||
not be accessed from SMM anymore since that structure is considered free memory by
|
||||
a legacy OS. Then the SMM Core also install SMM Legacy Boot protocol to notify SMM
|
||||
@@ -316,9 +316,9 @@ SmmReadyToBootHandler (
|
||||
|
||||
/**
|
||||
Software SMI handler that is called when the DxeSmmReadyToLock protocol is added
|
||||
or if gEfiEventReadyToBootGuid is signalled. This function unregisters the
|
||||
Software SMIs that are nor required after SMRAM is locked and installs the
|
||||
SMM Ready To Lock Protocol so SMM Drivers are informed that SMRAM is about
|
||||
or if gEfiEventReadyToBootGuid is signalled. This function unregisters the
|
||||
Software SMIs that are nor required after SMRAM is locked and installs the
|
||||
SMM Ready To Lock Protocol so SMM Drivers are informed that SMRAM is about
|
||||
to be locked. It also verifies the SMM CPU I/O 2 Protocol has been installed
|
||||
and NULLs gBS and gST because they can not longer be used after SMRAM is locked.
|
||||
|
||||
@@ -676,7 +676,7 @@ SmmEntryPoint (
|
||||
gSmmCorePrivate->InSmm = TRUE;
|
||||
|
||||
//
|
||||
// Check to see if this is a Synchronous SMI sent through the SMM Communication
|
||||
// Check to see if this is a Synchronous SMI sent through the SMM Communication
|
||||
// Protocol or an Asynchronous SMI
|
||||
//
|
||||
CommunicationBuffer = gSmmCorePrivate->CommunicationBuffer;
|
||||
@@ -703,9 +703,9 @@ SmmEntryPoint (
|
||||
CommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *)CommunicationBuffer;
|
||||
BufferSize -= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
||||
Status = SmiManage (
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
NULL,
|
||||
CommunicateHeader->Data,
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
NULL,
|
||||
CommunicateHeader->Data,
|
||||
&BufferSize
|
||||
);
|
||||
//
|
||||
@@ -723,7 +723,7 @@ SmmEntryPoint (
|
||||
// Process Asynchronous SMI sources
|
||||
//
|
||||
SmiManage (NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
//
|
||||
// Call platform hook after Smm Dispatch
|
||||
//
|
||||
@@ -826,7 +826,7 @@ SmmCoreInstallLoadedImage (
|
||||
/**
|
||||
The Entry Point for SMM Core
|
||||
|
||||
Install DXE Protocols and reload SMM Core into SMRAM and register SMM Core
|
||||
Install DXE Protocols and reload SMM Core into SMRAM and register SMM Core
|
||||
EntryPoint on the SMI vector.
|
||||
|
||||
Note: This function is called for both DXE invocation and SMRAM invocation.
|
||||
|
@@ -3,13 +3,13 @@
|
||||
internal structure and functions used by SmmCore module.
|
||||
|
||||
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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#include <Protocol/CpuIo2.h>
|
||||
#include <Protocol/SmmCommunication.h>
|
||||
#include <Protocol/SmmAccess2.h>
|
||||
#include <Protocol/FirmwareVolume2.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/Security.h>
|
||||
#include <Protocol/FirmwareVolume2.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/Security.h>
|
||||
#include <Protocol/Security2.h>
|
||||
#include <Protocol/SmmExitBootServices.h>
|
||||
#include <Protocol/SmmLegacyBoot.h>
|
||||
@@ -52,8 +52,8 @@
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/SmmCorePlatformHookLib.h>
|
||||
@@ -136,7 +136,7 @@ typedef struct {
|
||||
//
|
||||
PHYSICAL_ADDRESS ImageEntryPoint;
|
||||
//
|
||||
// Image Buffer in SMRAM
|
||||
// Image Buffer in SMRAM
|
||||
//
|
||||
PHYSICAL_ADDRESS ImageBuffer;
|
||||
//
|
||||
|
@@ -46,19 +46,19 @@
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
|
||||
[LibraryClasses]
|
||||
UefiDriverEntryPoint
|
||||
BaseLib
|
||||
BaseMemoryLib
|
||||
PeCoffLib
|
||||
PeCoffGetEntryPointLib
|
||||
CacheMaintenanceLib
|
||||
CacheMaintenanceLib
|
||||
DebugLib
|
||||
ReportStatusCodeLib
|
||||
DevicePathLib
|
||||
UefiLib
|
||||
UefiBootServicesTableLib
|
||||
DevicePathLib
|
||||
UefiLib
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
PcdLib
|
||||
SmmCorePlatformHookLib
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// PiSmmCore 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 SMM Services Driver"
|
||||
|
||||
|
||||
|
@@ -2,14 +2,14 @@
|
||||
The internal header file that declared a data structure that is shared
|
||||
between the SMM IPL and the SMM Core.
|
||||
|
||||
Copyright (c) 2009 - 2015, 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
///
|
||||
/// Define values for the communications buffer used when gEfiEventDxeDispatchGuid is
|
||||
/// event signaled. This event is signaled by the DXE Core each time the DXE Core
|
||||
/// event signaled. This event is signaled by the DXE Core each time the DXE Core
|
||||
/// dispatcher has completed its work. When this event is signaled, the SMM Core
|
||||
/// if notified, so the SMM Core can dispatch SMM drivers. If COMM_BUFFER_SMM_DISPATCH_ERROR
|
||||
/// is returned in the communication buffer, then an error occurred dispatching SMM
|
||||
/// Drivers. If COMM_BUFFER_SMM_DISPATCH_SUCCESS is returned, then the SMM Core
|
||||
/// dispatched all the drivers it could. If COMM_BUFFER_SMM_DISPATCH_RESTART is
|
||||
/// Drivers. If COMM_BUFFER_SMM_DISPATCH_SUCCESS is returned, then the SMM Core
|
||||
/// dispatched all the drivers it could. If COMM_BUFFER_SMM_DISPATCH_RESTART is
|
||||
/// returned, then the SMM Core just dispatched the SMM Driver that registered
|
||||
/// the SMM Entry Point enabling the use of SMM Mode. In this case, the SMM Core
|
||||
/// should be notified again to dispatch more SMM Drivers using SMM Mode.
|
||||
@@ -38,13 +38,13 @@
|
||||
#define SMM_CORE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('s', 'm', 'm', 'c')
|
||||
|
||||
///
|
||||
/// Private structure that is used to share information between the SMM IPL and
|
||||
/// Private structure that is used to share information between the SMM IPL and
|
||||
/// the SMM Core. This structure is allocated from memory of type EfiRuntimeServicesData.
|
||||
/// Since runtime memory types are converted to available memory when a legacy boot
|
||||
/// is performed, the SMM Core must not access any fields of this structure if a legacy
|
||||
/// boot is performed. As a result, the SMM IPL must create an event notification
|
||||
/// for the Legacy Boot event and notify the SMM Core that a legacy boot is being
|
||||
/// performed. The SMM Core can then use this information to filter accesses to
|
||||
/// Since runtime memory types are converted to available memory when a legacy boot
|
||||
/// is performed, the SMM Core must not access any fields of this structure if a legacy
|
||||
/// boot is performed. As a result, the SMM IPL must create an event notification
|
||||
/// for the Legacy Boot event and notify the SMM Core that a legacy boot is being
|
||||
/// performed. The SMM Core can then use this information to filter accesses to
|
||||
/// thos structure.
|
||||
///
|
||||
typedef struct {
|
||||
@@ -70,43 +70,43 @@ typedef struct {
|
||||
EFI_SMRAM_DESCRIPTOR *SmramRanges;
|
||||
|
||||
///
|
||||
/// The SMM Foundation Entry Point. The SMM Core fills in this field when the
|
||||
/// SMM Core is initialized. The SMM IPL is responsbile for registering this entry
|
||||
/// point with the SMM Configuration Protocol. The SMM Configuration Protocol may
|
||||
/// The SMM Foundation Entry Point. The SMM Core fills in this field when the
|
||||
/// SMM Core is initialized. The SMM IPL is responsbile for registering this entry
|
||||
/// point with the SMM Configuration Protocol. The SMM Configuration Protocol may
|
||||
/// not be available at the time the SMM IPL and SMM Core are started, so the SMM IPL
|
||||
/// sets up a protocol notification on the SMM Configuration Protocol and registers
|
||||
/// the SMM Foundation Entry Point as soon as the SMM Configuration Protocol is
|
||||
/// sets up a protocol notification on the SMM Configuration Protocol and registers
|
||||
/// the SMM Foundation Entry Point as soon as the SMM Configuration Protocol is
|
||||
/// available.
|
||||
///
|
||||
EFI_SMM_ENTRY_POINT SmmEntryPoint;
|
||||
|
||||
|
||||
///
|
||||
/// Boolean flag set to TRUE while an SMI is being processed by the SMM Core.
|
||||
///
|
||||
///
|
||||
BOOLEAN SmmEntryPointRegistered;
|
||||
|
||||
///
|
||||
/// Boolean flag set to TRUE while an SMI is being processed by the SMM Core.
|
||||
///
|
||||
///
|
||||
BOOLEAN InSmm;
|
||||
|
||||
///
|
||||
/// This field is set by the SMM Core then the SMM Core is initialized. This field is
|
||||
/// used by the SMM Base 2 Protocol and SMM Communication Protocol implementations in
|
||||
/// the SMM IPL.
|
||||
/// the SMM IPL.
|
||||
///
|
||||
EFI_SMM_SYSTEM_TABLE2 *Smst;
|
||||
|
||||
///
|
||||
/// This field is used by the SMM Communicatioon Protocol to pass a buffer into
|
||||
/// This field is used by the SMM Communicatioon Protocol to pass a buffer into
|
||||
/// a software SMI handler and for the software SMI handler to pass a buffer back to
|
||||
/// the caller of the SMM Communication Protocol.
|
||||
/// the caller of the SMM Communication Protocol.
|
||||
///
|
||||
VOID *CommunicationBuffer;
|
||||
|
||||
///
|
||||
/// This field is used by the SMM Communicatioon Protocol to pass the size of a buffer,
|
||||
/// in bytes, into a software SMI handler and for the software SMI handler to pass the
|
||||
/// in bytes, into a software SMI handler and for the software SMI handler to pass the
|
||||
/// size, in bytes, of a buffer back to the caller of the SMM Communication Protocol.
|
||||
///
|
||||
UINTN BufferSize;
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM
|
||||
|
||||
Copyright (c) 2009 - 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -92,10 +92,10 @@ SmmBase2GetSmstLocation (
|
||||
|
||||
/**
|
||||
Communicates with a registered handler.
|
||||
|
||||
This function provides a service to send and receive messages from a registered
|
||||
UEFI service. This function is part of the SMM Communication Protocol that may
|
||||
be called in physical mode prior to SetVirtualAddressMap() and in virtual mode
|
||||
|
||||
This function provides a service to send and receive messages from a registered
|
||||
UEFI service. This function is part of the SMM Communication Protocol that may
|
||||
be called in physical mode prior to SetVirtualAddressMap() and in virtual mode
|
||||
after SetVirtualAddressMap().
|
||||
|
||||
@param[in] This The EFI_SMM_COMMUNICATION_PROTOCOL instance.
|
||||
@@ -213,7 +213,7 @@ SmmIplSetVirtualAddressNotify (
|
||||
);
|
||||
|
||||
//
|
||||
// Data structure used to declare a table of protocol notifications and event
|
||||
// Data structure used to declare a table of protocol notifications and event
|
||||
// notifications required by the SMM IPL
|
||||
//
|
||||
typedef struct {
|
||||
@@ -289,19 +289,19 @@ EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *mLMFAConfigurationTable = NULL;
|
||||
SMM_IPL_EVENT_NOTIFICATION mSmmIplEvents[] = {
|
||||
//
|
||||
// Declare protocol notification on the SMM Configuration protocol. When this notification is established,
|
||||
// the associated event is immediately signalled, so the notification function will be executed and the
|
||||
// the associated event is immediately signalled, so the notification function will be executed and the
|
||||
// SMM Configuration Protocol will be found if it is already in the handle database.
|
||||
//
|
||||
{ TRUE, FALSE, &gEfiSmmConfigurationProtocolGuid, SmmIplSmmConfigurationEventNotify, &gEfiSmmConfigurationProtocolGuid, TPL_NOTIFY, NULL },
|
||||
//
|
||||
// Declare protocol notification on DxeSmmReadyToLock protocols. When this notification is established,
|
||||
// the associated event is immediately signalled, so the notification function will be executed and the
|
||||
// Declare protocol notification on DxeSmmReadyToLock protocols. When this notification is established,
|
||||
// the associated event is immediately signalled, so the notification function will be executed and the
|
||||
// DXE SMM Ready To Lock Protocol will be found if it is already in the handle database.
|
||||
//
|
||||
{ TRUE, TRUE, &gEfiDxeSmmReadyToLockProtocolGuid, SmmIplReadyToLockEventNotify, &gEfiDxeSmmReadyToLockProtocolGuid, TPL_CALLBACK, NULL },
|
||||
//
|
||||
// Declare event notification on EndOfDxe event. When this notification is established,
|
||||
// the associated event is immediately signalled, so the notification function will be executed and the
|
||||
// the associated event is immediately signalled, so the notification function will be executed and the
|
||||
// SMM End Of Dxe Protocol will be found if it is already in the handle database.
|
||||
//
|
||||
{ FALSE, TRUE, &gEfiEndOfDxeEventGroupGuid, SmmIplGuidedEventNotify, &gEfiEndOfDxeEventGroupGuid, TPL_CALLBACK, NULL },
|
||||
@@ -321,8 +321,8 @@ SMM_IPL_EVENT_NOTIFICATION mSmmIplEvents[] = {
|
||||
//
|
||||
{ FALSE, TRUE, &gEfiEventReadyToBootGuid, SmmIplReadyToLockEventNotify, &gEfiEventReadyToBootGuid, TPL_CALLBACK, NULL },
|
||||
//
|
||||
// Declare event notification on Legacy Boot Event Group. This is used to inform the SMM Core that the platform
|
||||
// is performing a legacy boot operation, and that the UEFI environment is no longer available and the SMM Core
|
||||
// Declare event notification on Legacy Boot Event Group. This is used to inform the SMM Core that the platform
|
||||
// is performing a legacy boot operation, and that the UEFI environment is no longer available and the SMM Core
|
||||
// must guarantee that it does not access any UEFI related structures outside of SMRAM.
|
||||
// It is also to inform the SMM Core to notify SMM driver that system enter legacy boot.
|
||||
//
|
||||
@@ -338,7 +338,7 @@ SMM_IPL_EVENT_NOTIFICATION mSmmIplEvents[] = {
|
||||
//
|
||||
{ FALSE, FALSE, &gEfiEventReadyToBootGuid, SmmIplGuidedEventNotify, &gEfiEventReadyToBootGuid, TPL_CALLBACK, NULL },
|
||||
//
|
||||
// Declare event notification on SetVirtualAddressMap() Event Group. This is used to convert gSmmCorePrivate
|
||||
// Declare event notification on SetVirtualAddressMap() Event Group. This is used to convert gSmmCorePrivate
|
||||
// and mSmmControl2 from physical addresses to virtual addresses.
|
||||
//
|
||||
{ FALSE, FALSE, &gEfiEventVirtualAddressChangeGuid, SmmIplSetVirtualAddressNotify, NULL, TPL_CALLBACK, NULL },
|
||||
@@ -350,7 +350,7 @@ SMM_IPL_EVENT_NOTIFICATION mSmmIplEvents[] = {
|
||||
|
||||
/**
|
||||
Find the maximum SMRAM cache range that covers the range specified by SmramRange.
|
||||
|
||||
|
||||
This function searches and joins all adjacent ranges of SmramRange into a range to be cached.
|
||||
|
||||
@param SmramRange The SMRAM range to search from.
|
||||
@@ -388,7 +388,7 @@ GetSmramCacheRange (
|
||||
}
|
||||
}
|
||||
} while (FoundAjacentRange);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,11 +439,11 @@ SmmBase2GetSmstLocation (
|
||||
if ((This == NULL) ||(Smst == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
if (!gSmmCorePrivate->InSmm) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
*Smst = gSmmCorePrivate->Smst;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
@@ -451,10 +451,10 @@ SmmBase2GetSmstLocation (
|
||||
|
||||
/**
|
||||
Communicates with a registered handler.
|
||||
|
||||
This function provides a service to send and receive messages from a registered
|
||||
UEFI service. This function is part of the SMM Communication Protocol that may
|
||||
be called in physical mode prior to SetVirtualAddressMap() and in virtual mode
|
||||
|
||||
This function provides a service to send and receive messages from a registered
|
||||
UEFI service. This function is part of the SMM Communication Protocol that may
|
||||
be called in physical mode prior to SetVirtualAddressMap() and in virtual mode
|
||||
after SetVirtualAddressMap().
|
||||
|
||||
@param[in] This The EFI_SMM_COMMUNICATION_PROTOCOL instance.
|
||||
@@ -528,7 +528,7 @@ SmmCommunicationCommunicate (
|
||||
}
|
||||
|
||||
//
|
||||
// Return status from software SMI
|
||||
// Return status from software SMI
|
||||
//
|
||||
if (CommSize != NULL) {
|
||||
*CommSize = gSmmCorePrivate->BufferSize;
|
||||
@@ -552,7 +552,7 @@ SmmCommunicationCommunicate (
|
||||
if ((!gSmmCorePrivate->InSmm) && (!mSmmAccess->OpenState || mSmmAccess->LockState)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Save current InSmm state and set InSmm state to TRUE
|
||||
//
|
||||
@@ -564,9 +564,9 @@ SmmCommunicationCommunicate (
|
||||
//
|
||||
TempCommSize -= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
||||
Status = gSmmCorePrivate->Smst->SmiManage (
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
NULL,
|
||||
CommunicateHeader->Data,
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
NULL,
|
||||
CommunicateHeader->Data,
|
||||
&TempCommSize
|
||||
);
|
||||
TempCommSize += OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
||||
@@ -599,7 +599,7 @@ SmmIplGuidedEventNotify (
|
||||
UINTN Size;
|
||||
|
||||
//
|
||||
// Use Guid to initialize EFI_SMM_COMMUNICATE_HEADER structure
|
||||
// Use Guid to initialize EFI_SMM_COMMUNICATE_HEADER structure
|
||||
//
|
||||
CopyGuid (&mCommunicateHeader.HeaderGuid, (EFI_GUID *)Context);
|
||||
mCommunicateHeader.MessageLength = 1;
|
||||
@@ -664,26 +664,26 @@ SmmIplDxeDispatchEventNotify (
|
||||
//
|
||||
Size = sizeof (mCommunicateHeader);
|
||||
SmmCommunicationCommunicate (&mSmmCommunication, &mCommunicateHeader, &Size);
|
||||
|
||||
|
||||
//
|
||||
// Return if there is no request to restart the SMM Core Dispatcher
|
||||
//
|
||||
if (mCommunicateHeader.Data[0] != COMM_BUFFER_SMM_DISPATCH_RESTART) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Attempt to reset SMRAM cacheability to UC
|
||||
// Assume CPU AP is available at this time
|
||||
//
|
||||
Status = gDS->SetMemorySpaceAttributes(
|
||||
mSmramCacheBase,
|
||||
mSmramCacheBase,
|
||||
mSmramCacheSize,
|
||||
EFI_MEMORY_UC
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_WARN, "SMM IPL failed to reset SMRAM window to EFI_MEMORY_UC\n"));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Close all SMRAM ranges to protect SMRAM
|
||||
@@ -730,7 +730,7 @@ SmmIplSmmConfigurationEventNotify (
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Set flag to indicate that the SMM Entry Point has been registered which
|
||||
// Set flag to indicate that the SMM Entry Point has been registered which
|
||||
// means that SMIs are now fully operational.
|
||||
//
|
||||
gSmmCorePrivate->SmmEntryPointRegistered = TRUE;
|
||||
@@ -766,7 +766,7 @@ SmmIplReadyToLockEventNotify (
|
||||
if (mSmmLocked) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Make sure this notification is for this handler
|
||||
//
|
||||
@@ -777,7 +777,7 @@ SmmIplReadyToLockEventNotify (
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// If SMM is not locked yet and we got here from gEfiEventReadyToBootGuid being
|
||||
// If SMM is not locked yet and we got here from gEfiEventReadyToBootGuid being
|
||||
// signaled, then gEfiDxeSmmReadyToLockProtocolGuid was not installed as expected.
|
||||
// Print a warning on debug builds.
|
||||
//
|
||||
@@ -797,10 +797,10 @@ SmmIplReadyToLockEventNotify (
|
||||
// Lock the SMRAM (Note: Locking SMRAM may not be supported on all platforms)
|
||||
//
|
||||
mSmmAccess->Lock (mSmmAccess);
|
||||
|
||||
|
||||
//
|
||||
// Close protocol and event notification events that do not apply after the
|
||||
// DXE SMM Ready To Lock Protocol has been installed or the Ready To Boot
|
||||
// Close protocol and event notification events that do not apply after the
|
||||
// DXE SMM Ready To Lock Protocol has been installed or the Ready To Boot
|
||||
// event has been signalled.
|
||||
//
|
||||
for (Index = 0; mSmmIplEvents[Index].NotifyFunction != NULL; Index++) {
|
||||
@@ -818,7 +818,7 @@ SmmIplReadyToLockEventNotify (
|
||||
// Print debug message that the SMRAM window is now locked.
|
||||
//
|
||||
DEBUG ((DEBUG_INFO, "SMM IPL locked SMRAM window\n"));
|
||||
|
||||
|
||||
//
|
||||
// Set flag so this operation will not be performed again
|
||||
//
|
||||
@@ -874,7 +874,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
// Build tool will calculate the smm code size and then patch the PcdLoadFixAddressSmmCodePageNumber
|
||||
//
|
||||
SmmCodeSize = EFI_PAGES_TO_SIZE (PcdGet32(PcdLoadFixAddressSmmCodePageNumber));
|
||||
|
||||
|
||||
FixLoadingAddress = 0;
|
||||
Status = EFI_NOT_FOUND;
|
||||
SmramBase = mLMFAConfigurationTable->SmramBase;
|
||||
@@ -905,9 +905,9 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
|
||||
|
||||
if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_CNT_CODE) == 0) {
|
||||
//
|
||||
// Build tool saves the offset to SMRAM base as image base in PointerToRelocations & PointerToLineNumbers fields in the
|
||||
@@ -941,7 +941,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
/**
|
||||
Load the SMM Core image into SMRAM and executes the SMM Core from SMRAM.
|
||||
|
||||
@param[in, out] SmramRange Descriptor for the range of SMRAM to reload the
|
||||
@param[in, out] SmramRange Descriptor for the range of SMRAM to reload the
|
||||
currently executing image, the rang of SMRAM to
|
||||
hold SMM Core will be excluded.
|
||||
@param[in, out] SmramRangeSmmCore Descriptor for the range of SMRAM to hold SMM Core.
|
||||
@@ -967,19 +967,19 @@ ExecuteSmmCoreFromSmram (
|
||||
|
||||
//
|
||||
// Search all Firmware Volumes for a PE/COFF image in a file of type SMM_CORE
|
||||
//
|
||||
//
|
||||
Status = GetSectionFromAnyFvByFileType (
|
||||
EFI_FV_FILETYPE_SMM_CORE,
|
||||
EFI_FV_FILETYPE_SMM_CORE,
|
||||
0,
|
||||
EFI_SECTION_PE32,
|
||||
EFI_SECTION_PE32,
|
||||
0,
|
||||
&SourceBuffer,
|
||||
&SourceBuffer,
|
||||
&SourceSize
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Initilize ImageContext
|
||||
//
|
||||
@@ -994,7 +994,7 @@ ExecuteSmmCoreFromSmram (
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// if Loading module at Fixed Address feature is enabled, the SMM core driver will be loaded to
|
||||
// if Loading module at Fixed Address feature is enabled, the SMM core driver will be loaded to
|
||||
// the address assigned by build tool.
|
||||
//
|
||||
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||
@@ -1014,7 +1014,7 @@ ExecuteSmmCoreFromSmram (
|
||||
} else {
|
||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR: Loading module at fixed address at address failed\n"));
|
||||
//
|
||||
// Allocate memory for the image being loaded from the EFI_SRAM_DESCRIPTOR
|
||||
// Allocate memory for the image being loaded from the EFI_SRAM_DESCRIPTOR
|
||||
// specified by SmramRange
|
||||
//
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
@@ -1035,7 +1035,7 @@ ExecuteSmmCoreFromSmram (
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// Allocate memory for the image being loaded from the EFI_SRAM_DESCRIPTOR
|
||||
// Allocate memory for the image being loaded from the EFI_SRAM_DESCRIPTOR
|
||||
// specified by SmramRange
|
||||
//
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
@@ -1054,7 +1054,7 @@ ExecuteSmmCoreFromSmram (
|
||||
//
|
||||
ImageContext.ImageAddress = SmramRangeSmmCore->CpuStart;
|
||||
}
|
||||
|
||||
|
||||
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
||||
ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)ImageContext.SectionAlignment - 1);
|
||||
|
||||
@@ -1532,10 +1532,10 @@ GetFullSmramRanges (
|
||||
/**
|
||||
The Entry Point for SMM IPL
|
||||
|
||||
Load SMM Core into SMRAM, register SMM Core entry point for SMIs, install
|
||||
SMM Base 2 Protocol and SMM Communication Protocol, and register for the
|
||||
Load SMM Core into SMRAM, register SMM Core entry point for SMIs, install
|
||||
SMM Base 2 Protocol and SMM Communication Protocol, and register for the
|
||||
critical events required to coordinate between DXE and SMM environments.
|
||||
|
||||
|
||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@@ -1561,8 +1561,8 @@ SmmIplEntry (
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
|
||||
|
||||
//
|
||||
// Fill in the image handle of the SMM IPL so the SMM Core can use this as the
|
||||
// ParentImageHandle field of the Load Image Protocol for all SMM Drivers loaded
|
||||
// Fill in the image handle of the SMM IPL so the SMM Core can use this as the
|
||||
// ParentImageHandle field of the Load Image Protocol for all SMM Drivers loaded
|
||||
// by the SMM Core
|
||||
//
|
||||
mSmmCorePrivateData.SmmIplImageHandle = ImageHandle;
|
||||
@@ -1591,7 +1591,7 @@ SmmIplEntry (
|
||||
// Print debug message that the SMRAM window is now open.
|
||||
//
|
||||
DEBUG ((DEBUG_INFO, "SMM IPL opened SMRAM window\n"));
|
||||
|
||||
|
||||
//
|
||||
// Find the largest SMRAM range between 1MB and 4GB that is at least 256KB - 4K in size
|
||||
//
|
||||
@@ -1618,8 +1618,8 @@ SmmIplEntry (
|
||||
//
|
||||
// Print debug message showing SMRAM window that will be used by SMM IPL and SMM Core
|
||||
//
|
||||
DEBUG ((DEBUG_INFO, "SMM IPL found SMRAM window %p - %p\n",
|
||||
(VOID *)(UINTN)mCurrentSmramRange->CpuStart,
|
||||
DEBUG ((DEBUG_INFO, "SMM IPL found SMRAM window %p - %p\n",
|
||||
(VOID *)(UINTN)mCurrentSmramRange->CpuStart,
|
||||
(VOID *)(UINTN)(mCurrentSmramRange->CpuStart + mCurrentSmramRange->PhysicalSize - 1)
|
||||
));
|
||||
|
||||
@@ -1728,13 +1728,13 @@ SmmIplEntry (
|
||||
//
|
||||
if (CpuArch != NULL) {
|
||||
SetAttrStatus = gDS->SetMemorySpaceAttributes(
|
||||
mSmramCacheBase,
|
||||
mSmramCacheBase,
|
||||
mSmramCacheSize,
|
||||
EFI_MEMORY_UC
|
||||
);
|
||||
if (EFI_ERROR (SetAttrStatus)) {
|
||||
DEBUG ((DEBUG_WARN, "SMM IPL failed to reset SMRAM window to EFI_MEMORY_UC\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1745,7 +1745,7 @@ SmmIplEntry (
|
||||
}
|
||||
|
||||
//
|
||||
// If the SMM Core could not be loaded then close SMRAM window, free allocated
|
||||
// If the SMM Core could not be loaded then close SMRAM window, free allocated
|
||||
// resources, and return an error so SMM IPL will be unloaded.
|
||||
//
|
||||
if (mCurrentSmramRange == NULL || EFI_ERROR (Status)) {
|
||||
@@ -1767,7 +1767,7 @@ SmmIplEntry (
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Install SMM Base2 Protocol and SMM Communication Protocol
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## @file
|
||||
# This module provide an SMM CIS compliant implementation of SMM IPL.
|
||||
#
|
||||
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# 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
|
||||
@@ -35,13 +35,13 @@
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
|
||||
[LibraryClasses]
|
||||
UefiDriverEntryPoint
|
||||
BaseLib
|
||||
BaseMemoryLib
|
||||
PeCoffLib
|
||||
CacheMaintenanceLib
|
||||
CacheMaintenanceLib
|
||||
MemoryAllocationLib
|
||||
DebugLib
|
||||
UefiBootServicesTableLib
|
||||
@@ -51,7 +51,7 @@
|
||||
DxeServicesLib
|
||||
PcdLib
|
||||
ReportStatusCodeLib
|
||||
|
||||
|
||||
[Protocols]
|
||||
gEfiSmmBase2ProtocolGuid ## PRODUCES
|
||||
gEfiSmmCommunicationProtocolGuid ## PRODUCES
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// PiSmmIpl 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 SMM Services Initial Program Loader"
|
||||
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
SMM Memory pool management functions.
|
||||
|
||||
Copyright (c) 2009 - 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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
LIST_ENTRY mSmmPoolLists[SmmPoolTypeMax][MAX_POOL_INDEX];
|
||||
//
|
||||
// To cache the SMRAM base since when Loading modules At fixed address feature is enabled,
|
||||
// To cache the SMRAM base since when Loading modules At fixed address feature is enabled,
|
||||
// all module is assigned an offset relative the SMRAM base in build time.
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS gLoadModuleAtFixAddressSmramBase = 0;
|
||||
|
@@ -2,13 +2,13 @@
|
||||
SMI management.
|
||||
|
||||
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
|
||||
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.
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
@@ -113,7 +113,7 @@ SmiManage (
|
||||
SMI_HANDLER *SmiHandler;
|
||||
BOOLEAN SuccessReturn;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
SuccessReturn = FALSE;
|
||||
if (HandlerType == NULL) {
|
||||
@@ -171,7 +171,7 @@ SmiManage (
|
||||
case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
|
||||
//
|
||||
// If at least one of the handlers returns EFI_WARN_INTERRUPT_SOURCE_QUIESCED
|
||||
// then the function will return EFI_SUCCESS.
|
||||
// then the function will return EFI_SUCCESS.
|
||||
//
|
||||
SuccessReturn = TRUE;
|
||||
break;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Support routines for SMRAM profile.
|
||||
|
||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 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
|
||||
@@ -99,10 +99,10 @@ DumpSmramInfo (
|
||||
@param[in, out] ProfileSize On entry, points to the size in bytes of the ProfileBuffer.
|
||||
On return, points to the size of the data returned in ProfileBuffer.
|
||||
@param[out] ProfileBuffer Profile buffer.
|
||||
|
||||
|
||||
@return EFI_SUCCESS Get the memory profile data successfully.
|
||||
@return EFI_UNSUPPORTED Memory profile is unsupported.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
ProfileSize is updated with the size required.
|
||||
|
||||
**/
|
||||
@@ -594,7 +594,7 @@ NeedRecordThisDriver (
|
||||
//
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Record FilePath without end node.
|
||||
//
|
||||
@@ -1913,10 +1913,10 @@ Done:
|
||||
@param[in, out] ProfileSize On entry, points to the size in bytes of the ProfileBuffer.
|
||||
On return, points to the size of the data returned in ProfileBuffer.
|
||||
@param[out] ProfileBuffer Profile buffer.
|
||||
|
||||
|
||||
@return EFI_SUCCESS Get the memory profile data successfully.
|
||||
@return EFI_UNSUPPORTED Memory profile is unsupported.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
@return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.
|
||||
ProfileSize is updated with the size required.
|
||||
|
||||
**/
|
||||
@@ -1986,7 +1986,7 @@ SmramProfileProtocolRegisterImage (
|
||||
EFI_SMM_DRIVER_ENTRY DriverEntry;
|
||||
VOID *EntryPointInImage;
|
||||
EFI_GUID *Name;
|
||||
|
||||
|
||||
ZeroMem (&DriverEntry, sizeof (DriverEntry));
|
||||
Name = GetFileNameFromFilePath (FilePath);
|
||||
if (Name != NULL) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# CalculateCrc32 boot services table, SetVirtualAddressMap & ConvertPointer
|
||||
# runtime services table.
|
||||
#
|
||||
# Copyright (c) 2006 - 2014, 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
|
||||
@@ -38,7 +38,7 @@
|
||||
Crc32.c
|
||||
Runtime.h
|
||||
Runtime.c
|
||||
|
||||
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
@@ -57,9 +57,9 @@
|
||||
[Protocols]
|
||||
gEfiRuntimeArchProtocolGuid ## PRODUCES
|
||||
gEfiLoadedImageProtocolGuid ## CONSUMES
|
||||
|
||||
|
||||
[depex]
|
||||
TRUE
|
||||
|
||||
[UserExtensions.TianoCore."ExtraFiles"]
|
||||
RuntimeDxeExtra.uni
|
||||
RuntimeDxeExtra.uni
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// RuntimeDxe 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 Runtime Services Driver"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user