Changeset 04e3d9f in mainline
- Timestamp:
- 2010-07-02T22:37:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 97bdb4a
- Parents:
- fef504a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
rfef504a r04e3d9f 100 100 NO_TRACE void exc_dispatch(unsigned int n, istate_t *istate) 101 101 { 102 ASSERT(CPU);103 104 102 #if (IVT_ITEMS > 0) 105 103 ASSERT(n < IVT_ITEMS); … … 114 112 115 113 /* Account CPU usage if it has waked up from sleep */ 116 irq_spinlock_lock(&CPU->lock, false); 117 if (CPU->idle) { 118 uint64_t now = get_cycle(); 119 CPU->idle_cycles += now - CPU->last_cycle; 120 CPU->last_cycle = now; 121 CPU->idle = false; 122 } 123 irq_spinlock_unlock(&CPU->lock, false); 114 if (CPU) { 115 irq_spinlock_lock(&CPU->lock, false); 116 if (CPU->idle) { 117 uint64_t now = get_cycle(); 118 CPU->idle_cycles += now - CPU->last_cycle; 119 CPU->last_cycle = now; 120 CPU->idle = false; 121 } 122 irq_spinlock_unlock(&CPU->lock, false); 123 } 124 124 125 125 uint64_t begin_cycle = get_cycle();
Note:
See TracChangeset
for help on using the changeset viewer.