summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index d28a337..92e4a99 100644
--- a/main.c
+++ b/main.c
@@ -31,7 +31,10 @@ static u64 allocate_pages(efi_boot_services *b, u64 mt, u64 np, u64 *a) {
31} 31}
32static u8 *rf(efi_boot_services *b, efi_file_protocol *f, u64 *sz, u64 mx) { 32static u8 *rf(efi_boot_services *b, efi_file_protocol *f, u64 *sz, u64 mx) {
33 u64 np = (mx + 4095) / 4096, a; 33 u64 np = (mx + 4095) / 4096, a;
34 if (allocate_pages(b, 6, np, &a)) return 0; 34 /* LoaderData (2): scratch buffers for the OS loader, reclaimable by the
35 * OS once it takes control. Type 6 (RuntimeData) would mark them as
36 * runtime-services memory that must survive forever. */
37 if (allocate_pages(b, 2, np, &a)) return 0;
35 u8 *d = (u8 *)a; 38 u8 *d = (u8 *)a;
36 u64 r = mx; 39 u64 r = mx;
37 if (f->read(f, &r, d) && r != mx) return 0; 40 if (f->read(f, &r, d) && r != mx) return 0;