Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r908bb96 r9d58539  
    5050#include <panic.h>
    5151#include <print.h>
    52 #include <stdarg.h>
    5352#include <symtab.h>
    5453#include <proc/thread.h>
     
    166165}
    167166
    168 static NO_TRACE
    169 void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args)
    170 {
     167/** Terminate thread and task if exception came from userspace.
     168 *
     169 */
     170NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
     171{
     172        if (!istate_from_uspace(istate))
     173                return;
     174       
    171175        printf("Task %s (%" PRIu64 ") killed due to an exception at "
    172176            "program counter %p.\n", TASK->name, TASK->taskid,
     
    177181       
    178182        printf("Kill message: ");
    179         vprintf(fmt, args);
    180         printf("\n");
    181        
    182         task_kill_self(true);
    183 }
    184 
    185 /** Terminate thread and task after the exception came from userspace.
    186  *
    187  */
    188 NO_TRACE void fault_from_uspace(istate_t *istate, const char *fmt, ...)
    189 {
    190         va_list args;
    191 
    192         va_start(args, fmt);
    193         fault_from_uspace_core(istate, fmt, args);
    194         va_end(args);
    195 }
    196 
    197 /** Terminate thread and task if exception came from userspace.
    198  *
    199  */
    200 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
    201 {
    202         if (!istate_from_uspace(istate))
    203                 return;
    204183       
    205184        va_list args;
    206185        va_start(args, fmt);
    207         fault_from_uspace_core(istate, fmt, args);
     186        vprintf(fmt, args);
    208187        va_end(args);
     188        printf("\n");
     189       
     190        task_kill_self(true);
    209191}
    210192
Note: See TracChangeset for help on using the changeset viewer.