--- //depot/projects/smpng/sys/amd64/amd64/machdep.c 2009/06/24 16:12:51 +++ //depot/user/jhb/msi/amd64/amd64/machdep.c 2009/07/03 23:15:22 @@ -100,8 +100,9 @@ #ifndef KDB #error KDB must be enabled in order for DDB to work! #endif +#include +#include #endif -#include #include @@ -1083,6 +1084,30 @@ IDTVEC(xmm), IDTVEC(dblfault), IDTVEC(fast_syscall), IDTVEC(fast_syscall32); +#ifdef DDB +/* + * Display the index and function name of any IDT entries that don't use + * the default 'rsvd' entry point. + */ +DB_SHOW_COMMAND(idt, db_show_idt) +{ + struct gate_descriptor *ip; + int idx; + uintptr_t func; + + ip = idt; + for (idx = 0; idx < NIDT && !db_pager_quit; idx++) { + func = ((long)ip->gd_hioffset << 16 | ip->gd_looffset); + if (func != (uintptr_t)&IDTVEC(rsvd)) { + db_printf("%3d\t", idx); + db_printsym(func, DB_STGY_PROC); + db_printf("\n"); + } + ip++; + } +} +#endif + void sdtossd(sd, ssd) struct user_segment_descriptor *sd;