2 * Copyright 2004-2009 Analog Devices Inc.
4 * Licensed under the GPL-2 or later.
7 #ifndef _BLACKFIN_BUG_H
8 #define _BLACKFIN_BUG_H
13 * This can be any undefined 16-bit opcode, meaning
14 * ((opcode & 0xc000) != 0xc000)
15 * Anything from 0x0001 to 0x000A (inclusive) will work
17 #define BFIN_BUG_OPCODE 0x0001
19 #ifdef CONFIG_DEBUG_BUGVERBOSE
21 #define _BUG_OR_WARN(flags) \
24 " .section __bug_table,\"a\",@progbits\n" \
32 : "i"(BFIN_BUG_OPCODE), "i"(__FILE__), \
33 "i"(__LINE__), "i"(flags), \
34 "i"(sizeof(struct bug_entry)))
38 #define _BUG_OR_WARN(flags) \
41 " .section __bug_table,\"a\",@progbits\n" \
47 : "i"(BFIN_BUG_OPCODE), "i"(flags), \
48 "i"(sizeof(struct bug_entry)))
50 #endif /* CONFIG_DEBUG_BUGVERBOSE */
58 #define WARN_ON(condition) \
60 int __ret_warn_on = !!(condition); \
61 if (unlikely(__ret_warn_on)) \
62 _BUG_OR_WARN(BUGFLAG_WARNING); \
63 unlikely(__ret_warn_on); \
67 #define HAVE_ARCH_WARN_ON
71 #include <asm-generic/bug.h>