]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/mips/include/asm/bug.h
block: add helpers to run flush_dcache_page() against a bio and a request's pages
[mirror_ubuntu-artful-kernel.git] / arch / mips / include / asm / bug.h
CommitLineData
1da177e4
LT
1#ifndef __ASM_BUG_H
2#define __ASM_BUG_H
3
0ca5921e 4#include <linux/compiler.h>
63dc68a8 5#include <asm/sgidefs.h>
fdb551a4
RB
6
7#ifdef CONFIG_BUG
8
1da177e4
LT
9#include <asm/break.h>
10
8ec2e243
DD
11static inline void __noreturn BUG(void)
12{
13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
14 /* Fool GCC into thinking the function doesn't return. */
15 while (1)
16 ;
17}
8592d4c0
RB
18
19#define HAVE_ARCH_BUG
1da177e4 20
63dc68a8
RB
21#if (_MIPS_ISA > _MIPS_ISA_MIPS1)
22
8ec2e243
DD
23static inline void __BUG_ON(unsigned long condition)
24{
25 if (__builtin_constant_p(condition)) {
26 if (condition)
27 BUG();
28 else
29 return;
30 }
31 __asm__ __volatile__("tne $0, %0, %1"
32 : : "r" (condition), "i" (BRK_BUG));
33}
34
35#define BUG_ON(C) __BUG_ON((unsigned long)(C))
63dc68a8
RB
36
37#define HAVE_ARCH_BUG_ON
38
39#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
40
1da177e4 41#endif
fdb551a4 42
ffd099bd
RB
43#include <asm-generic/bug.h>
44
fdb551a4 45#endif /* __ASM_BUG_H */