Changes in kernel/generic/src/interrupt/interrupt.c [04e3d9f:d0c82c5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
r04e3d9f rd0c82c5 55 55 #include <arch/cycle.h> 56 56 #include <str.h> 57 #include <trace.h>58 57 59 58 exc_table_t exc_table[IVT_ITEMS]; … … 98 97 * 99 98 */ 100 NO_TRACE void exc_dispatch(unsigned int n, istate_t *istate) 101 { 99 void exc_dispatch(unsigned int n, istate_t *istate) 100 { 101 ASSERT(CPU); 102 102 103 #if (IVT_ITEMS > 0) 103 104 ASSERT(n < IVT_ITEMS); … … 112 113 113 114 /* Account CPU usage if it has waked up from sleep */ 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 } 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); 124 123 125 124 uint64_t begin_cycle = get_cycle(); … … 144 143 uint64_t end_cycle = get_cycle(); 145 144 146 irq_spinlock_lock(&exctbl_lock, false);147 145 exc_table[n].cycles += end_cycle - begin_cycle; 148 146 exc_table[n].count++; 149 irq_spinlock_unlock(&exctbl_lock, false);150 147 151 148 /* Do not charge THREAD for exception cycles */ … … 160 157 * 161 158 */ 162 NO_TRACEstatic void exc_undef(unsigned int n, istate_t *istate)159 static void exc_undef(unsigned int n, istate_t *istate) 163 160 { 164 161 fault_if_from_uspace(istate, "Unhandled exception %u.", n); … … 169 166 * 170 167 */ 171 NO_TRACEvoid fault_if_from_uspace(istate_t *istate, const char *fmt, ...)168 void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 172 169 { 173 170 if (!istate_from_uspace(istate)) … … 216 213 * 217 214 */ 218 NO_TRACEstatic int cmd_exc_print(cmd_arg_t *argv)215 static int cmd_exc_print(cmd_arg_t *argv) 219 216 { 220 217 bool excs_all;
Note:
See TracChangeset
for help on using the changeset viewer.