Changeset 09c18f7 in mainline


Ignore:
Timestamp:
2006-03-03T11:52:46Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd21922
Parents:
f76fed4
Message:

Correct sleeping on memory allocation during FPU lazy switch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/scheduler.c

    rf76fed4 r09c18f7  
    9797void scheduler_fpu_lazy_request(void)
    9898{
     99restart:
    99100        fpu_enable();
    100101        spinlock_lock(&CPU->lock);
     
    107108                CPU->fpu_owner->fpu_context_engaged=0;
    108109                spinlock_unlock(&CPU->fpu_owner->lock);
     110                CPU->fpu_owner = NULL;
    109111        }
    110112
     
    117119                        /* Might sleep */
    118120                        spinlock_unlock(&THREAD->lock);
     121                        spinlock_unlock(&CPU->lock);
    119122                        THREAD->saved_fpu_context = slab_alloc(fpu_context_slab,
    120123                                                               0);
    121                         spinlock_lock(&THREAD->lock);
     124                        /* We may have switched CPUs during slab_alloc */
     125                        goto restart;
    122126                }
    123127                fpu_init();
Note: See TracChangeset for help on using the changeset viewer.