Ignore:
File:
1 edited

Legend:

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

    rba9a150 ra6e55886  
    5454#include <atomic.h>
    5555#include <synch/spinlock.h>
     56#include <synch/workqueue.h>
     57#include <synch/rcu.h>
    5658#include <config.h>
    5759#include <context.h>
     
    8890{
    8991        before_thread_runs_arch();
     92        rcu_before_thread_runs();
    9093
    9194#ifdef CONFIG_FPU_LAZY
     
    128131static void after_thread_ran(void)
    129132{
     133        workq_after_thread_ran();
     134        rcu_after_thread_ran();
    130135        after_thread_ran_arch();
    131136}
     
    134139void scheduler_fpu_lazy_request(void)
    135140{
     141restart:
    136142        fpu_enable();
    137143        irq_spinlock_lock(&CPU->lock, false);
     
    152158                fpu_context_restore(THREAD->saved_fpu_context);
    153159        } else {
     160                /* Allocate FPU context */
     161                if (!THREAD->saved_fpu_context) {
     162                        /* Might sleep */
     163                        irq_spinlock_unlock(&THREAD->lock, false);
     164                        irq_spinlock_unlock(&CPU->lock, false);
     165                        THREAD->saved_fpu_context =
     166                            (fpu_context_t *) slab_alloc(fpu_context_cache, 0);
     167
     168                        /* We may have switched CPUs during slab_alloc */
     169                        goto restart;
     170                }
    154171                fpu_init();
    155172                THREAD->fpu_context_exists = true;
     
    413430
    414431                case Exiting:
     432                        rcu_thread_exiting();
    415433                repeat:
    416434                        if (THREAD->detached) {
Note: See TracChangeset for help on using the changeset viewer.