diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-12-20 13:11:17 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-12-20 13:11:17 -0500 |
commit | fb214dc70aaeb7b4bbaf270bb9566843a0606933 (patch) | |
tree | 8b80f069fbc3da4ba37cdb3aa02b831c5bb883af /src/stacks.c | |
parent | 2ceeec9d56ffc93b12cbd01b7e303251b1c0361a (diff) | |
download | seabios-fb214dc70aaeb7b4bbaf270bb9566843a0606933.tar.gz |
Fix yield() so it works from boot code.
In boot code, the f-segment is read-only, so make sure yield() doesn't
rely on writes.
Easiest way to do this is to avoid stack switches when not needed.
Diffstat (limited to 'src/stacks.c')
-rw-r--r-- | src/stacks.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/stacks.c b/src/stacks.c index d2378646..56d17a1a 100644 --- a/src/stacks.c +++ b/src/stacks.c @@ -50,7 +50,7 @@ call32(void *func) " addl %0, %%esp\n" " movl %%ss, %0\n" - // Transition to 32bit mode, call yield_preempt, return to 16bit + // Transition to 32bit mode, call func, return to 16bit " pushl $(" __stringify(BUILD_BIOS_ADDR) " + 1f)\n" " jmp transition32\n" " .code32\n" @@ -148,6 +148,9 @@ static void switch_next(struct thread_info *cur) { struct thread_info *next = cur->next; + if (cur == next) + // Nothing to do. + return; asm volatile( " pushl $1f\n" // store return pc " pushl %%ebp\n" // backup %ebp |