diff options
author | Matt Fleming <matt.fleming@intel.com> | 2013-07-07 10:21:01 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2013-07-08 15:58:04 +0100 |
commit | a53c1f05fb750dc02ea555887935031722cf8318 (patch) | |
tree | a8e357b08b3b870f627496eae26b0a0730a9b016 | |
parent | 44a05afbaeca5ab744d9a5ad1a1f27944e2f4135 (diff) | |
download | syslinux-a53c1f05fb750dc02ea555887935031722cf8318.tar.gz syslinux-a53c1f05fb750dc02ea555887935031722cf8318.tar.xz syslinux-a53c1f05fb750dc02ea555887935031722cf8318.zip |
efi: move all screen twiddling to setup_screen()
We can defer all modifications of ->screen_info to setup_screen().
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | efi/console.c | 3 | ||||
-rw-r--r-- | efi/main.c | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/efi/console.c b/efi/console.c index cc493886..a9386492 100644 --- a/efi/console.c +++ b/efi/console.c @@ -1,5 +1,6 @@ #include <syslinux/linux.h> #include "efi.h" +#include <string.h> extern EFI_GUID GraphicsOutputProtocol; @@ -276,6 +277,8 @@ out: void setup_screen(struct screen_info *si) { + memset(si, 0, sizeof(*si)); + if (!setup_gop(si)) setup_uga(si); } @@ -1051,7 +1051,6 @@ int efi_boot_linux(void *kernel_buf, size_t kernel_size, { struct linux_header *hdr; struct boot_params *bp; - struct screen_info *si; EFI_STATUS status; EFI_PHYSICAL_ADDRESS addr, pref_address, kernel_start = 0; UINT64 setup_sz, init_size = 0; @@ -1097,8 +1096,6 @@ int efi_boot_linux(void *kernel_buf, size_t kernel_size, hdr->cmd_line_ptr = (UINT32)(UINTN)_cmdline; - memset((char *)&bp->screen_info, 0x0, sizeof(bp->screen_info)); - addr = pref_address; status = allocate_pages(AllocateAddress, EfiLoaderData, EFI_SIZE_TO_PAGES(init_size), &addr); @@ -1129,14 +1126,12 @@ int efi_boot_linux(void *kernel_buf, size_t kernel_size, dprintf("efi_boot_linux: kernel_start 0x%x kernel_size 0x%x initramfs 0x%x setup_data 0x%x cmdline 0x%x\n", kernel_start, kernel_size, initramfs, setup_data, _cmdline); - si = &bp->screen_info; - memset(si, 0, sizeof(*si)); /* Attempt to use the handover protocol if available */ if (hdr->version >= 0x20b && hdr->handover_offset) handover_boot(hdr, bp); - setup_screen(si); + setup_screen(&bp->screen_info); if (build_gdt()) goto free_map; |