diff options
Diffstat (limited to 'dev/boot')
| -rw-r--r-- | dev/boot/src/HEL/AMD64/BootEFI.cc | 20 | ||||
| -rw-r--r-- | dev/boot/src/HEL/ARM64/BootEFI.cc | 9 |
2 files changed, 15 insertions, 14 deletions
diff --git a/dev/boot/src/HEL/AMD64/BootEFI.cc b/dev/boot/src/HEL/AMD64/BootEFI.cc index 166e0169..24bee2dd 100644 --- a/dev/boot/src/HEL/AMD64/BootEFI.cc +++ b/dev/boot/src/HEL/AMD64/BootEFI.cc @@ -128,28 +128,28 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa handover_hdr->f_BitMapStart = nullptr; /* Start of bitmap. */ handover_hdr->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */ - Int32 trials = 5 * 10000000; + kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */ + kHandoverHeader->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */ - writer.Write("BootZ: Welcome to BootZ.\r"); - writer.Write("BootZ: Allocating sufficient memory, trying 4GB...\r"); + UInt16 trials = 5; - while (BS->AllocatePool(EfiLoaderData, handover_hdr->f_BitMapSize, - &handover_hdr->f_BitMapStart) != kEfiOk) { + while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, + &kHandoverHeader->f_BitMapStart) != kEfiOk) { --trials; if (!trials) { writer.Write("BootZ: Unable to allocate sufficient memory, trying again with 2GB...\r"); - trials = 3 * 10000000; + trials = 3; - handover_hdr->f_BitMapSize = kHandoverBitMapSz / 2; /* Size of bitmap in bytes. */ + kHandoverHeader->f_BitMapSize = kHandoverBitMapSz / 2; /* Size of bitmap in bytes. */ - while (BS->AllocatePool(EfiLoaderData, handover_hdr->f_BitMapSize, - &handover_hdr->f_BitMapStart) != kEfiOk) { + while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, + &kHandoverHeader->f_BitMapStart) != kEfiOk) { --trials; if (!trials) { - writer.Write("BootZ: Unable to allocate sufficent memory, aborting...\r"); + writer.Write("BootZ: Unable to allocate sufficient memory, aborting...\r"); Boot::Stop(); } } diff --git a/dev/boot/src/HEL/ARM64/BootEFI.cc b/dev/boot/src/HEL/ARM64/BootEFI.cc index 44c6a778..12ace024 100644 --- a/dev/boot/src/HEL/ARM64/BootEFI.cc +++ b/dev/boot/src/HEL/ARM64/BootEFI.cc @@ -129,16 +129,17 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */ kHandoverHeader->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */ - Int32 trials = 5 * 10000000; + + UInt16 trials = 5; while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, &kHandoverHeader->f_BitMapStart) != kEfiOk) { --trials; if (!trials) { - writer.Write("BootZ: Unable to allocate sufficent memory, trying again with 2GB...\r"); + writer.Write("BootZ: Unable to allocate sufficient memory, trying again with 2GB...\r"); - trials = 3 * 10000000; + trials = 3; kHandoverHeader->f_BitMapSize = kHandoverBitMapSz / 2; /* Size of bitmap in bytes. */ @@ -147,7 +148,7 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa --trials; if (!trials) { - writer.Write("BootZ: Unable to allocate sufficent memory, aborting...\r"); + writer.Write("BootZ: Unable to allocate sufficient memory, aborting...\r"); Boot::Stop(); } } |
