alcyone/BOOT/ENVIRON/APP/BOOTMGR/EFI/efientry.c

62 lines
1.1 KiB
C

/*++
Copyright (c) 2024, Quinn Stephens.
Provided under the BSD 3-Clause license.
Module Name:
entry.c
Abstract:
Boot manager entry point on EFI systems.
--*/
#include "bootmgr.h"
#include "efilib.h"
EFI_STATUS
EFIAPI
EfiEntry (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Boot manager entry point from EFI firmware.
Arguments:
ImageHandle - EFI handle for the boot manager image.
SystemTable - Pointer to the EFI system table.
Return Value:
EFI_SUCCESS if successful.
EFI_INVALID_PARAMETER if EfiInitCreateInputParameters() fails.
Any other error code if BmMain() fails.
--*/
{
PBOOT_APPLICATION_PARAMETERS InputParameters;
//
// Create firmware-independent input structure from EFI parameters.
//
InputParameters = EfiInitCreateInputParameters(ImageHandle, SystemTable);
if (InputParameters == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Transfer control to the firmware-independent boot manager code.
//
return EfiGetEfiStatusCode(BmMain(InputParameters));
}