Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 Atmel Corporation |
| 3 | * |
| 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. |
| 7 | */ |
| 8 | #ifndef __ASM_AVR32_BUG_H |
| 9 | #define __ASM_AVR32_BUG_H |
| 10 | |
| 11 | #ifdef CONFIG_BUG |
| 12 | |
| 13 | /* |
| 14 | * According to our Chief Architect, this compact opcode is very |
| 15 | * unlikely to ever be implemented. |
| 16 | */ |
| 17 | #define AVR32_BUG_OPCODE 0x5df0 |
| 18 | |
| 19 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
| 20 | |
| 21 | #define BUG() \ |
| 22 | do { \ |
| 23 | asm volatile(".hword %0\n\t" \ |
| 24 | ".hword %1\n\t" \ |
| 25 | ".long %2" \ |
| 26 | : \ |
| 27 | : "n"(AVR32_BUG_OPCODE), \ |
| 28 | "i"(__LINE__), "X"(__FILE__)); \ |
| 29 | } while (0) |
| 30 | |
| 31 | #else |
| 32 | |
| 33 | #define BUG() \ |
| 34 | do { \ |
| 35 | asm volatile(".hword %0\n\t" \ |
| 36 | : : "n"(AVR32_BUG_OPCODE)); \ |
| 37 | } while (0) |
| 38 | |
| 39 | #endif /* CONFIG_DEBUG_BUGVERBOSE */ |
| 40 | |
| 41 | #define HAVE_ARCH_BUG |
| 42 | |
| 43 | #endif /* CONFIG_BUG */ |
| 44 | |
| 45 | #include <asm-generic/bug.h> |
| 46 | |
| 47 | #endif /* __ASM_AVR32_BUG_H */ |