summaryrefslogtreecommitdiffhomepage
path: root/Private/FirmwareKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-26 15:48:09 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-26 15:48:09 +0200
commit03a0fee13445aeb95f01d64409e5304b8e97b31c (patch)
tree3a7d86868f7033c1c08c1e5fabd9db4144e26afc /Private/FirmwareKit
parent313c303fab092b1c45e615f960826375e7eef093 (diff)
MHR-16: Fix NewBoot bug due to terrible code.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/FirmwareKit')
-rw-r--r--Private/FirmwareKit/EFI/API.hxx3
-rw-r--r--Private/FirmwareKit/EFI/EFI.hxx10
-rw-r--r--Private/FirmwareKit/Handover.hxx2
3 files changed, 7 insertions, 8 deletions
diff --git a/Private/FirmwareKit/EFI/API.hxx b/Private/FirmwareKit/EFI/API.hxx
index 0e2ef200..4cf8e603 100644
--- a/Private/FirmwareKit/EFI/API.hxx
+++ b/Private/FirmwareKit/EFI/API.hxx
@@ -47,8 +47,7 @@ Bascially frees everything we have in the EFI side.
inline void ExitBootServices(UInt64 MapKey, EfiHandlePtr ImageHandle) noexcept {
if (!ST) return;
- while (ST->BootServices->ExitBootServices(ImageHandle, MapKey) != kEfiOk)
- ;
+ ST->BootServices->ExitBootServices(ImageHandle, MapKey);
}
enum {
diff --git a/Private/FirmwareKit/EFI/EFI.hxx b/Private/FirmwareKit/EFI/EFI.hxx
index 7f8223cf..c967647c 100644
--- a/Private/FirmwareKit/EFI/EFI.hxx
+++ b/Private/FirmwareKit/EFI/EFI.hxx
@@ -50,6 +50,9 @@ typedef struct EfiHandle {
/* UEFI uses wide characters by default. */
typedef WideChar EfiCharType;
+typedef UInt64 EfiPhysicalAddress;
+typedef UIntPtr EfiVirtualAddress;
+
/// What's BootBolicy?
/// If TRUE, indicates that the request originates from the boot manager, and
/// that the boot manager is attempting to load FilePath as a boot selection. If
@@ -200,13 +203,13 @@ typedef struct EfiMemoryDescriptor {
/// 0xfffffffffffff000. Kind EFI_PHYSICAL_ADDRESS is defined in the
/// AllocatePages() function description
///
- UIntPtr PhysicalStart;
+ EfiPhysicalAddress PhysicalStart;
///
/// Virtual address of the first byte in the memory region.
/// VirtualStart must be aligned on a 4 KiB boundary,
/// and must not be above 0xfffffffffffff000.
///
- UIntPtr VirtualStart;
+ EfiVirtualAddress VirtualStart;
///
/// NumberOfPagesNumber of 4 KiB pages in the memory region.
/// NumberOfPages must not be 0, and must not be any value
@@ -417,9 +420,6 @@ typedef struct EfiFileDevicePathProtocol {
WideChar Path[kPathLen];
} EfiFileDevicePathProtocol;
-typedef UInt64 EfiPhysicalAddress;
-typedef UIntPtr EfiVirtualAddress;
-
typedef UInt64(EFI_API *EfiExitBootServices)(VoidPtr ImageHandle,
UInt32 MapKey);
diff --git a/Private/FirmwareKit/Handover.hxx b/Private/FirmwareKit/Handover.hxx
index 4131467d..afec440d 100644
--- a/Private/FirmwareKit/Handover.hxx
+++ b/Private/FirmwareKit/Handover.hxx
@@ -64,7 +64,6 @@ struct HandoverInformationHeader {
voidPtr f_VirtualStart;
SizeT f_VirtualSize;
voidPtr f_PhysicalStart;
- SizeT f_PhysicalSize;
WideChar f_FirmwareVendorName[32];
SizeT f_FirmwareVendorLen;
struct {
@@ -79,6 +78,7 @@ struct HandoverInformationHeader {
UInt32 f_PixelFormat;
UInt32 f_PixelPerLine;
} f_GOP;
+ UInt64 f_FirmwareSpecific[8];
};
/// @brief Bootloader main type.