Yonghong Song | 6bf3bbe | 2019-01-12 15:04:30 -0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* Copyright (c) 2019 Facebook */ |
| 3 | #ifndef __ASM_GOTO_WORKAROUND_H |
| 4 | #define __ASM_GOTO_WORKAROUND_H |
| 5 | |
KP Singh | 98beb3e | 2019-10-02 21:16:52 +0200 | [diff] [blame] | 6 | /* |
| 7 | * This will bring in asm_volatile_goto and asm_inline macro definitions |
Yonghong Song | 6bf3bbe | 2019-01-12 15:04:30 -0800 | [diff] [blame] | 8 | * if enabled by compiler and config options. |
| 9 | */ |
| 10 | #include <linux/types.h> |
| 11 | |
| 12 | #ifdef asm_volatile_goto |
| 13 | #undef asm_volatile_goto |
| 14 | #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto") |
| 15 | #endif |
| 16 | |
KP Singh | 98beb3e | 2019-10-02 21:16:52 +0200 | [diff] [blame] | 17 | /* |
| 18 | * asm_inline is defined as asm __inline in "include/linux/compiler_types.h" |
| 19 | * if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not |
| 20 | * supported by CLANG. |
| 21 | */ |
| 22 | #ifdef asm_inline |
| 23 | #undef asm_inline |
| 24 | #define asm_inline asm |
| 25 | #endif |
| 26 | |
Alexei Starovoitov | 636e78b | 2019-04-04 14:37:14 -0700 | [diff] [blame] | 27 | #define volatile(x...) volatile("") |
Yonghong Song | 6bf3bbe | 2019-01-12 15:04:30 -0800 | [diff] [blame] | 28 | #endif |