[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.
This commit is contained in:
Justin Miller 2023-04-03 08:33:20 -07:00 committed by GitHub
parent 83e83bfd2c
commit ccef43f3b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 346 additions and 24 deletions

View file

@ -197,6 +197,7 @@ typedef signed char CHAR8;
typedef signed char INT8;
#endif
#ifndef _WIN64
///
/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions;
/// 8 bytes on supported 64-bit processor instructions.)
@ -207,6 +208,18 @@ typedef UINT32 UINTN;
/// 8 bytes on supported 64-bit processor instructions.)
///
typedef INT32 INTN;
#else
///
/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions;
/// 8 bytes on supported 64-bit processor instructions.)
///
typedef UINT64 UINTN;
///
/// Signed value of native width. (4 bytes on supported 32-bit processor instructions;
/// 8 bytes on supported 64-bit processor instructions.)
///
typedef INT64 INTN;
#endif
//
// Processor specific defines