reactos/boot/freeldr/freeldr/arch/uefi/uefiutil.c
Justin Miller ccef43f3b0
[FREELDR] Implement the memory managment functions for UEFI (#5174)
CORE-11954

- EFI binaries have a different subsystem in the PE header;
- ENVIRON: Make sure INTN and UINTN are 64bit for 64bit platforms;
- Handle UEFI Memory maps and translate it for freeldr;
- Add FAILED_TO_EXIT_BOOTSERVICES Freeldr BSoD code.
2023-04-03 17:33:20 +02:00

39 lines
1,005 B
C

/*
* PROJECT: FreeLoader UEFI Support
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Utils source
* COPYRIGHT: Copyright 2022 Justin Miller <justinmiller100@gmail.com>
*/
#include <uefildr.h>
#include <debug.h>
DBG_DEFAULT_CHANNEL(WARNING);
/* GLOBALS ********************************************************************/
extern EFI_SYSTEM_TABLE *GlobalSystemTable;
/* FUNCTIONS ******************************************************************/
TIMEINFO*
UefiGetTime(VOID)
{
static TIMEINFO TimeInfo;
EFI_STATUS Status;
EFI_TIME time = {0};
Status = GlobalSystemTable->RuntimeServices->GetTime(&time, NULL);
if (Status != EFI_SUCCESS)
ERR("UefiGetTime: cannot get time status %d\n", Status);
TimeInfo.Year = time.Year;
TimeInfo.Month = time.Month;
TimeInfo.Day = time.Day;
TimeInfo.Hour = time.Hour;
TimeInfo.Minute = time.Minute;
TimeInfo.Second = time.Second;
return &TimeInfo;
}