alcyone/BOOT/ENVIRON/LIB/EFI/efiinit.c

59 lines
1.1 KiB
C

/*++
Copyright (c) 2024, Quinn Stephens.
Provided under the BSD 3-Clause license.
Module Name:
efiinit.c
Abstract:
Provides EFI initialization utilities.
--*/
#include "bootmgr.h"
#include "efi.h"
UCHAR EfiInitScratch[2048];
PBOOT_APPLICATION_PARAMETERS
EfiInitCreateInputParameters (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Creates the input parameter structure for the boot application.
Arguments:
ImageHandle - Handle for the boot manager image.
SystemTable - Pointer to the EFI system table.
Return Value:
Pointer to parameter structure on success or NULL on failure.
--*/
{
ULONG ScratchUsed = 0;
PBOOT_APPLICATION_PARAMETERS InputParameters;
(VOID)ImageHandle;
(VOID)SystemTable;
InputParameters = (PBOOT_APPLICATION_PARAMETERS)(&EfiInitScratch[ScratchUsed]);
InputParameters->Signature = BOOT_APPLICATION_PARAMETERS_SIGNATURE;
InputParameters->Version = BOOT_APPLICATION_PARAMETERS_VERSION;
ScratchUsed += sizeof(BOOT_APPLICATION_PARAMETERS);
return InputParameters;
}