Enhance experimental option rom "threading" - enable preemption.
[seabios.git] / src / post.c
index 9417480a3ece35b0f5a6845fe3eaa1b6ea31fcd8..42a27bcbd0471ba27d32c75f4c6a8dd318fadee6 100644 (file)
@@ -208,11 +208,16 @@ post()
     ramdisk_setup();
 
     // Run option roms
-    if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS)
-        // Run vga option rom (if running asynchronously)
+    if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS) {
+        // Run option roms while hw init still in progress.
         vga_setup();
-    wait_threads();
-    optionrom_setup();
+        optionrom_setup();
+        wait_threads();
+    } else {
+        // Wait for hw init to finish and run non-vga option roms.
+        wait_threads();
+        optionrom_setup();
+    }
 
     // Run BCVs and show optional boot menu
     boot_prep();