0001
0002 #ifndef __LINUX_COMPILER_TYPES_H
0003 #error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
0004 #endif
0005
0006
0007
0008
0009
0010
0011 #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
0012
0013
0014 #define KASAN_ABI_VERSION 5
0015
0016
0017
0018
0019
0020
0021
0022 #if __has_feature(address_sanitizer) || __has_feature(hwaddress_sanitizer)
0023
0024 #define __SANITIZE_ADDRESS__
0025 #define __no_sanitize_address \
0026 __attribute__((no_sanitize("address", "hwaddress")))
0027 #else
0028 #define __no_sanitize_address
0029 #endif
0030
0031 #if __has_feature(thread_sanitizer)
0032
0033 #define __SANITIZE_THREAD__
0034 #define __no_sanitize_thread \
0035 __attribute__((no_sanitize("thread")))
0036 #else
0037 #define __no_sanitize_thread
0038 #endif
0039
0040 #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP)
0041 #define __HAVE_BUILTIN_BSWAP32__
0042 #define __HAVE_BUILTIN_BSWAP64__
0043 #define __HAVE_BUILTIN_BSWAP16__
0044 #endif
0045
0046 #if __has_feature(undefined_behavior_sanitizer)
0047
0048 #define __no_sanitize_undefined \
0049 __attribute__((no_sanitize("undefined")))
0050 #else
0051 #define __no_sanitize_undefined
0052 #endif
0053
0054
0055
0056
0057
0058
0059 #if __has_feature(coverage_sanitizer)
0060 #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
0061 #else
0062 #define __no_sanitize_coverage
0063 #endif
0064
0065 #if __has_feature(shadow_call_stack)
0066 # define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
0067 #endif
0068
0069 #define __nocfi __attribute__((__no_sanitize__("cfi")))
0070 #define __cficanonical __attribute__((__cfi_canonical_jump_table__))
0071
0072 #if defined(CONFIG_CFI_CLANG)
0073
0074
0075
0076
0077
0078
0079 #define function_nocfi(x) __builtin_function_start(x)
0080 #endif
0081
0082
0083
0084
0085
0086 #define __diag_clang(version, severity, s) \
0087 __diag_clang_ ## version(__diag_clang_ ## severity s)
0088
0089
0090 #define __diag_clang_ignore ignored
0091 #define __diag_clang_warn warning
0092 #define __diag_clang_error error
0093
0094 #define __diag_str1(s) #s
0095 #define __diag_str(s) __diag_str1(s)
0096 #define __diag(s) _Pragma(__diag_str(clang diagnostic s))
0097
0098 #if CONFIG_CLANG_VERSION >= 110000
0099 #define __diag_clang_11(s) __diag(s)
0100 #else
0101 #define __diag_clang_11(s)
0102 #endif
0103
0104 #define __diag_ignore_all(option, comment) \
0105 __diag_clang(11, ignore, option)