2 * Copyright (C) 2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 #ifndef __ASM_AVR32_BUG_H
9 #define __ASM_AVR32_BUG_H
14 * According to our Chief Architect, this compact opcode is very
15 * unlikely to ever be implemented.
17 #define AVR32_BUG_OPCODE 0x5df0
19 #ifdef CONFIG_DEBUG_BUGVERBOSE
21 #define _BUG_OR_WARN(flags) \
24 " .section __bug_table,\"a\",@progbits\n" \
32 : "i"(AVR32_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"(AVR32_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
69 #endif /* CONFIG_BUG */
71 #include <asm-generic/bug.h>
74 void die(const char *str, struct pt_regs *regs, long err);
75 void _exception(long signr, struct pt_regs *regs, int code,
78 #endif /* __ASM_AVR32_BUG_H */