Merge tag 'efi-next-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
[linux-block.git] / drivers / firmware / efi / libstub / x86-stub.c
index 7a7abc8959d2b0e3e44dcb06f15fa12432b93c18..b9ce6393e35313c9d714c126b370010bc304610e 100644 (file)
@@ -722,32 +722,22 @@ static efi_status_t exit_boot_func(struct efi_boot_memmap *map,
 
        efi_set_u64_split((unsigned long)efi_system_table,
                          &p->efi->efi_systab, &p->efi->efi_systab_hi);
-       p->efi->efi_memdesc_size        = *map->desc_size;
-       p->efi->efi_memdesc_version     = *map->desc_ver;
-       efi_set_u64_split((unsigned long)*map->map,
+       p->efi->efi_memdesc_size        = map->desc_size;
+       p->efi->efi_memdesc_version     = map->desc_ver;
+       efi_set_u64_split((unsigned long)map->map,
                          &p->efi->efi_memmap, &p->efi->efi_memmap_hi);
-       p->efi->efi_memmap_size         = *map->map_size;
+       p->efi->efi_memmap_size         = map->map_size;
 
        return EFI_SUCCESS;
 }
 
 static efi_status_t exit_boot(struct boot_params *boot_params, void *handle)
 {
-       unsigned long map_sz, key, desc_size, buff_size;
-       efi_memory_desc_t *mem_map;
        struct setup_data *e820ext = NULL;
        __u32 e820ext_size = 0;
        efi_status_t status;
-       __u32 desc_version;
-       struct efi_boot_memmap map;
        struct exit_boot_struct priv;
 
-       map.map                 = &mem_map;
-       map.map_size            = &map_sz;
-       map.desc_size           = &desc_size;
-       map.desc_ver            = &desc_version;
-       map.key_ptr             = &key;
-       map.buff_size           = &buff_size;
        priv.boot_params        = boot_params;
        priv.efi                = &boot_params->efi_info;
 
@@ -756,7 +746,7 @@ static efi_status_t exit_boot(struct boot_params *boot_params, void *handle)
                return status;
 
        /* Might as well exit boot services now */
-       status = efi_exit_boot_services(handle, &map, &priv, exit_boot_func);
+       status = efi_exit_boot_services(handle, &priv, exit_boot_func);
        if (status != EFI_SUCCESS)
                return status;
 
@@ -782,7 +772,7 @@ unsigned long efi_main(efi_handle_t handle,
        unsigned long bzimage_addr = (unsigned long)startup_32;
        unsigned long buffer_start, buffer_end;
        struct setup_header *hdr = &boot_params->hdr;
-       unsigned long addr, size;
+       const struct linux_efi_initrd *initrd = NULL;
        efi_status_t status;
 
        efi_system_table = sys_table_arg;
@@ -877,17 +867,18 @@ unsigned long efi_main(efi_handle_t handle,
         * arguments will be processed only if image is not NULL, which will be
         * the case only if we were loaded via the PE entry point.
         */
-       status = efi_load_initrd(image, &addr, &size, hdr->initrd_addr_max,
-                                ULONG_MAX);
+       status = efi_load_initrd(image, hdr->initrd_addr_max, ULONG_MAX,
+                                &initrd);
        if (status != EFI_SUCCESS)
                goto fail;
-       if (size > 0) {
-               efi_set_u64_split(addr, &hdr->ramdisk_image,
+       if (initrd && initrd->size > 0) {
+               efi_set_u64_split(initrd->base, &hdr->ramdisk_image,
                                  &boot_params->ext_ramdisk_image);
-               efi_set_u64_split(size, &hdr->ramdisk_size,
+               efi_set_u64_split(initrd->size, &hdr->ramdisk_size,
                                  &boot_params->ext_ramdisk_size);
        }
 
+
        /*
         * If the boot loader gave us a value for secure_boot then we use that,
         * otherwise we ask the BIOS.