Changes in kernel/generic/src/interrupt/interrupt.c [e4d96e9:5cac9cd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/interrupt/interrupt.c
re4d96e9 r5cac9cd 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> 55 54 #include <arch/cycle.h> 56 #include <arch/stack.h>57 55 #include <str.h> 58 56 #include <trace.h> … … 167 165 } 168 166 169 static NO_TRACE 170 void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 171 { 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 172 175 printf("Task %s (%" PRIu64 ") killed due to an exception at " 173 176 "program counter %p.\n", TASK->name, TASK->taskid, … … 178 181 179 182 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;205 183 206 184 va_list args; 207 185 va_start(args, fmt); 208 fault_from_uspace_core(istate,fmt, args);186 vprintf(fmt, args); 209 187 va_end(args); 188 printf("\n"); 189 190 task_kill_self(true); 210 191 } 211 192 … … 223 204 /* 224 205 * The istate structure should be right at the bottom of the kernel 225 * memorystack.206 * stack. 226 207 */ 227 return (istate_t *) &thread->kstack[MEM_STACK_SIZE - sizeof(istate_t)]; 208 return (istate_t *) ((uint8_t *) 209 thread->kstack + STACK_SIZE - sizeof(istate_t)); 228 210 } 229 211
Note:
See TracChangeset
for help on using the changeset viewer.