Subversion Repositories HelenOS

Rev

Rev 3386 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3386 Rev 4153
Line 42... Line 42...
42
#include <arch.h>
42
#include <arch.h>
43
#include <ddi/irq.h>
43
#include <ddi/irq.h>
44
 
44
 
45
typedef void (* iroutine)(int n, istate_t *istate);
45
typedef void (* iroutine)(int n, istate_t *istate);
46
 
46
 
47
#define fault_if_from_uspace(istate, cmd, ...) \
47
#define fault_if_from_uspace(istate, fmt, ...) \
48
{ \
48
{ \
49
    if (istate_from_uspace(istate)) { \
49
    if (istate_from_uspace(istate)) { \
50
        task_t *task = TASK; \
50
        task_t *task = TASK; \
51
        printf("Task %" PRIu64 " killed due to an exception at %p.", task->taskid, istate_get_pc(istate)); \
51
        printf("Task %s (%" PRIu64 ") killed due to an exception at %p: ", task->name, task->taskid, istate_get_pc(istate)); \
52
        printf("  " cmd, ##__VA_ARGS__); \
52
        printf(fmt "\n", ##__VA_ARGS__); \
53
        task_kill(task->taskid); \
53
        task_kill(task->taskid); \
54
        thread_exit(); \
54
        thread_exit(); \
55
    } \
55
    } \
56
}
56
}
57
 
57