Changes in kernel/generic/src/interrupt/interrupt.c [11909ce3:dfb16c4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
r11909ce3 rdfb16c4 114 114 115 115 /* Account user cycles */ 116 if (THREAD) 116 if (THREAD) { 117 irq_spinlock_lock(&THREAD->lock, false); 117 118 thread_update_accounting(true); 119 irq_spinlock_unlock(&THREAD->lock, false); 120 } 118 121 119 122 /* Account CPU usage if it woke up from sleep */ 120 if (CPU && CPU _LOCAL->idle) {123 if (CPU && CPU->idle) { 121 124 uint64_t now = get_cycle(); 122 atomic_time_increment(&CPU->idle_cycles, now - CPU _LOCAL->last_cycle);123 CPU _LOCAL->last_cycle = now;124 CPU _LOCAL->idle = false;125 atomic_time_increment(&CPU->idle_cycles, now - CPU->last_cycle); 126 CPU->last_cycle = now; 127 CPU->idle = false; 125 128 } 126 129 … … 152 155 153 156 /* Do not charge THREAD for exception cycles */ 154 if (THREAD) 157 if (THREAD) { 158 irq_spinlock_lock(&THREAD->lock, false); 155 159 THREAD->last_cycle = end_cycle; 160 irq_spinlock_unlock(&THREAD->lock, false); 161 } 156 162 #else 157 163 panic("No space for any exception handler, yet we want to handle some exception.");
Note:
See TracChangeset
for help on using the changeset viewer.