From 1d926607c66e8d18e81eaded9ca83140f2be35b8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 16 Jun 2011 16:11:40 -0400 Subject: [PATCH 1/2] Handle uninitialized GOP driver gracefully. --- gnu-efi-3.0e-handle-uninitialized-gop.patch | 57 +++++++++++++++++++++ gnu-efi.spec | 9 +++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 gnu-efi-3.0e-handle-uninitialized-gop.patch diff --git a/gnu-efi-3.0e-handle-uninitialized-gop.patch b/gnu-efi-3.0e-handle-uninitialized-gop.patch new file mode 100644 index 0000000..3a0db88 --- /dev/null +++ b/gnu-efi-3.0e-handle-uninitialized-gop.patch @@ -0,0 +1,57 @@ +From c261b8de0504fd37af99c61cdda248f312124034 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 16 Jun 2011 16:10:27 -0400 +Subject: [PATCH] Handle un-initialized GOP. + +--- + apps/modelist.c | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +diff --git a/apps/modelist.c b/apps/modelist.c +index c4a4b1a..8d816d1 100644 +--- a/apps/modelist.c ++++ b/apps/modelist.c +@@ -3,6 +3,26 @@ + + extern EFI_GUID GraphicsOutputProtocol; + ++static int memcmp(const void *s1, const void *s2, UINTN n) ++{ ++ const unsigned char *c1 = s1, *c2 = s2; ++ int d = 0; ++ ++ if (!s1 && !s2) ++ return 0; ++ if (s1 && !s2) ++ return 1; ++ if (!s1 && s2) ++ return -1; ++ ++ while (n--) { ++ d = (int)*c1++ - (int)*c2++; ++ if (d) ++ break; ++ } ++ return d; ++} ++ + static void + print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) + { +@@ -17,6 +37,13 @@ print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop) + UINTN SizeOfInfo; + rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo, + &info); ++ if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) { ++ rc = uefi_call_wrapper(gop->SetMode, 2, gop, ++ gop->Mode->Mode); ++ rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, ++ &SizeOfInfo, &info); ++ } ++ + if (EFI_ERROR(rc)) { + CHAR16 Buffer[64]; + StatusToString(Buffer, rc); +-- +1.7.4.4 + diff --git a/gnu-efi.spec b/gnu-efi.spec index f12a7c8..9a3695f 100644 --- a/gnu-efi.spec +++ b/gnu-efi.spec @@ -1,7 +1,7 @@ Summary: Development Libraries and headers for EFI Name: gnu-efi Version: 3.0e -Release: 13%{?dist} +Release: 14%{?dist} Group: Development/System License: GPLv2+ URL: ftp://ftp.hpl.hp.com/pub/linux-ia64 @@ -13,6 +13,10 @@ Patch3: gnu-efi-3.0e-add-uefi-2.x-boot-services.patch Patch4: gnu-efi-3.0e-add-pciio.patch Patch5: gnu-efi-3.0e-route80h.patch Patch6: gnu-efi-3.0e-modelist.patch +Patch7: gnu-efi-3.0e-route80h-add-cougarpoint.patch +Patch8: gnu-efi-3.0e-machine-types.patch +Patch9: gnu-efi-3.0e-unwrap.patch +Patch10: gnu-efi-3.0e-handle-uninitialized-gop.patch # "git am" doesn't like ms-dos formatted text-files. #Patch7: gnu-efi-3.0e-add-pciio-2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -64,6 +68,9 @@ rm -rf %{buildroot} %attr(0644,root,root) /boot/efi/EFI/redhat/*.efi %changelog +* Thu Jun 16 2011 Peter Jones - 3.0e-14 +- Handle uninitialized GOP driver gracefully. + * Wed Feb 09 2011 Fedora Release Engineering - 3.0e-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From b38a657b7181bc66628b4814d2643f8a4da8192b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 8 Aug 2011 11:37:54 -0400 Subject: [PATCH 2/2] Add missing file. --- gnu-efi-3.0e-route80h-add-cougarpoint.patch | 49 +++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 gnu-efi-3.0e-route80h-add-cougarpoint.patch diff --git a/gnu-efi-3.0e-route80h-add-cougarpoint.patch b/gnu-efi-3.0e-route80h-add-cougarpoint.patch new file mode 100644 index 0000000..00f9232 --- /dev/null +++ b/gnu-efi-3.0e-route80h-add-cougarpoint.patch @@ -0,0 +1,49 @@ +From 628dbd2ecce3793850f7c7d789b0adcab6746809 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 11 Nov 2010 16:42:16 -0500 +Subject: [PATCH] Add CougarPoint support to route80h.c + +CougarPoint is some other northbridge. Yay! +--- + apps/route80h.c | 16 +++++++++++++++- + 1 files changed, 15 insertions(+), 1 deletions(-) + +diff --git a/apps/route80h.c b/apps/route80h.c +index 1a04b5a..30330ab 100644 +--- a/apps/route80h.c ++++ b/apps/route80h.c +@@ -12,6 +12,7 @@ + + #define VENDOR_ID_INTEL 0x8086 + #define DEVICE_ID_LPCIF 0x3a16 ++#define DEVICE_ID_COUGARPOINT_LPCIF 0x1c56 + + static EFI_HANDLE ImageHandle; + +@@ -96,9 +97,22 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab) + EFI_PCI_IO *pciio; + lpcif_t lpcif; + EFI_STATUS rc; ++ struct { ++ uint16_t vendor; ++ uint16_t device; ++ } devices[] = { ++ { VENDOR_ID_INTEL, DEVICE_ID_LPCIF }, ++ { VENDOR_ID_INTEL, DEVICE_ID_COUGARPOINT_LPCIF }, ++ { 0, 0 } ++ }; ++ int i; + + ImageHandle = image_handle; +- rc = find_pci_device(VENDOR_ID_INTEL, DEVICE_ID_LPCIF, &pciio); ++ for (i = 0; devices[i].vendor != 0; i++) { ++ rc = find_pci_device(devices[i].vendor, devices[i].device, &pciio); ++ if (EFI_ERROR(rc)) ++ continue; ++ } + + if (rc == EFI_NOT_FOUND) { + Print(L"Device not found.\n"); +-- +1.7.2.2 +