Subversion Repositories HelenOS

Rev

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

Rev 2071 Rev 2089
Line 34... Line 34...
34
 
34
 
35
#ifndef KERN_INTERRUPT_H_
35
#ifndef KERN_INTERRUPT_H_
36
#define KERN_INTERRUPT_H_
36
#define KERN_INTERRUPT_H_
37
 
37
 
38
#include <arch/interrupt.h>
38
#include <arch/interrupt.h>
39
#include <typedefs.h>
-
 
40
#include <arch/types.h>
39
#include <arch/types.h>
41
#include <proc/task.h>
40
#include <proc/task.h>
42
#include <proc/thread.h>
41
#include <proc/thread.h>
43
#include <arch.h>
42
#include <arch.h>
44
#include <console/klog.h>
43
#include <console/klog.h>
45
#include <ipc/irq.h>
44
#include <ddi/irq.h>
-
 
45
 
-
 
46
typedef void (* iroutine)(int n, istate_t *istate);
46
 
47
 
47
#define fault_if_from_uspace(istate, cmd, ...) \
48
#define fault_if_from_uspace(istate, cmd, ...) \
48
{ \
49
{ \
49
    if (istate_from_uspace(istate)) { \
50
    if (istate_from_uspace(istate)) { \
50
        klog_printf("Task %lld killed due to an exception at %p.", TASK->taskid, istate_get_pc(istate)); \
51
        klog_printf("Task %lld killed due to an exception at %p.", TASK->taskid, istate_get_pc(istate)); \
Line 52... Line 53...
52
        task_kill(TASK->taskid); \
53
        task_kill(TASK->taskid); \
53
        thread_exit(); \
54
        thread_exit(); \
54
    } \
55
    } \
55
}
56
}
56
 
57
 
57
 
-
 
58
extern iroutine exc_register(int n, const char *name, iroutine f);
58
extern iroutine exc_register(int n, const char *name, iroutine f);
59
extern void exc_dispatch(int n, istate_t *t);
59
extern void exc_dispatch(int n, istate_t *t);
60
void exc_init(void);
60
void exc_init(void);
61
 
61
 
62
#endif
62
#endif