EFI requests support for newreloc
This commit is contained in:
parent
dae84898b2
commit
91b58e6b74
12 changed files with 399 additions and 86 deletions
|
@ -692,8 +692,9 @@ grub_freebsd_boot (void)
|
|||
return err;
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (! grub_efi_finish_boot_services ())
|
||||
grub_fatal ("cannot exit boot services");
|
||||
err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
pagetable = p;
|
||||
|
@ -723,8 +724,9 @@ grub_freebsd_boot (void)
|
|||
return err;
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (! grub_efi_finish_boot_services ())
|
||||
grub_fatal ("cannot exit boot services");
|
||||
err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
grub_memcpy (&stack[9], &bi, sizeof (bi));
|
||||
|
@ -804,8 +806,9 @@ grub_openbsd_boot (void)
|
|||
grub_video_set_mode ("text", 0, 0);
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (! grub_efi_finish_boot_services ())
|
||||
grub_fatal ("cannot exit boot services");
|
||||
err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
state.eip = entry;
|
||||
|
@ -1009,8 +1012,9 @@ grub_netbsd_boot (void)
|
|||
return err;
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (! grub_efi_finish_boot_services ())
|
||||
grub_fatal ("cannot exit boot services");
|
||||
err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
state.eip = entry;
|
||||
|
|
|
@ -681,15 +681,13 @@ grub_linux_boot (void)
|
|||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
{
|
||||
grub_efi_uintn_t efi_map_key, efi_desc_size;
|
||||
grub_efi_uintn_t efi_desc_size;
|
||||
grub_efi_uint32_t efi_desc_version;
|
||||
if (grub_efi_get_memory_map (&efi_mmap_size, efi_mmap_buf, &efi_map_key,
|
||||
&efi_desc_size, &efi_desc_version) <= 0)
|
||||
grub_fatal ("cannot get memory map");
|
||||
err = grub_efi_finish_boot_services (&efi_mmap_size, efi_mmap_buf, NULL,
|
||||
&efi_desc_size, &efi_desc_version);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (! grub_efi_exit_boot_services (efi_map_key))
|
||||
grub_fatal ("cannot exit boot services");
|
||||
|
||||
/* Note that no boot services are available from here. */
|
||||
|
||||
/* Pass EFI parameters. */
|
||||
|
|
|
@ -1038,10 +1038,11 @@ grub_xnu_boot (void)
|
|||
bootparams->devtree = devtree_target;
|
||||
bootparams->devtreelen = devtreelen;
|
||||
|
||||
if (grub_autoefi_get_memory_map (&memory_map_size, memory_map,
|
||||
&map_key, &descriptor_size,
|
||||
&descriptor_version) <= 0)
|
||||
return grub_errno;
|
||||
err = grub_efi_finish_boot_services (&memory_map_size, memory_map,
|
||||
&map_key, &descriptor_size,
|
||||
&descriptor_version);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
bootparams->efi_system_table = PTR_TO_UINT32 (grub_autoefi_system_table);
|
||||
|
||||
|
@ -1096,9 +1097,6 @@ grub_xnu_boot (void)
|
|||
+ bootparams->heap_size + GRUB_XNU_PAGESIZE;
|
||||
grub_xnu_arg1 = bootparams_target;
|
||||
|
||||
if (! grub_autoefi_exit_boot_services (map_key))
|
||||
return grub_error (GRUB_ERR_IO, "can't exit boot services");
|
||||
|
||||
grub_autoefi_set_virtual_address_map (memory_map_size, descriptor_size,
|
||||
descriptor_version,memory_map);
|
||||
|
||||
|
|
|
@ -126,8 +126,9 @@ grub_multiboot_boot (void)
|
|||
return err;
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (! grub_efi_finish_boot_services ())
|
||||
grub_fatal ("cannot exit boot services");
|
||||
err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
#endif
|
||||
|
||||
grub_relocator32_boot (grub_multiboot_relocator, state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue