42,7 → 42,6 |
#include <debug.h> |
#include <console/kconsole.h> |
#include <console/console.h> |
#include <console/chardev.h> |
#include <console/cmd.h> |
#include <panic.h> |
#include <print.h> |
68,13 → 67,13 |
iroutine old; |
|
spinlock_lock(&exctbl_lock); |
|
|
old = exc_table[n].f; |
exc_table[n].f = f; |
exc_table[n].name = name; |
|
spinlock_unlock(&exctbl_lock); |
|
|
spinlock_unlock(&exctbl_lock); |
|
return old; |
} |
|
109,8 → 108,10 |
panic("Unhandled exception %d.", n); |
} |
|
#ifdef CONFIG_KCONSOLE |
|
/** kconsole cmd - print all exceptions */ |
static int exc_print_cmd(cmd_arg_t *argv) |
static int cmd_exc_print(cmd_arg_t *argv) |
{ |
#if (IVT_ITEMS > 0) |
unsigned int i; |
129,9 → 130,7 |
#endif |
|
for (i = 0; i < IVT_ITEMS; i++) { |
symbol = get_symtab_entry((unative_t) exc_table[i].f); |
if (!symbol) |
symbol = "not found"; |
symbol = symtab_fmt_name_lookup((unative_t) exc_table[i].f); |
|
#ifdef __32_BITS__ |
printf("%-3u %-20s %10p %s\n", i + IVT_FIRST, exc_table[i].name, |
146,7 → 145,7 |
if (((i + 1) % 20) == 0) { |
printf(" -- Press any key to continue -- "); |
spinlock_unlock(&exctbl_lock); |
getc(stdin); |
indev_pop_character(stdin); |
spinlock_lock(&exctbl_lock); |
printf("\n"); |
} |
158,15 → 157,18 |
return 1; |
} |
|
|
static cmd_info_t exc_info = { |
.name = "exc", |
.description = "Print exception table.", |
.func = exc_print_cmd, |
.func = cmd_exc_print, |
.help = NULL, |
.argc = 0, |
.argv = NULL |
}; |
|
#endif |
|
/** Initialize generic exception handling support */ |
void exc_init(void) |
{ |
175,9 → 177,11 |
for (i = 0; i < IVT_ITEMS; i++) |
exc_register(i, "undef", (iroutine) exc_undef); |
|
#ifdef CONFIG_KCONSOLE |
cmd_initialize(&exc_info); |
if (!cmd_register(&exc_info)) |
panic("could not register command %s\n", exc_info.name); |
printf("Cannot register command %s\n", exc_info.name); |
#endif |
} |
|
/** @} |