Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/interrupt.h

    r63594c0 r12bf33a  
    3737
    3838#include <arch/interrupt.h>
    39 #include <print.h>
    40 #include <typedefs.h>
     39#include <arch/types.h>
    4140#include <proc/task.h>
    4241#include <proc/thread.h>
    4342#include <arch.h>
    4443#include <ddi/irq.h>
    45 #include <stacktrace.h>
    4644
    47 typedef void (* iroutine_t)(unsigned int, istate_t *);
     45typedef void (* iroutine)(int n, istate_t *istate);
    4846
    49 typedef struct {
    50         const char *name;
    51         bool hot;
    52         iroutine_t handler;
    53         uint64_t cycles;
    54         uint64_t count;
    55 } exc_table_t;
     47#define fault_if_from_uspace(istate, fmt, ...) \
     48{ \
     49        if (istate_from_uspace(istate)) { \
     50                task_t *task = TASK; \
     51                printf("Task %s (%" PRIu64 ") killed due to an exception at %p: ", task->name, task->taskid, istate_get_pc(istate)); \
     52                printf(fmt "\n", ##__VA_ARGS__); \
     53                task_kill(task->taskid); \
     54                thread_exit(); \
     55        } \
     56}
    5657
    57 IRQ_SPINLOCK_EXTERN(exctbl_lock);
    58 extern exc_table_t exc_table[];
    59 
    60 extern void fault_if_from_uspace(istate_t *, const char *, ...)
    61     PRINTF_ATTRIBUTE(2, 3);
    62 extern istate_t *istate_get(thread_t *);
    63 extern iroutine_t exc_register(unsigned int, const char *, bool, iroutine_t);
    64 extern void exc_dispatch(unsigned int, istate_t *);
    65 extern void exc_init(void);
    66 
    67 extern void irq_initialize_arch(irq_t *);
    68 
    69 extern void istate_decode(istate_t *);
     58extern iroutine exc_register(int n, const char *name, iroutine f);
     59extern void exc_dispatch(int n, istate_t *t);
     60void exc_init(void);
    7061
    7162#endif
Note: See TracChangeset for help on using the changeset viewer.