Blame view

samples/bpf/asm_goto_workaround.h 725 Bytes
6bf3bbe1f   Yonghong Song   samples/bpf: work...
1
2
3
4
  /* SPDX-License-Identifier: GPL-2.0 */
  /* Copyright (c) 2019 Facebook */
  #ifndef __ASM_GOTO_WORKAROUND_H
  #define __ASM_GOTO_WORKAROUND_H
98beb3ede   KP Singh   samples/bpf: Add ...
5
6
  /*
   * This will bring in asm_volatile_goto and asm_inline macro definitions
6bf3bbe1f   Yonghong Song   samples/bpf: work...
7
8
9
10
11
12
13
14
   * if enabled by compiler and config options.
   */
  #include <linux/types.h>
  
  #ifdef asm_volatile_goto
  #undef asm_volatile_goto
  #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto")
  #endif
98beb3ede   KP Singh   samples/bpf: Add ...
15
16
17
18
19
20
21
22
23
  /*
   * asm_inline is defined as asm __inline in "include/linux/compiler_types.h"
   * if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not
   * supported by CLANG.
   */
  #ifdef asm_inline
  #undef asm_inline
  #define asm_inline asm
  #endif
636e78b1c   Alexei Starovoitov   samples/bpf: fix ...
24
  #define volatile(x...) volatile("")
6bf3bbe1f   Yonghong Song   samples/bpf: work...
25
  #endif