2018-03-15 19:05:59 +00:00
|
|
|
From ea34d6d6755dcd818fe6e74526a58a4f818f711a Mon Sep 17 00:00:00 2001
|
2017-06-16 19:31:32 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Tue, 14 Feb 2017 16:31:52 -0500
|
2018-04-06 19:38:57 +00:00
|
|
|
Subject: [PATCH 165/227] linuxefi: minor cleanups
|
2017-06-16 19:31:32 +00:00
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
---
|
|
|
|
grub-core/loader/i386/efi/linux.c | 30 ++++++++++++++++++++----------
|
|
|
|
1 file changed, 20 insertions(+), 10 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
|
2018-02-27 18:56:41 +00:00
|
|
|
index 010bf982d80..8b5a817b9d1 100644
|
2017-06-16 19:31:32 +00:00
|
|
|
--- a/grub-core/loader/i386/efi/linux.c
|
|
|
|
+++ b/grub-core/loader/i386/efi/linux.c
|
|
|
|
@@ -61,13 +61,18 @@ grub_linuxefi_unload (void)
|
|
|
|
grub_dl_unref (my_mod);
|
|
|
|
loaded = 0;
|
|
|
|
if (initrd_mem)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(params->ramdisk_size));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)initrd_mem,
|
|
|
|
+ BYTES_TO_PAGES(params->ramdisk_size));
|
|
|
|
if (linux_cmdline)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(params->cmdline_size + 1));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)
|
|
|
|
+ linux_cmdline,
|
|
|
|
+ BYTES_TO_PAGES(params->cmdline_size + 1));
|
|
|
|
if (kernel_mem)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem,
|
|
|
|
+ BYTES_TO_PAGES(kernel_size));
|
|
|
|
if (params)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)params,
|
|
|
|
+ BYTES_TO_PAGES(16384));
|
|
|
|
return GRUB_ERR_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -115,7 +120,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
}
|
|
|
|
|
|
|
|
params->ramdisk_size = size;
|
|
|
|
- params->ramdisk_image = (grub_uint32_t)(grub_uint64_t) initrd_mem;
|
|
|
|
+ params->ramdisk_image = (grub_uint32_t)(grub_addr_t) initrd_mem;
|
|
|
|
|
|
|
|
ptr = initrd_mem;
|
|
|
|
|
|
|
|
@@ -142,7 +147,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
grub_free (files);
|
|
|
|
|
|
|
|
if (initrd_mem && grub_errno)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(size));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)initrd_mem,
|
|
|
|
+ BYTES_TO_PAGES(size));
|
|
|
|
|
|
|
|
return grub_errno;
|
|
|
|
}
|
|
|
|
@@ -244,7 +250,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
linux_cmdline + sizeof (LINUX_IMAGE) - 1,
|
|
|
|
lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1));
|
|
|
|
|
|
|
|
- lh.cmd_line_ptr = (grub_uint32_t)(grub_uint64_t)linux_cmdline;
|
|
|
|
+ lh.cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline;
|
|
|
|
|
|
|
|
handover_offset = lh.handover_offset;
|
|
|
|
|
|
|
|
@@ -288,13 +294,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
}
|
|
|
|
|
|
|
|
if (linux_cmdline && !loaded)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(lh.cmdline_size + 1));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)
|
|
|
|
+ linux_cmdline,
|
|
|
|
+ BYTES_TO_PAGES(lh.cmdline_size + 1));
|
|
|
|
|
|
|
|
if (kernel_mem && !loaded)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem,
|
|
|
|
+ BYTES_TO_PAGES(kernel_size));
|
|
|
|
|
|
|
|
if (params && !loaded)
|
|
|
|
- grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384));
|
|
|
|
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)params,
|
|
|
|
+ BYTES_TO_PAGES(16384));
|
|
|
|
|
|
|
|
return grub_errno;
|
|
|
|
}
|
|
|
|
--
|
2018-02-27 18:56:41 +00:00
|
|
|
2.15.0
|
2017-06-16 19:31:32 +00:00
|
|
|
|