Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions arch/powerpc/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,38 @@
#endif /* verbose */

#else /* !__ASSEMBLER__ */
/* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and
sizeof(struct bug_entry), respectively */
#ifdef CONFIG_DEBUG_BUGVERBOSE
#define _EMIT_BUG_ENTRY \
".section __bug_table,\"aw\"\n" \
"2: .4byte 1b - .\n" \
" .4byte %0 - .\n" \
" .short %1, %2\n" \
".org 2b+%3\n" \
".previous\n"
#define _EMIT_BUG_ENTRY(label, file, line, flags) \
".section __bug_table,\"aw\"\n" \
"2: .4byte " label "b - .\n" \
" .4byte " file " - .\n" \
" .short " line ", " flags "\n"
#else
#define _EMIT_BUG_ENTRY \
".section __bug_table,\"aw\"\n" \
"2: .4byte 1b - .\n" \
" .short %2\n" \
".org 2b+%3\n" \
".previous\n"
#define _EMIT_BUG_ENTRY(label, file, line, flags) \
".section __bug_table,\"aw\"\n" \
"2: .4byte " label "b - .\n" \
" .short " flags "\n"
#endif

#define BUG_ENTRY(cond_str, insn, flags, ...) \
__asm__ __volatile__( \
"1: " insn "\n" \
_EMIT_BUG_ENTRY \
_EMIT_BUG_ENTRY("1", "%0", "%1", "%2") \
".org 2b+%3\n" \
".previous\n" \
: : "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__), \
"i" (flags), \
"i" (sizeof(struct bug_entry)), \
##__VA_ARGS__)

#define ARCH_WARN_ASM(file, line, flags, size) \
"1: twi 31, 0, 0\n" \
_EMIT_BUG_ENTRY("1", file, line, flags) \
".org 2b+" size "\n" \
".previous\n"

#define ARCH_WARN_REACHABLE

/*
* BUG_ON() and WARN_ON() do their best to cooperate with compile-time
* optimisations. However depending on the complexity of the condition
Expand Down
Loading