From owner-svn-src-user@FreeBSD.ORG Mon May 9 07:03:01 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15DC1065673; Mon, 9 May 2011 07:03:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3FC18FC12; Mon, 9 May 2011 07:03:01 +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 p497315D080273; Mon, 9 May 2011 07:03:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49731wY080271; Mon, 9 May 2011 07:03:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105090703.p49731wY080271@svn.freebsd.org> From: Andriy Gapon Date: Mon, 9 May 2011 07:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221675 - user/avg/xcpu/sys/sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 07:03:02 -0000 Author: avg Date: Mon May 9 07:03:01 2011 New Revision: 221675 URL: http://svn.freebsd.org/changeset/base/221675 Log: add a macro to identify a panic thread the macro is placed into systm.h as all potential users of this macro should already include this header file Modified: user/avg/xcpu/sys/sys/systm.h Modified: user/avg/xcpu/sys/sys/systm.h ============================================================================== --- user/avg/xcpu/sys/sys/systm.h Mon May 9 07:01:19 2011 (r221674) +++ user/avg/xcpu/sys/sys/systm.h Mon May 9 07:03:01 2011 (r221675) @@ -109,6 +109,15 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUES ((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg) /* + * If we have already panic'd and this is the thread that called + * panic(), then don't block on any mutexes but silently succeed. + * Otherwise, the kernel will deadlock since the scheduler isn't + * going to run the thread that holds the lock we need. + */ +#define IS_PANIC_THREAD() \ + (panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0) + +/* * XXX the hints declarations are even more misplaced than most declarations * in this file, since they are needed in one file (per arch) and only used * in two files.