* 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.
This commit is contained in:
Josh Triplett 2013-11-18 18:00:52 +01:00 committed by Vladimir Serbinenko
parent 2d6a38fbf7
commit d53f4900d7
2 changed files with 10 additions and 3 deletions

View file

@ -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> 2013-11-18 Vladimir Serbinenko <phcoder@gmail.com>
* tests/grub_func_test.in: Decrease RAM size to 512M. With less * tests/grub_func_test.in: Decrease RAM size to 512M. With less

View file

@ -184,8 +184,8 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
return 0; return 0;
b = grub_efi_system_table->boot_services; b = grub_efi_system_table->boot_services;
address = start & (~0x3ffULL); address = start & (~0xfffULL);
pages = (end - address + 0x3ff) >> 12; pages = (end - address + 0xfff) >> 12;
status = efi_call_2 (b->free_pages, address, pages); status = efi_call_2 (b->free_pages, address, pages);
if (status != GRUB_EFI_SUCCESS && status != GRUB_EFI_NOT_FOUND) 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; atype = GRUB_EFI_ALLOCATE_ANY_PAGES;
#endif #endif
pages = (size + 0x3ff) >> 12; pages = (size + 0xfff) >> 12;
status = efi_call_4 (b->allocate_pages, atype, status = efi_call_4 (b->allocate_pages, atype,
make_efi_memtype (type), pages, &address); make_efi_memtype (type), pages, &address);
if (status != GRUB_EFI_SUCCESS) if (status != GRUB_EFI_SUCCESS)