Changes in kernel/generic/src/interrupt/interrupt.c [5cac9cd:e4d96e9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
r5cac9cd re4d96e9 50 50 #include <panic.h> 51 51 #include <print.h> 52 #include <stdarg.h> 52 53 #include <symtab.h> 53 54 #include <proc/thread.h> 54 55 #include <arch/cycle.h> 56 #include <arch/stack.h> 55 57 #include <str.h> 56 58 #include <trace.h> … … 165 167 } 166 168 167 /** Terminate thread and task if exception came from userspace. 168 * 169 */ 170 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 171 { 172 if (!istate_from_uspace(istate)) 173 return; 174 169 static NO_TRACE 170 void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 171 { 175 172 printf("Task %s (%" PRIu64 ") killed due to an exception at " 176 173 "program counter %p.\n", TASK->name, TASK->taskid, … … 181 178 182 179 printf("Kill message: "); 180 vprintf(fmt, args); 181 printf("\n"); 182 183 task_kill_self(true); 184 } 185 186 /** Terminate thread and task after the exception came from userspace. 187 * 188 */ 189 NO_TRACE void fault_from_uspace(istate_t *istate, const char *fmt, ...) 190 { 191 va_list args; 192 193 va_start(args, fmt); 194 fault_from_uspace_core(istate, fmt, args); 195 va_end(args); 196 } 197 198 /** Terminate thread and task if exception came from userspace. 199 * 200 */ 201 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 202 { 203 if (!istate_from_uspace(istate)) 204 return; 183 205 184 206 va_list args; 185 207 va_start(args, fmt); 186 vprintf(fmt, args);208 fault_from_uspace_core(istate, fmt, args); 187 209 va_end(args); 188 printf("\n");189 190 task_kill_self(true);191 210 } 192 211 … … 204 223 /* 205 224 * The istate structure should be right at the bottom of the kernel 206 * stack.225 * memory stack. 207 226 */ 208 return (istate_t *) ((uint8_t *) 209 thread->kstack + STACK_SIZE - sizeof(istate_t)); 227 return (istate_t *) &thread->kstack[MEM_STACK_SIZE - sizeof(istate_t)]; 210 228 } 211 229
Note:
See TracChangeset
for help on using the changeset viewer.