diff options
Diffstat (limited to 'src/device/pci_rom.c')
-rw-r--r-- | src/device/pci_rom.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index 7322e57f45..31fe115c89 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -209,8 +209,6 @@ pci_rom_acpi_fill_vfct(struct device *device, struct acpi_vfct *vfct_struct, struct acpi_vfct_image_hdr *header = &vfct_struct->image_hdr; struct rom_header *rom; - vfct_struct->VBIOSImageOffset = (size_t)header - (size_t)vfct_struct; - rom = check_initialized(device); if (!rom) rom = pci_rom_probe(device); @@ -233,6 +231,8 @@ pci_rom_acpi_fill_vfct(struct device *device, struct acpi_vfct *vfct_struct, header->ImageLength = rom->size * 512; memcpy((void *)&header->VbiosContent, rom, header->ImageLength); + vfct_struct->VBIOSImageOffset = (size_t)header - (size_t)vfct_struct; + current += header->ImageLength; return current; } @@ -241,9 +241,6 @@ unsigned long pci_rom_write_acpi_tables(struct device *device, unsigned long current, struct acpi_rsdp *rsdp) { - struct acpi_vfct *vfct; - struct rom_header *rom; - /* Only handle VGA devices */ if ((device->class >> 8) != PCI_CLASS_DISPLAY_VGA) return current; @@ -252,19 +249,18 @@ pci_rom_write_acpi_tables(struct device *device, unsigned long current, if (!device->enabled) return current; - /* Probe for option rom */ - rom = pci_rom_probe(device); - if (!rom) - return current; - /* AMD/ATI uses VFCT */ if (device->vendor == PCI_VENDOR_ID_ATI) { + struct acpi_vfct *vfct; + current = ALIGN_UP(current, 8); - printk(BIOS_DEBUG, "ACPI: * VFCT at %lx\n", current); vfct = (struct acpi_vfct *)current; acpi_create_vfct(device, vfct, pci_rom_acpi_fill_vfct); - current += vfct->header.length; - acpi_add_table(rsdp, vfct); + if (vfct->header.length) { + printk(BIOS_DEBUG, "ACPI: * VFCT at %lx\n", current); + current += vfct->header.length; + acpi_add_table(rsdp, vfct); + } } return current; |