From owner-svn-src-head@FreeBSD.ORG Mon Jul 6 18:10:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1612106566C; Mon, 6 Jul 2009 18:10:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D02A88FC12; Mon, 6 Jul 2009 18:10:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66IAR5o088648; Mon, 6 Jul 2009 18:10:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66IARQJ088646; Mon, 6 Jul 2009 18:10:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907061810.n66IARQJ088646@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Jul 2009 18:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195410 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 18:10:28 -0000 Author: jhb Date: Mon Jul 6 18:10:27 2009 New Revision: 195410 URL: http://svn.freebsd.org/changeset/base/195410 Log: MFi386: Add a 'show idt' command to DDB to display the non-default function pointers in the interrupt descriptor table. Approved by: re (kensmith) Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Jul 6 17:23:48 2009 (r195409) +++ head/sys/amd64/amd64/machdep.c Mon Jul 6 18:10:27 2009 (r195410) @@ -100,8 +100,9 @@ __FBSDID("$FreeBSD$"); #ifndef KDB #error KDB must be enabled in order for DDB to work! #endif -#endif #include +#include +#endif #include @@ -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;