David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | #ifndef __ASM_ASM_BUG_H |
| 3 | /* |
| 4 | * Copyright (C) 2017 ARM Limited |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 5 | */ |
| 6 | #define __ASM_ASM_BUG_H |
| 7 | |
| 8 | #include <asm/brk-imm.h> |
| 9 | |
| 10 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
| 11 | #define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line) |
| 12 | #define __BUGVERBOSE_LOCATION(file, line) \ |
| 13 | .pushsection .rodata.str,"aMS",@progbits,1; \ |
| 14 | 14472: .string file; \ |
| 15 | .popsection; \ |
| 16 | \ |
| 17 | .long 14472b - 14470b; \ |
| 18 | .short line; |
| 19 | #else |
| 20 | #define _BUGVERBOSE_LOCATION(file, line) |
| 21 | #endif |
| 22 | |
| 23 | #ifdef CONFIG_GENERIC_BUG |
| 24 | |
| 25 | #define __BUG_ENTRY(flags) \ |
| 26 | .pushsection __bug_table,"aw"; \ |
| 27 | .align 2; \ |
| 28 | 14470: .long 14471f - 14470b; \ |
| 29 | _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \ |
| 30 | .short flags; \ |
| 31 | .popsection; \ |
| 32 | 14471: |
| 33 | #else |
| 34 | #define __BUG_ENTRY(flags) |
| 35 | #endif |
| 36 | |
| 37 | #define ASM_BUG_FLAGS(flags) \ |
| 38 | __BUG_ENTRY(flags) \ |
| 39 | brk BUG_BRK_IMM |
| 40 | |
| 41 | #define ASM_BUG() ASM_BUG_FLAGS(0) |
| 42 | |
| 43 | #endif /* __ASM_ASM_BUG_H */ |