Replace common segment/offset pairs with struct segoff_s.
[seabios.git] / src / optionroms.c
index 819b318c306de0894b09d6c418ce4d2463bb60aa..cd8f9d1a6eb4182a6a104be592e36d35911b3d20 100644 (file)
@@ -92,8 +92,7 @@ __callrom(struct rom_header *rom, u16 offset, u16 bdf)
     br.dx = 0xffff;
     br.es = SEG_BIOS;
     br.di = get_pnp_offset();
-    br.cs = seg;
-    br.ip = offset;
+    br.code = SEGOFF(seg, offset);
     call16big(&br);
 
     debug_serial_setup();
@@ -225,13 +224,14 @@ lookup_hardcode(u32 vendev)
 static void
 run_cbfs_roms(const char *prefix, int isvga)
 {
-    struct cbfs_file *tmp = NULL;
+    struct cbfs_file *file = NULL;
     for (;;) {
-        tmp = cbfs_copyfile_prefix(
-            (void*)RomEnd, BUILD_BIOS_ADDR - RomEnd, prefix, tmp);
-        if (!tmp)
+        file = cbfs_findprefix(prefix, file);
+        if (!file)
             break;
-        init_optionrom((void*)RomEnd, 0, isvga);
+        int ret = cbfs_copyfile(file, (void*)RomEnd, BUILD_BIOS_ADDR - RomEnd);
+        if (ret > 0)
+            init_optionrom((void*)RomEnd, 0, isvga);
     }
 }