seabios: Add Local APIC NMI Structure to ACPI MADT
[seabios.git] / src / optionroms.c
index 6c4c9ff94ddcd8223f3b9907be74e9299943b94e..2832eab1ab42b696292faf3eec1090ac0f99d003 100644 (file)
@@ -230,7 +230,7 @@ getRomPriority(u64 *sources, struct rom_header *rom, int instance)
     if (!source)
         return -1;
     if (source & RS_PCIROM)
-        return bootprio_find_pci_rom(source, instance);
+        return bootprio_find_pci_rom((void*)(u32)source, instance);
     return bootprio_find_named_rom(romfile_name(source), instance);
 }
 
@@ -379,7 +379,7 @@ init_pcirom(struct pci_device *pci, int isvga, u64 *sources)
     if (! rom)
         // No ROM present.
         return -1;
-    setRomSource(sources, rom, RS_PCIROM | bdf);
+    setRomSource(sources, rom, RS_PCIROM | (u32)pci);
     return init_optionrom(rom, bdf, isvga);
 }
 
@@ -462,6 +462,7 @@ optionrom_setup(void)
  ****************************************************************/
 
 static int S3ResumeVgaInit;
+int ScreenAndDebug;
 
 // Call into vga code to turn on console.
 void
@@ -472,15 +473,17 @@ vga_setup(void)
 
     dprintf(1, "Scan for VGA option rom\n");
 
+    // Load some config settings that impact VGA.
     EnforceChecksum = romfile_loadint("etc/optionroms-checksum", 1);
     S3ResumeVgaInit = romfile_loadint("etc/s3-resume-vga-init", 0);
+    ScreenAndDebug = romfile_loadint("etc/screen-and-debug", 1);
 
     if (CONFIG_OPTIONROMS_DEPLOYED) {
         // Option roms are already deployed on the system.
         init_optionrom((void*)BUILD_ROM_START, 0, 1);
     } else {
         // Clear option rom memory
-        memset((void*)RomEnd, 0, _max_rom() - RomEnd);
+        memset((void*)RomEnd, 0, max_rom() - RomEnd);
 
         // Find and deploy PCI VGA rom.
         struct pci_device *pci;