]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/mmap/efi/mmap.c (grub_mmap_register): Round up/down to
authorJosh Triplett <josh@joshtriplett.org>
Mon, 18 Nov 2013 17:00:52 +0000 (18:00 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 18 Nov 2013 17:00:52 +0000 (18:00 +0100)
4k page boundaries as expected by firmware rather than 1k
boundaries.
(grub_mmap_malign_and_register): Likewise.

ChangeLog
grub-core/mmap/efi/mmap.c

index aee6116411da9f9fd5a4519abbd9e9fd65f1f130..ca8ea2e5dda2e441fb9e81d19b3d00d43cd4fcb7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-18  Josh Triplett  <josh@joshtriplett.org>
+
+       * grub-core/mmap/efi/mmap.c (grub_mmap_register): Round up/down to
+       4k page boundaries as expected by firmware rather than 1k
+       boundaries.
+       (grub_mmap_malign_and_register): Likewise.
+
 2013-11-18  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * tests/grub_func_test.in: Decrease RAM size to 512M. With less
index 4f17c8b5350d2028860229c57e1b75fb2530aee4..a77efe81d0c433c7322a2231824c77a9cf36e167 100644 (file)
@@ -184,8 +184,8 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
     return 0;
 
   b = grub_efi_system_table->boot_services;
-  address = start & (~0x3ffULL);
-  pages = (end - address  + 0x3ff) >> 12;
+  address = start & (~0xfffULL);
+  pages = (end - address + 0xfff) >> 12;
   status = efi_call_2 (b->free_pages, address, pages);
   if (status != GRUB_EFI_SUCCESS && status != GRUB_EFI_NOT_FOUND)
     {
@@ -263,7 +263,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
   atype = GRUB_EFI_ALLOCATE_ANY_PAGES;
 #endif
 
-  pages = (size + 0x3ff) >> 12;
+  pages = (size + 0xfff) >> 12;
   status = efi_call_4 (b->allocate_pages, atype,
                       make_efi_memtype (type), pages, &address);
   if (status != GRUB_EFI_SUCCESS)