Ignore:
Timestamp:
2012-07-10T17:50:29Z (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:
5b6c033
Parents:
22b5924
Message:

rcu: Added preemptible RCU's core API implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r22b5924 r181a746  
    110110        }
    111111       
    112         /* Account CPU usage if it has waked up from sleep */
    113         if (CPU) {
     112        /* Account CPU usage if it woke up from sleep */
     113        if (CPU && CPU->idle) {
    114114                irq_spinlock_lock(&CPU->lock, false);
    115                 if (CPU->idle) {
    116                         uint64_t now = get_cycle();
    117                         CPU->idle_cycles += now - CPU->last_cycle;
    118                         CPU->last_cycle = now;
    119                         CPU->idle = false;
    120                 }
     115                uint64_t now = get_cycle();
     116                CPU->idle_cycles += now - CPU->last_cycle;
     117                CPU->last_cycle = now;
     118                CPU->idle = false;
    121119                irq_spinlock_unlock(&CPU->lock, false);
    122120        }
Note: See TracChangeset for help on using the changeset viewer.