Date: Mon, 7 May 2007 06:33:43 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 119401 for review Message-ID: <200705070633.l476XhX4029469@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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()
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705070633.l476XhX4029469>