boot services avoid code based on the patch by Matthew Garrett

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-03 20:06:41 +01:00
parent 86e5ab4b81
commit 9be4c45dbe
18 changed files with 136 additions and 37 deletions

View file

@ -1319,7 +1319,8 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel,
grub_phys_addr_t min_addr,
grub_phys_addr_t max_addr,
grub_size_t size, grub_size_t align,
int preference)
int preference,
int avoid_efi_boot_services)
{
grub_addr_t min_addr2 = 0, max_addr2;
struct grub_relocator_chunk *chunk;
@ -1406,7 +1407,12 @@ grub_relocator_alloc_chunk_align (struct grub_relocator *rel,
return 0;
}
grub_machine_mmap_iterate (hook);
#ifdef GRUB_MACHINE_EFI
grub_efi_mmap_iterate (hook, avoid_efi_boot_services);
#else
(void) avoid_efi_boot_services;
grub_mmap_iterate (hook);
#endif
if (!found)
return grub_error (GRUB_ERR_BAD_OS, "couldn't find suitable memory target");
}