summaryrefslogtreecommitdiff
path: root/include/asm-avr32/bug.h
blob: 521766bc93661dad528fd52292d87b53f906442b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Copyright (C) 2006 Atmel Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __ASM_AVR32_BUG_H
#define __ASM_AVR32_BUG_H

#ifdef CONFIG_BUG

/*
 * According to our Chief Architect, this compact opcode is very
 * unlikely to ever be implemented.
 */
#define AVR32_BUG_OPCODE	0x5df0

#ifdef CONFIG_DEBUG_BUGVERBOSE

#define BUG()								\
	do {								\
		asm volatile(".hword	%0\n\t"				\
			     ".hword	%1\n\t"				\
			     ".long	%2"				\
			     :						\
			     : "n"(AVR32_BUG_OPCODE),			\
			       "i"(__LINE__), "X"(__FILE__));		\
	} while (0)

#else

#define BUG()								\
	do {								\
		asm volatile(".hword	%0\n\t"				\
			     : : "n"(AVR32_BUG_OPCODE));		\
	} while (0)

#endif /* CONFIG_DEBUG_BUGVERBOSE */

#define HAVE_ARCH_BUG

#endif /* CONFIG_BUG */

#include <asm-generic/bug.h>

#endif /* __ASM_AVR32_BUG_H */