18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright (c) 2019 Facebook */
38c2ecf20Sopenharmony_ci#ifndef __ASM_GOTO_WORKAROUND_H
48c2ecf20Sopenharmony_ci#define __ASM_GOTO_WORKAROUND_H
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci/*
78c2ecf20Sopenharmony_ci * This will bring in asm_volatile_goto and asm_inline macro definitions
88c2ecf20Sopenharmony_ci * if enabled by compiler and config options.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#include <linux/types.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifdef asm_volatile_goto
138c2ecf20Sopenharmony_ci#undef asm_volatile_goto
148c2ecf20Sopenharmony_ci#define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto")
158c2ecf20Sopenharmony_ci#endif
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*
188c2ecf20Sopenharmony_ci * asm_inline is defined as asm __inline in "include/linux/compiler_types.h"
198c2ecf20Sopenharmony_ci * if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not
208c2ecf20Sopenharmony_ci * supported by CLANG.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci#ifdef asm_inline
238c2ecf20Sopenharmony_ci#undef asm_inline
248c2ecf20Sopenharmony_ci#define asm_inline asm
258c2ecf20Sopenharmony_ci#endif
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define volatile(x...) volatile("")
288c2ecf20Sopenharmony_ci#endif
29