Changes in kernel/generic/src/interrupt/interrupt.c [8f4f444:181a746] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
r8f4f444 r181a746 50 50 #include <panic.h> 51 51 #include <print.h> 52 #include <stdarg.h>53 52 #include <symtab.h> 54 53 #include <proc/thread.h> … … 111 110 } 112 111 113 /* Account CPU usage if it has wakedup from sleep */114 if (CPU ) {112 /* Account CPU usage if it woke up from sleep */ 113 if (CPU && CPU->idle) { 115 114 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 } 115 uint64_t now = get_cycle(); 116 CPU->idle_cycles += now - CPU->last_cycle; 117 CPU->last_cycle = now; 118 CPU->idle = false; 122 119 irq_spinlock_unlock(&CPU->lock, false); 123 120 } … … 166 163 } 167 164 168 static NO_TRACE void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 169 { 165 /** Terminate thread and task if exception came from userspace. 166 * 167 */ 168 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 169 { 170 if (!istate_from_uspace(istate)) 171 return; 172 170 173 printf("Task %s (%" PRIu64 ") killed due to an exception at " 171 174 "program counter %p.\n", TASK->name, TASK->taskid, … … 176 179 177 180 printf("Kill message: "); 178 vprintf(fmt, args);179 printf("\n");180 181 task_kill_self(true);182 }183 184 /** Terminate thread and task after the exception came from userspace.185 *186 */187 NO_TRACE void fault_from_uspace(istate_t *istate, const char *fmt, ...)188 {189 va_list args;190 191 va_start(args, fmt);192 fault_from_uspace_core(istate, fmt, args);193 va_end(args);194 }195 196 /** Terminate thread and task if exception came from userspace.197 *198 */199 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)200 {201 if (!istate_from_uspace(istate))202 return;203 181 204 182 va_list args; 205 183 va_start(args, fmt); 206 fault_from_uspace_core(istate,fmt, args);184 vprintf(fmt, args); 207 185 va_end(args); 186 printf("\n"); 187 188 task_kill_self(true); 208 189 } 209 190
Note:
See TracChangeset
for help on using the changeset viewer.