~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/parisc/include/asm/bug.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _PARISC_BUG_H
  2 #define _PARISC_BUG_H
  3 
  4 #include <linux/kernel.h>       /* for BUGFLAG_TAINT */
  5 
  6 /*
  7  * Tell the user there is some problem.
  8  * The offending file and line are encoded in the __bug_table section.
  9  */
 10 
 11 #ifdef CONFIG_BUG
 12 #define HAVE_ARCH_BUG
 13 #define HAVE_ARCH_WARN_ON
 14 
 15 /* the break instruction is used as BUG() marker.  */
 16 #define PARISC_BUG_BREAK_ASM    "break 0x1f, 0x1fff"
 17 #define PARISC_BUG_BREAK_INSN   0x03ffe01f  /* PARISC_BUG_BREAK_ASM */
 18 
 19 #if defined(CONFIG_64BIT)
 20 #define ASM_WORD_INSN           ".dword\t"
 21 #else
 22 #define ASM_WORD_INSN           ".word\t"
 23 #endif
 24 
 25 #ifdef CONFIG_DEBUG_BUGVERBOSE
 26 #define BUG()                                                           \
 27         do {                                                            \
 28                 asm volatile("\n"                                       \
 29                              "1:\t" PARISC_BUG_BREAK_ASM "\n"           \
 30                              "\t.pushsection __bug_table,\"a\"\n"       \
 31                              "2:\t" ASM_WORD_INSN "1b, %c0\n"           \
 32                              "\t.short %c1, %c2\n"                      \
 33                              "\t.org 2b+%c3\n"                          \
 34                              "\t.popsection"                            \
 35                              : : "i" (__FILE__), "i" (__LINE__),        \
 36                              "i" (0), "i" (sizeof(struct bug_entry)) ); \
 37                 unreachable();                                          \
 38         } while(0)
 39 
 40 #else
 41 #define BUG()                                                           \
 42         do {                                                            \
 43                 asm volatile(PARISC_BUG_BREAK_ASM : : );                \
 44                 unreachable();                                          \
 45         } while(0)
 46 #endif
 47 
 48 #ifdef CONFIG_DEBUG_BUGVERBOSE
 49 #define __WARN_TAINT(taint)                                             \
 50         do {                                                            \
 51                 asm volatile("\n"                                       \
 52                              "1:\t" PARISC_BUG_BREAK_ASM "\n"           \
 53                              "\t.pushsection __bug_table,\"a\"\n"       \
 54                              "2:\t" ASM_WORD_INSN "1b, %c0\n"           \
 55                              "\t.short %c1, %c2\n"                      \
 56                              "\t.org 2b+%c3\n"                          \
 57                              "\t.popsection"                            \
 58                              : : "i" (__FILE__), "i" (__LINE__),        \
 59                              "i" (BUGFLAG_TAINT(taint)),                \
 60                              "i" (sizeof(struct bug_entry)) );          \
 61         } while(0)
 62 #else
 63 #define __WARN_TAINT(taint)                                             \
 64         do {                                                            \
 65                 asm volatile("\n"                                       \
 66                              "1:\t" PARISC_BUG_BREAK_ASM "\n"           \
 67                              "\t.pushsection __bug_table,\"a\"\n"       \
 68                              "2:\t" ASM_WORD_INSN "1b\n"                \
 69                              "\t.short %c0\n"                           \
 70                              "\t.org 2b+%c1\n"                          \
 71                              "\t.popsection"                            \
 72                              : : "i" (BUGFLAG_TAINT(taint)),            \
 73                              "i" (sizeof(struct bug_entry)) );          \
 74         } while(0)
 75 #endif
 76 
 77 
 78 #define WARN_ON(x) ({                                           \
 79         int __ret_warn_on = !!(x);                              \
 80         if (__builtin_constant_p(__ret_warn_on)) {              \
 81                 if (__ret_warn_on)                              \
 82                         __WARN();                               \
 83         } else {                                                \
 84                 if (unlikely(__ret_warn_on))                    \
 85                         __WARN();                               \
 86         }                                                       \
 87         unlikely(__ret_warn_on);                                \
 88 })
 89 
 90 #endif
 91 
 92 #include <asm-generic/bug.h>
 93 #endif
 94 
 95 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp