Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 935e28c in mainline


Ignore:
Timestamp:
2012-07-12T15:58:46Z (10 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial
Children:
2e16033
Parents:
1066041
Message:

preemption_disable: Fixed bug that called scheduler() from interrupts. It disables calling scheduler() from preemption_enable() until in_exc_handler() is implemented properly.

Location:
kernel/generic/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/preempt/preemption.c

    r1066041 r935e28c  
    4040
    4141
     42/** Determines if we are executing an exception/interrupt handler. */
     43static bool in_exc_handler(void)
     44{
     45        /* Err on the safe side until all exception processing code is audited. */
     46        return true;
     47}
     48
    4249/** Preemption was enabled. Calls scheduler(). */
    4350void preemption_enabled_scheduler(void)
     
    5461         * to suppress preemption continues to work.
    5562         */
    56         if (!interrupts_disabled()) {
     63        if (!interrupts_disabled() && !in_exc_handler()) {
     64                preemption_clear_needed();
     65                /* We may be preempted here, so we'll scheduler() again. Too bad. */
    5766                scheduler();
    58         }
     67        } 
    5968}
    6069
  • kernel/generic/src/proc/scheduler.c

    r1066041 r935e28c  
    422422                after_thread_ran();
    423423               
    424                 preemption_clear_needed();
    425                
    426424                switch (THREAD->state) {
    427425                case Running:
Note: See TracChangeset for help on using the changeset viewer.