#include "pci_regs.h" // PCI_ROM_ADDRESS
#include "pci_ids.h" // PCI_CLASS_DISPLAY_VGA
#include "boot.h" // IPL
+#include "paravirt.h" // qemu_cfg_*
/****************************************************************
br.es = SEG_BIOS;
br.di = get_pnp_offset();
br.code = SEGOFF(seg, offset);
+ start_preempt();
call16big(&br);
+ finish_preempt();
debug_serial_setup();
}
static inline u32
max_rom()
{
- extern u8 code32_start[];
- if ((u32)code32_start > BUILD_BIOS_ADDR)
+ extern u8 code32flat_start[];
+ if ((u32)code32flat_start > BUILD_BIOS_ADDR)
return BUILD_BIOS_ADDR;
- return (u32)code32_start;
+ return (u32)code32flat_start;
}
// Copy a rom to its permanent location below 1MiB
}
dprintf(4, "Copying option rom (size %d) from %p to %x\n"
, romsize, rom, RomEnd);
- memcpy((void*)RomEnd, rom, romsize);
+ iomemcpy((void*)RomEnd, rom, romsize);
return (void*)RomEnd;
}
}
}
+static void
+run_qemu_roms(const char *prefix, int isvga)
+{
+ struct QemuCfgFile entry;
+ int plen = strlen(prefix);
+ int rc, dlen;
+
+ rc = qemu_cfg_first_file(&entry);
+ while (rc > 0) {
+ if (memcmp(prefix, entry.name, plen) == 0) {
+ dlen = qemu_cfg_read_file(&entry, (void*)RomEnd, max_rom() - RomEnd);
+ if (dlen > 0) {
+ dprintf(1, "init qemu rom: %s\n", entry.name);
+ init_optionrom((void*)RomEnd, 0, isvga);
+ }
+ }
+ rc = qemu_cfg_next_file(&entry);
+ }
+}
+
/****************************************************************
* PCI roms
// Find and deploy CBFS roms not associated with a device.
run_cbfs_roms("genroms/", 0);
+ run_qemu_roms("genroms/", 0);
}
// All option roms found and deployed - now build BEV/BCV vectors.
// Find and deploy CBFS vga-style roms not associated with a device.
run_cbfs_roms("vgaroms/", 1);
+ run_qemu_roms("vgaroms/", 1);
}
if (RomEnd == BUILD_ROM_START) {