| 96 | |
| 97 | void exception_dispatch(struct exception_state *state, int idx); |
| 98 | void exception_dispatch(struct exception_state *state, int idx) |
| 99 | { |
| 100 | if (idx >= EXC_COUNT) { |
| 101 | printf("Bad exception index %d.\n", idx); |
| 102 | } else { |
| 103 | struct exception_handler_info *info = &exceptions[idx]; |
| 104 | if (hook && hook(idx)) |
| 105 | return; |
| 106 | |
| 107 | if (info->name) |
| 108 | printf("exception %s\n", info->name); |
| 109 | else |
| 110 | printf("exception _not_used.\n"); |
| 111 | } |
| 112 | print_regs(state); |
| 113 | /* Few words below SP in case we need state from a returned function. */ |
| 114 | dump_stack(state->sp - 32, 512); |
| 115 | |
| 116 | halt(); |
| 117 | } |
| 118 | |
| 119 | void exception_init(void) |
| 120 | { |
nothing calls this directly
no test coverage detected