asm_goto_workaround.h 725 B

12345678910111213141516171819202122232425262728
  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. /*
  6. * This will bring in asm_volatile_goto and asm_inline macro definitions
  7. * if enabled by compiler and config options.
  8. */
  9. #include <linux/types.h>
  10. #ifdef asm_volatile_goto
  11. #undef asm_volatile_goto
  12. #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto")
  13. #endif
  14. /*
  15. * asm_inline is defined as asm __inline in "include/linux/compiler_types.h"
  16. * if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not
  17. * supported by CLANG.
  18. */
  19. #ifdef asm_inline
  20. #undef asm_inline
  21. #define asm_inline asm
  22. #endif
  23. #define volatile(x...) volatile("")
  24. #endif