Ignore:
Timestamp:
2012-07-12T15:58:46Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.