From owner-p4-projects@FreeBSD.ORG Mon May 7 06:33:44 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C629716A406; Mon, 7 May 2007 06:33:43 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A46CB16A400 for ; Mon, 7 May 2007 06:33:43 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 954A313C43E for ; Mon, 7 May 2007 06:33:43 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l476XhAv029474 for ; Mon, 7 May 2007 06:33:43 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l476XhX4029469 for perforce@freebsd.org; Mon, 7 May 2007 06:33:43 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 7 May 2007 06:33:43 GMT Message-Id: <200705070633.l476XhX4029469@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 119401 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2007 06:33:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=119401 Change 119401 by kmacy@kmacy_vt-x:opentoe_init on 2007/05/07 06:33:04 add PANIC_IF routine and formatting cleanup Affected files ... .. //depot/projects/opentoe/sys/dev/cxgb/cxgb_osdep.h#9 edit Differences ... ==== //depot/projects/opentoe/sys/dev/cxgb/cxgb_osdep.h#9 (text+ko) ==== @@ -51,6 +51,11 @@ typedef struct adapter adapter_t; struct sge_rspq; +#define PANIC_IF(exp) do { \ + if (exp) \ + panic("BUG: %s", exp); \ +} while (0) + #if __FreeBSD_version > 700030 #define INTR_FILTERS #define FIRMWARE_LATEST @@ -76,9 +81,10 @@ #define PRIV_SUPPORTED #endif -#define CXGB_TX_CLEANUP_THRESHOLD 32 +#define CXGB_TX_CLEANUP_THRESHOLD 32 -#define LOG_WARNING 1 +#define LOG_WARNING 1 +#define LOG_ERR 2 #ifdef DEBUG_PRINT #define DPRINTF printf @@ -108,6 +114,16 @@ __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); } +extern void kdb_backtrace(void); + +#define WARN_ON(condition) do { \ + if (unlikely((condition)!=0)) { \ + log(LOG_WARNING, "BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \ + kdb_backtrace(); \ + } \ +} while (0) + + #else /* !i386 && !amd64 */ #define mb() #define rmb()