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