Blame view

include/linux/bug.h 787 Bytes
7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
1
2
  #ifndef _LINUX_BUG_H
  #define _LINUX_BUG_H
7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
3
4
5
6
7
8
9
  #include <asm/bug.h>
  
  enum bug_trap_type {
  	BUG_TRAP_TYPE_NONE = 0,
  	BUG_TRAP_TYPE_WARN = 1,
  	BUG_TRAP_TYPE_BUG = 2,
  };
608e26196   Heiko Carstens   generic bug: use ...
10
  struct pt_regs;
7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
11
12
13
14
15
16
17
18
19
  #ifdef CONFIG_GENERIC_BUG
  #include <asm-generic/bug.h>
  
  static inline int is_warning_bug(const struct bug_entry *bug)
  {
  	return bug->flags & BUGFLAG_WARNING;
  }
  
  const struct bug_entry *find_bug(unsigned long bugaddr);
608e26196   Heiko Carstens   generic bug: use ...
20
  enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs);
7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
21

7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
22
23
24
25
  /* These are defined by the architecture */
  int is_valid_bugaddr(unsigned long addr);
  
  #else	/* !CONFIG_GENERIC_BUG */
608e26196   Heiko Carstens   generic bug: use ...
26
27
  static inline enum bug_trap_type report_bug(unsigned long bug_addr,
  					    struct pt_regs *regs)
7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
28
29
30
  {
  	return BUG_TRAP_TYPE_BUG;
  }
7664c5a1d   Jeremy Fitzhardinge   [PATCH] Generic B...
31
32
33
  
  #endif	/* CONFIG_GENERIC_BUG */
  #endif	/* _LINUX_BUG_H */