--- zzzz-none-000/linux-4.9.276/arch/mips/include/asm/bug.h 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/arch/mips/include/asm/bug.h 2023-04-05 08:19:00.000000000 +0000 @@ -8,16 +8,56 @@ #include +#ifdef CONFIG_BUG_EXTRA_INFO +#define BUG() \ +( { \ + __asm__ __volatile__("1: \n" \ + " break %0\n" \ + " .section __bug_debug_table, \"a\"\n" \ + " .word 1b\n" \ + " .word %1\n" \ + " .word %2\n" \ + " .word %3\n" \ + " .word 0\n" \ + " .previous\n" \ + : \ + : "i"(BRK_BUG), "i"(__FILE__), "i"(__LINE__), "i"(__FUNCTION__)); \ + unreachable(); \ +} ) +#else static inline void __noreturn BUG(void) { __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); unreachable(); } +#endif #define HAVE_ARCH_BUG #if (_MIPS_ISA > _MIPS_ISA_MIPS1) +#ifdef CONFIG_BUG_EXTRA_INFO +#define __BUG_ON(condition) \ +( { \ + if (__builtin_constant_p(condition)) { \ + if (condition) { \ + BUG(); \ + } \ + } else { \ + __asm__ __volatile__("1: \n" \ + " tne $0, %0, %1\n" \ + " .section __bug_debug_table, \"a\"\n" \ + " .word 1b\n" \ + " .word %2\n" \ + " .word %3\n" \ + " .word %4\n" \ + " .word 0\n" \ + " .previous\n" \ + : \ + : "r"(condition), "i"(BRK_BUG), "i"(__FILE__), "i"(__LINE__), "i"(__FUNCTION__)); \ + } \ +} ) +#else static inline void __BUG_ON(unsigned long condition) { if (__builtin_constant_p(condition)) { @@ -29,6 +69,7 @@ __asm__ __volatile__("tne $0, %0, %1" : : "r" (condition), "i" (BRK_BUG)); } +#endif #define BUG_ON(C) __BUG_ON((unsigned long)(C))