From owner-svn-src-projects@FreeBSD.ORG Sat Oct 27 22:54:24 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 875295FD; Sat, 27 Oct 2012 22:54:24 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8FD8FC0C; Sat, 27 Oct 2012 22:54:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9RMsOi9075225; Sat, 27 Oct 2012 22:54:24 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9RMsOQh075223; Sat, 27 Oct 2012 22:54:24 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201210272254.q9RMsOQh075223@svn.freebsd.org> From: Neel Natu Date: Sat, 27 Oct 2012 22:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r242194 - projects/bhyve/sys/dev/bvm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 22:54:24 -0000 Author: neel Date: Sat Oct 27 22:54:23 2012 New Revision: 242194 URL: http://svn.freebsd.org/changeset/base/242194 Log: Probe for existence of the bvm debug port instead of just assuming that it is always present. Suggested by: grehan Obtained from: NetApp Modified: projects/bhyve/sys/dev/bvm/bvm_dbg.c Modified: projects/bhyve/sys/dev/bvm/bvm_dbg.c ============================================================================== --- projects/bhyve/sys/dev/bvm/bvm_dbg.c Sat Oct 27 22:43:30 2012 (r242193) +++ projects/bhyve/sys/dev/bvm/bvm_dbg.c Sat Oct 27 22:54:23 2012 (r242194) @@ -49,6 +49,8 @@ GDB_DBGPORT(bvm, bvm_dbg_probe, bvm_dbg_ #define BVM_DBG_PORT 0x224 static int bvm_dbg_port = BVM_DBG_PORT; +#define BVM_DBG_SIG ('B' << 8 | 'V') + static int bvm_dbg_probe(void) { @@ -56,17 +58,21 @@ bvm_dbg_probe(void) disabled = 0; resource_int_value("bvmdbg", 0, "disabled", &disabled); - if (disabled) - return (-1); - if (resource_int_value("bvmdbg", 0, "port", &port) == 0) - bvm_dbg_port = port; + if (!disabled) { + if (resource_int_value("bvmdbg", 0, "port", &port) == 0) + bvm_dbg_port = port; + + if (inw(bvm_dbg_port) == BVM_DBG_SIG) { + /* + * Return a higher priority than 0 to override other + * gdb dbgport providers that may be present (e.g. uart) + */ + return (1); + } + } - /* - * Return a higher priority than 0 to override other - * gdb dbgport providers that may be present (e.g. uart) - */ - return (1); + return (-1); } static void