PERFORCE change 119401 for review
Kip Macy
kmacy at FreeBSD.org
Mon May 7 06:33:44 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119401
Change 119401 by kmacy at 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()
More information about the p4-projects
mailing list