summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-07-06 18:10:27 +0000
committerjhb <jhb@FreeBSD.org>2009-07-06 18:10:27 +0000
commit103e967dee85d0af6bc8e99ff25cfc0790e7ff22 (patch)
treef885cc802d2d0aaef9f01df02bf8784ced4c7e4b /sys/amd64
parent795d93a682989d355abd3e1365121b4ff87e33a1 (diff)
downloadFreeBSD-src-103e967dee85d0af6bc8e99ff25cfc0790e7ff22.zip
FreeBSD-src-103e967dee85d0af6bc8e99ff25cfc0790e7ff22.tar.gz
MFi386: Add a 'show idt' command to DDB to display the non-default function
pointers in the interrupt descriptor table. Approved by: re (kensmith)
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index fa8cbea..654e12b 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -100,8 +100,9 @@ __FBSDID("$FreeBSD$");
#ifndef KDB
#error KDB must be enabled in order for DDB to work!
#endif
-#endif
#include <ddb/ddb.h>
+#include <ddb/db_sym.h>
+#endif
#include <net/netisr.h>
@@ -1083,6 +1084,30 @@ extern inthand_t
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;
OpenPOWER on IntegriCloud