dxemain.c
来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C语言 代码 · 共 955 行 · 第 1/3 页
C
955 行
EFI_STATUS
EFIAPI
CoreEfiNotAvailableYetArg2 (
UINTN Arg1,
UINTN Arg2
)
/*++
Routine Description:
Place holder function until all the Boot Services and Runtime Services are available
Arguments:
Arg1 - Undefined
Arg2 - Undefined
Returns:
EFI_NOT_AVAILABLE_YET
--*/
{
//
// This function should never be executed. If it does, then the architectural protocols
// have not been designed correctly. The EFI_BREAKPOINT() is commented out for now until the
// DXE Core and all the Architectural Protocols are complete.
//
return EFI_NOT_AVAILABLE_YET;
}
EFI_STATUS
EFIAPI
CoreEfiNotAvailableYetArg3 (
UINTN Arg1,
UINTN Arg2,
UINTN Arg3
)
/*++
Routine Description:
Place holder function until all the Boot Services and Runtime Services are available
Arguments:
Arg1 - Undefined
Arg2 - Undefined
Arg3 - Undefined
Returns:
EFI_NOT_AVAILABLE_YET
--*/
{
//
// This function should never be executed. If it does, then the architectural protocols
// have not been designed correctly. The EFI_BREAKPOINT() is commented out for now until the
// DXE Core and all the Architectural Protocols are complete.
//
return EFI_NOT_AVAILABLE_YET;
}
EFI_STATUS
EFIAPI
CoreEfiNotAvailableYetArg4 (
UINTN Arg1,
UINTN Arg2,
UINTN Arg3,
UINTN Arg4
)
/*++
Routine Description:
Place holder function until all the Boot Services and Runtime Services are available
Arguments:
Arg1 - Undefined
Arg2 - Undefined
Arg3 - Undefined
Arg4 - Undefined
Returns:
EFI_NOT_AVAILABLE_YET
--*/
{
//
// This function should never be executed. If it does, then the architectural protocols
// have not been designed correctly. The EFI_BREAKPOINT() is commented out for now until the
// DXE Core and all the Architectural Protocols are complete.
//
return EFI_NOT_AVAILABLE_YET;
}
EFI_STATUS
EFIAPI
CoreEfiNotAvailableYetArg5 (
UINTN Arg1,
UINTN Arg2,
UINTN Arg3,
UINTN Arg4,
UINTN Arg5
)
/*++
Routine Description:
Place holder function until all the Boot Services and Runtime Services are available
Arguments:
Arg1 - Undefined
Arg2 - Undefined
Arg3 - Undefined
Arg4 - Undefined
Arg5 - Undefined
Returns:
EFI_NOT_AVAILABLE_YET
--*/
{
//
// This function should never be executed. If it does, then the architectural protocols
// have not been designed correctly. The EFI_BREAKPOINT() is commented out for now until the
// DXE Core and all the Architectural Protocols are complete.
//
return EFI_NOT_AVAILABLE_YET;
}
EFI_STATUS
CoreGetPeiProtocol (
IN EFI_GUID *ProtocolGuid,
IN VOID **Interface
)
/*++
Routine Description:
Searches for a Protocol Interface passed from PEI through a HOB
Arguments:
ProtocolGuid - The Protocol GUID to search for in the HOB List
Interface - A pointer to the interface for the Protocol GUID
Returns:
EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
--*/
{
EFI_STATUS Status;
VOID *HobList;
VOID *Buffer;
HobList = mHobStart;
Status = GetNextGuidHob (&HobList, ProtocolGuid, &Buffer, NULL);
if (EFI_ERROR (Status)) {
return Status;
}
ASSERT (Buffer != NULL);
*Interface = (VOID *)(*(UINTN *)(Buffer));
return Status;
}
VOID
CalculateEfiHdrCrc (
IN OUT EFI_TABLE_HEADER *Hdr
)
/*++
Routine Description:
Calcualte the 32-bit CRC in a EFI table using the service provided by the
gRuntime service.
Arguments:
Hdr - Pointer to an EFI standard header
Returns:
None
--*/
{
UINT32 Crc;
Hdr->CRC32 = 0;
//
// If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then
// Crc will come back as zero if we set it to zero here
//
Crc = 0;
gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);
Hdr->CRC32 = Crc;
}
EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreExitBootServices (
IN EFI_HANDLE ImageHandle,
IN UINTN MapKey
)
/*++
Routine Description:
Terminates all boot services.
Arguments:
ImageHandle - Handle that identifies the exiting image.
MapKey - Key to the latest memory map.
Returns:
EFI_SUCCESS - Boot services have been terminated.
EFI_INVALID_PARAMETER - MapKey is incorrect.
--*/
{
EFI_STATUS Status;
//
// Terminate memory services if the MapKey matches
//
Status = CoreTerminateMemoryMap (MapKey);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Notify other drivers that we are exiting boot services.
//
CoreNotifySignalList (&gEfiEventExitBootServicesGuid);
//
// Disable Timer
//
gTimer->SetTimerPeriod (gTimer, 0);
//
// Disable CPU Interrupts
//
gCpu->DisableInterrupt (gCpu);
//
// Report that ExitBootServices() has been called
//
// We are using gEfiDxeServicesTableGuid as the caller ID for Dxe Core
//
CoreReportProgressCode ((EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES));
//
// Clear the non-runtime values of the EFI System Table
//
gST->BootServices = NULL;
gST->ConIn = NULL;
gST->ConsoleInHandle = NULL;
gST->ConOut = NULL;
gST->ConsoleOutHandle = NULL;
gST->StdErr = NULL;
gST->StandardErrorHandle = NULL;
//
// Recompute the 32-bit CRC of the EFI System Table
//
CalculateEfiHdrCrc (&gST->Hdr);
//
// Zero out the Boot Service Table
//
EfiCommonLibSetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0);
gBS = NULL;
//
// Update the AtRuntime field in Runtiem AP.
//
gRuntime->AtRuntime = TRUE;
return Status;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?