Changeset dc5c303 in mainline for kernel/generic/src/interrupt/interrupt.c
- Timestamp:
- 2023-12-28T13:59:23Z (2 years ago)
- Children:
- 6b66de6b
- Parents:
- 42c2e65 (diff), f87ff8e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2023-12-28 13:59:23)
- git-committer:
- GitHub <noreply@…> (2023-12-28 13:59:23)
- File:
-
- 1 edited
-
kernel/generic/src/interrupt/interrupt.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
r42c2e65 rdc5c303 58 58 #include <trace.h> 59 59 60 /* 61 * If IVT_ITEMS is zero (e.g. for special/abs32le) we hide completely any 62 * access to the exception table array and panic if the function is called 63 * at all. It also silences (correct) compiler warnings about possible 64 * out-of-bound array access. 65 */ 66 60 67 exc_table_t exc_table[IVT_ITEMS]; 61 68 IRQ_SPINLOCK_INITIALIZE(exctbl_lock); … … 77 84 #if (IVT_ITEMS > 0) 78 85 assert(n < IVT_ITEMS); 79 #endif80 86 81 87 irq_spinlock_lock(&exctbl_lock, true); … … 91 97 92 98 return old; 99 #else 100 panic("No space for any exception handler, cannot register."); 101 #endif 93 102 } 94 103 … … 103 112 #if (IVT_ITEMS > 0) 104 113 assert(n < IVT_ITEMS); 105 #endif106 114 107 115 /* Account user cycles */ … … 114 122 /* Account CPU usage if it woke up from sleep */ 115 123 if (CPU && CPU->idle) { 116 irq_spinlock_lock(&CPU->lock, false);117 124 uint64_t now = get_cycle(); 118 CPU->idle_cycles += now - CPU->last_cycle;125 atomic_time_increment(&CPU->idle_cycles, now - CPU->last_cycle); 119 126 CPU->last_cycle = now; 120 127 CPU->idle = false; 121 irq_spinlock_unlock(&CPU->lock, false);122 128 } 123 129 … … 154 160 irq_spinlock_unlock(&THREAD->lock, false); 155 161 } 162 #else 163 panic("No space for any exception handler, yet we want to handle some exception."); 164 #endif 156 165 } 157 166
Note:
See TracChangeset
for help on using the changeset viewer.
