Subversion Repositories HelenOS-historic

Rev

Rev 907 | Rev 1062 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 907 Rev 1007
Line 281... Line 281...
281
 
281
 
282
    ipl = interrupts_disable();
282
    ipl = interrupts_disable();
283
 
283
 
284
    if (atomic_get(&haltstate))
284
    if (atomic_get(&haltstate))
285
        halt();
285
        halt();
286
 
286
   
287
    if (THREAD) {
287
    if (THREAD) {
288
        spinlock_lock(&THREAD->lock);
288
        spinlock_lock(&THREAD->lock);
289
#ifndef CONFIG_FPU_LAZY
289
#ifndef CONFIG_FPU_LAZY
290
        fpu_context_save(THREAD->saved_fpu_context);
290
        fpu_context_save(THREAD->saved_fpu_context);
291
#endif
291
#endif
Line 293... Line 293...
293
            /*
293
            /*
294
             * This is the place where threads leave scheduler();
294
             * This is the place where threads leave scheduler();
295
             */
295
             */
296
            spinlock_unlock(&THREAD->lock);
296
            spinlock_unlock(&THREAD->lock);
297
            interrupts_restore(THREAD->saved_context.ipl);
297
            interrupts_restore(THREAD->saved_context.ipl);
-
 
298
           
298
            return;
299
            return;
299
        }
300
        }
300
 
301
 
301
        /*
302
        /*
302
         * Interrupt priority level of preempted thread is recorded here
303
         * Interrupt priority level of preempted thread is recorded here
Line 340... Line 341...
340
 * Assume THREAD->lock is held.
341
 * Assume THREAD->lock is held.
341
 */
342
 */
342
void scheduler_separated_stack(void)
343
void scheduler_separated_stack(void)
343
{
344
{
344
    int priority;
345
    int priority;
345
 
346
   
346
    ASSERT(CPU != NULL);
347
    ASSERT(CPU != NULL);
347
 
348
   
348
    if (THREAD) {
349
    if (THREAD) {
349
        /* must be run after the switch to scheduler stack */
350
        /* must be run after the switch to scheduler stack */
350
        after_thread_ran();
351
        after_thread_ran();
351
 
352
 
352
        switch (THREAD->state) {
353
        switch (THREAD->state) {