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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php