Advertisement
Guest User

uefi-boot-patch

a guest
Sep 10th, 2013
389
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
  2. index b7388a4..f7a0260 100644
  3. --- a/arch/x86/boot/compressed/eboot.c
  4. +++ b/arch/x86/boot/compressed/eboot.c
  5. @@ -251,123 +251,6 @@ static void find_bits(unsigned long mask, u8 *pos, u8 *size)
  6.     *size = len;
  7.  }
  8.  
  9. -static efi_status_t setup_efi_pci(struct boot_params *params)
  10. -{
  11. -   efi_pci_io_protocol *pci;
  12. -   efi_status_t status;
  13. -   void **pci_handle;
  14. -   efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
  15. -   unsigned long nr_pci, size = 0;
  16. -   int i;
  17. -   struct setup_data *data;
  18. -
  19. -   data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
  20. -
  21. -   while (data && data->next)
  22. -       data = (struct setup_data *)(unsigned long)data->next;
  23. -
  24. -   status = efi_call_phys5(sys_table->boottime->locate_handle,
  25. -               EFI_LOCATE_BY_PROTOCOL, &pci_proto,
  26. -               NULL, &size, pci_handle);
  27. -
  28. -   if (status == EFI_BUFFER_TOO_SMALL) {
  29. -       status = efi_call_phys3(sys_table->boottime->allocate_pool,
  30. -                   EFI_LOADER_DATA, size, &pci_handle);
  31. -
  32. -       if (status != EFI_SUCCESS)
  33. -           return status;
  34. -
  35. -       status = efi_call_phys5(sys_table->boottime->locate_handle,
  36. -                   EFI_LOCATE_BY_PROTOCOL, &pci_proto,
  37. -                   NULL, &size, pci_handle);
  38. -   }
  39. -
  40. -   if (status != EFI_SUCCESS)
  41. -       goto free_handle;
  42. -
  43. -   nr_pci = size / sizeof(void *);
  44. -   for (i = 0; i < nr_pci; i++) {
  45. -       void *h = pci_handle[i];
  46. -       uint64_t attributes;
  47. -       struct pci_setup_rom *rom;
  48. -
  49. -       status = efi_call_phys3(sys_table->boottime->handle_protocol,
  50. -                   h, &pci_proto, &pci);
  51. -
  52. -       if (status != EFI_SUCCESS)
  53. -           continue;
  54. -
  55. -       if (!pci)
  56. -           continue;
  57. -
  58. -#ifdef CONFIG_X86_64
  59. -       status = efi_call_phys4(pci->attributes, pci,
  60. -                   EfiPciIoAttributeOperationGet, 0,
  61. -                   &attributes);
  62. -#else
  63. -       status = efi_call_phys5(pci->attributes, pci,
  64. -                   EfiPciIoAttributeOperationGet, 0, 0,
  65. -                   &attributes);
  66. -#endif
  67. -       if (status != EFI_SUCCESS)
  68. -           continue;
  69. -
  70. -       if (!pci->romimage || !pci->romsize)
  71. -           continue;
  72. -
  73. -       size = pci->romsize + sizeof(*rom);
  74. -
  75. -       status = efi_call_phys3(sys_table->boottime->allocate_pool,
  76. -               EFI_LOADER_DATA, size, &rom);
  77. -
  78. -       if (status != EFI_SUCCESS)
  79. -           continue;
  80. -
  81. -       rom->data.type = SETUP_PCI;
  82. -       rom->data.len = size - sizeof(struct setup_data);
  83. -       rom->data.next = 0;
  84. -       rom->pcilen = pci->romsize;
  85. -
  86. -       status = efi_call_phys5(pci->pci.read, pci,
  87. -                   EfiPciIoWidthUint16, PCI_VENDOR_ID,
  88. -                   1, &(rom->vendor));
  89. -
  90. -       if (status != EFI_SUCCESS)
  91. -           goto free_struct;
  92. -
  93. -       status = efi_call_phys5(pci->pci.read, pci,
  94. -                   EfiPciIoWidthUint16, PCI_DEVICE_ID,
  95. -                   1, &(rom->devid));
  96. -
  97. -       if (status != EFI_SUCCESS)
  98. -           goto free_struct;
  99. -
  100. -       status = efi_call_phys5(pci->get_location, pci,
  101. -                   &(rom->segment), &(rom->bus),
  102. -                   &(rom->device), &(rom->function));
  103. -
  104. -       if (status != EFI_SUCCESS)
  105. -           goto free_struct;
  106. -
  107. -       memcpy(rom->romdata, pci->romimage, pci->romsize);
  108. -
  109. -       if (data)
  110. -           data->next = (unsigned long)rom;
  111. -       else
  112. -           params->hdr.setup_data = (unsigned long)rom;
  113. -
  114. -       data = (struct setup_data *)rom;
  115. -
  116. -       continue;
  117. -   free_struct:
  118. -       efi_call_phys1(sys_table->boottime->free_pool, rom);
  119. -   }
  120. -
  121. -free_handle:
  122. -   efi_call_phys1(sys_table->boottime->free_pool, pci_handle);
  123. -   return status;
  124. -}
  125. -
  126.  /*
  127.   * See if we have Graphics Output Protocol
  128.   */
  129. @@ -1171,8 +1054,6 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table,
  130.  
  131.     setup_graphics(boot_params);
  132.  
  133. -   setup_efi_pci(boot_params);
  134. -
  135.     status = efi_call_phys3(sys_table->boottime->allocate_pool,
  136.                 EFI_LOADER_DATA, sizeof(*gdt),
  137.                 (void **)&gdt);
Advertisement
RAW Paste Data Copied
Advertisement