]> xenbits.xensource.com Git - seabios.git/commit
Some improvements to optionrom preemption support.
authorKevin O'Connor <kevin@koconnor.net>
Fri, 2 Apr 2010 17:13:23 +0000 (13:13 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 2 Apr 2010 17:13:23 +0000 (13:13 -0400)
commita7eb8fcf812c69c32d430b6fc79806256921f75e
treec9438ff81b88bd8a92e4d2b249442f802e07ec3c
parentd28b0fe8db0b5af2f4ddeeb48c01fa0c1ed7a920
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().
src/optionroms.c
src/stacks.c