Rev 673 | Rev 1224 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 673 | Rev 958 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | /** Dispatch exception according to exception table |
69 | /** Dispatch exception according to exception table |
70 | * |
70 | * |
71 | * Called directly from the assembler code. |
71 | * Called directly from the assembler code. |
72 | * CPU is interrupts_disable()'d. |
72 | * CPU is interrupts_disable()'d. |
73 | */ |
73 | */ |
74 | void exc_dispatch(int n, void *stack) |
74 | void exc_dispatch(int n, istate_t *istate) |
75 | { |
75 | { |
76 | ASSERT(n < IVT_ITEMS); |
76 | ASSERT(n < IVT_ITEMS); |
77 | 77 | ||
78 | exc_table[n].f(n + IVT_FIRST, stack); |
78 | exc_table[n].f(n + IVT_FIRST, istate); |
79 | } |
79 | } |
80 | 80 | ||
81 | /** Default 'null' exception handler */ |
81 | /** Default 'null' exception handler */ |
82 | static void exc_undef(int n, void *stack) |
82 | static void exc_undef(int n, istate_t *istate) |
83 | { |
83 | { |
84 | panic("Unhandled exception %d.", n); |
84 | panic("Unhandled exception %d.", n); |
85 | } |
85 | } |
86 | 86 | ||
87 | /** kconsole cmd - print all exceptions */ |
87 | /** kconsole cmd - print all exceptions */ |
Line 124... | Line 124... | ||
124 | void exc_init(void) |
124 | void exc_init(void) |
125 | { |
125 | { |
126 | int i; |
126 | int i; |
127 | 127 | ||
128 | for (i=0;i < IVT_ITEMS; i++) |
128 | for (i=0;i < IVT_ITEMS; i++) |
129 | exc_register(i, "undef", exc_undef); |
129 | exc_register(i, "undef", (iroutine) exc_undef); |
130 | 130 | ||
131 | cmd_initialize(&exc_info); |
131 | cmd_initialize(&exc_info); |
132 | if (!cmd_register(&exc_info)) |
132 | if (!cmd_register(&exc_info)) |
133 | panic("could not register command %s\n", exc_info.name); |
133 | panic("could not register command %s\n", exc_info.name); |
134 | } |
134 | } |