Subversion Repositories HelenOS

Rev

Rev 2216 | Rev 3788 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2216 Rev 2441
Line 46... Line 46...
46
typedef void (* iroutine)(int n, istate_t *istate);
46
typedef void (* iroutine)(int n, istate_t *istate);
47
 
47
 
48
#define fault_if_from_uspace(istate, cmd, ...) \
48
#define fault_if_from_uspace(istate, cmd, ...) \
49
{ \
49
{ \
50
    if (istate_from_uspace(istate)) { \
50
    if (istate_from_uspace(istate)) { \
-
 
51
        task_t *task = TASK; \
51
        klog_printf("Task %llu killed due to an exception at %p.", TASK->taskid, istate_get_pc(istate)); \
52
        klog_printf("Task %llu killed due to an exception at %p.", task->taskid, istate_get_pc(istate)); \
52
        klog_printf("  " cmd, ##__VA_ARGS__); \
53
        klog_printf("  " cmd, ##__VA_ARGS__); \
53
        task_kill(TASK->taskid); \
54
        task_kill(task->taskid); \
54
        thread_exit(); \
55
        thread_exit(); \
55
    } \
56
    } \
56
}
57
}
57
 
58
 
58
extern iroutine exc_register(int n, const char *name, iroutine f);
59
extern iroutine exc_register(int n, const char *name, iroutine f);