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

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

Version: ~ [ linux-5.11 ] ~ [ linux-5.10.17 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.99 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.176 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.221 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.257 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.257 ] ~ [ 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.85 ] ~ [ 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-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 /*
  2  * Copyright (C) 2006 Atmel Corporation
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  */
  8 #ifndef __ASM_AVR32_BUG_H
  9 #define __ASM_AVR32_BUG_H
 10 
 11 #ifdef CONFIG_BUG
 12 
 13 /*
 14  * According to our Chief Architect, this compact opcode is very
 15  * unlikely to ever be implemented.
 16  */
 17 #define AVR32_BUG_OPCODE        0x5df0
 18 
 19 #ifdef CONFIG_DEBUG_BUGVERBOSE
 20 
 21 #define _BUG_OR_WARN(flags)                                             \
 22         asm volatile(                                                   \
 23                 "1:     .hword  %0\n"                                   \
 24                 "       .section __bug_table,\"a\",@progbits\n"         \
 25                 "2:     .long   1b\n"                                   \
 26                 "       .long   %1\n"                                   \
 27                 "       .short  %2\n"                                   \
 28                 "       .short  %3\n"                                   \
 29                 "       .org    2b + %4\n"                              \
 30                 "       .previous"                                      \
 31                 :                                                       \
 32                 : "i"(AVR32_BUG_OPCODE), "i"(__FILE__),                 \
 33                   "i"(__LINE__), "i"(flags),                            \
 34                   "i"(sizeof(struct bug_entry)))
 35 
 36 #else
 37 
 38 #define _BUG_OR_WARN(flags)                                             \
 39         asm volatile(                                                   \
 40                 "1:     .hword  %0\n"                                   \
 41                 "       .section __bug_table,\"a\",@progbits\n"         \
 42                 "2:     .long   1b\n"                                   \
 43                 "       .short  %1\n"                                   \
 44                 "       .org    2b + %2\n"                              \
 45                 "       .previous"                                      \
 46                 :                                                       \
 47                 : "i"(AVR32_BUG_OPCODE), "i"(flags),                    \
 48                   "i"(sizeof(struct bug_entry)))
 49 
 50 #endif /* CONFIG_DEBUG_BUGVERBOSE */
 51 
 52 #define BUG()                                                           \
 53         do {                                                            \
 54                 _BUG_OR_WARN(0);                                        \
 55                 unreachable();                                          \
 56         } while (0)
 57 
 58 #define WARN_ON(condition)                                                      \
 59         ({                                                              \
 60                 int __ret_warn_on = !!(condition);                      \
 61                 if (unlikely(__ret_warn_on))                            \
 62                         _BUG_OR_WARN(BUGFLAG_WARNING);                  \
 63                 unlikely(__ret_warn_on);                                \
 64         })
 65 
 66 #define HAVE_ARCH_BUG
 67 #define HAVE_ARCH_WARN_ON
 68 
 69 #endif /* CONFIG_BUG */
 70 
 71 #include <asm-generic/bug.h>
 72 
 73 struct pt_regs;
 74 void die(const char *str, struct pt_regs *regs, long err);
 75 void _exception(long signr, struct pt_regs *regs, int code,
 76                 unsigned long addr);
 77 
 78 #endif /* __ASM_AVR32_BUG_H */
 79 

~ [ 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