File: bug.h

package info (click to toggle)
linux-kernel-headers 2.6.18-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 38,648 kB
  • ctags: 300,882
  • sloc: ansic: 461,192; asm: 1,555; cpp: 340; makefile: 312; sh: 110
file content (41 lines) | stat: -rw-r--r-- 1,045 bytes parent folder | download | duplicates (3)
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
/*
 * include/asm-xtensa/bug.h
 *
 * Macros to cause a 'bug' message.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright (C) 2001 - 2005 Tensilica Inc.
 */

#ifndef _XTENSA_BUG_H
#define _XTENSA_BUG_H

#include <linux/stringify.h>

#define ILL	__asm__ __volatile__ (".byte 0,0,0\n")

#ifdef CONFIG_KALLSYMS
# define BUG() do {							\
	printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__);		\
	ILL;								\
} while (0)
#else
# define BUG() do {							\
	printk("kernel BUG!\n");					\
      	ILL;								\
} while (0)
#endif

#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
#define PAGE_BUG(page) do {  BUG(); } while (0)
#define WARN_ON(condition) do {						   \
  if (unlikely((condition)!=0)) {					   \
    printk ("Warning in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
      dump_stack();							   \
  }									   \
} while (0)

#endif	/* _XTENSA_BUG_H */