Rev 52 | Rev 68 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 52 | Rev 57 | ||
---|---|---|---|
Line 55... | Line 55... | ||
55 | volatile int nrdy; |
55 | volatile int nrdy; |
56 | 56 | ||
57 | void before_thread_runs(void) |
57 | void before_thread_runs(void) |
58 | { |
58 | { |
59 | before_thread_runs_arch(); |
59 | before_thread_runs_arch(); |
60 | fpu_context_restore(); |
60 | fpu_context_restore(&(THREAD->saved_fpu_context)); |
61 | } |
61 | } |
62 | 62 | ||
63 | 63 | ||
64 | void scheduler_init(void) |
64 | void scheduler_init(void) |
65 | { |
65 | { |
Line 202... | Line 202... | ||
202 | if (haltstate) |
202 | if (haltstate) |
203 | halt(); |
203 | halt(); |
204 | 204 | ||
205 | if (THREAD) { |
205 | if (THREAD) { |
206 | spinlock_lock(&THREAD->lock); |
206 | spinlock_lock(&THREAD->lock); |
- | 207 | fpu_context_save(&(THREAD->saved_fpu_context)); |
|
207 | if (!context_save(&THREAD->saved_context)) { |
208 | if (!context_save(&THREAD->saved_context)) { |
208 | /* |
209 | /* |
209 | * This is the place where threads leave scheduler(); |
210 | * This is the place where threads leave scheduler(); |
210 | */ |
211 | */ |
211 | before_thread_runs(); |
212 | before_thread_runs(); |