aboutsummaryrefslogtreecommitdiffstats
path: root/src/optionroms.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-04-02 13:13:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-04-02 13:13:23 -0400
commita7eb8fcf812c69c32d430b6fc79806256921f75e (patch)
treec9438ff81b88bd8a92e4d2b249442f802e07ec3c /src/optionroms.c
parentd28b0fe8db0b5af2f4ddeeb48c01fa0c1ed7a920 (diff)
downloadseabios-a7eb8fcf812c69c32d430b6fc79806256921f75e.tar.gz
Some improvements to optionrom preemption support.
Enable preemption during VGA mode switch call - this call can take several milliseconds on real hardware. Call yield() in finish_preempt() - when preemption is configured it allows threads in wait_preempt() to run; when not configured it gives an opportunity for threads to execute after the implicit delay from optionrom execution. Don't penalize priority in run_thread(). The run_thread() code would implicitly yield because it created the new thread on the list after the current thread and then jumped to it. When in a preemption event, a yield effectively waits approximately one millisecond (to the next rtc irq). The implicit yielding in run_thread thus limited the number of threads one could launch during preemption to 1 per millisecond. So, change the code so that the new thread is created prior to the current thread - thus eliminating the effective yield from run_thread().
Diffstat (limited to 'src/optionroms.c')
-rw-r--r--src/optionroms.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/optionroms.c b/src/optionroms.c
index 47f5808a..ad88e0ca 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -470,7 +470,9 @@ vga_setup(void)
memset(&br, 0, sizeof(br));
br.flags = F_IF;
br.ax = 0x0003;
+ start_preempt();
call16_int(0x10, &br);
+ finish_preempt();
// Write to screen.
printf("Starting SeaBIOS (version %s)\n\n", VERSION);