18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _SPARC_BUG_H 38c2ecf20Sopenharmony_ci#define _SPARC_BUG_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#ifdef CONFIG_BUG 68c2ecf20Sopenharmony_ci#include <linux/compiler.h> 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifdef CONFIG_DEBUG_BUGVERBOSE 98c2ecf20Sopenharmony_civoid do_BUG(const char *file, int line); 108c2ecf20Sopenharmony_ci#define BUG() do { \ 118c2ecf20Sopenharmony_ci do_BUG(__FILE__, __LINE__); \ 128c2ecf20Sopenharmony_ci barrier_before_unreachable(); \ 138c2ecf20Sopenharmony_ci __builtin_trap(); \ 148c2ecf20Sopenharmony_ci} while (0) 158c2ecf20Sopenharmony_ci#else 168c2ecf20Sopenharmony_ci#define BUG() do { \ 178c2ecf20Sopenharmony_ci barrier_before_unreachable(); \ 188c2ecf20Sopenharmony_ci __builtin_trap(); \ 198c2ecf20Sopenharmony_ci} while (0) 208c2ecf20Sopenharmony_ci#endif 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#define HAVE_ARCH_BUG 238c2ecf20Sopenharmony_ci#endif 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#include <asm-generic/bug.h> 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistruct pt_regs; 288c2ecf20Sopenharmony_civoid __noreturn die_if_kernel(char *str, struct pt_regs *regs); 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#endif 31