1 /* 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2010 Isilon Systems, Inc. 5 * Copyright (c) 2010 iX Systems, Inc. 6 * Copyright (c) 2010 Panasas, Inc. 7 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. 8 * Copyright (c) 2015 François Tigeot 9 * All rights reserved. 10 */ 11 12 #ifndef _LINUXKPI_LINUX_COMPILER_TYPES_H_ 13 #define _LINUXKPI_LINUX_COMPILER_TYPES_H_ 14 15 #include <sys/cdefs.h> 16 17 #include <compat/linuxkpi/common/include/linux/compiler_attributes.h> 18 19 #define __kernel 20 #define __user 21 #define __iomem 22 #define __percpu 23 #define __rcu 24 #define __chk_user_ptr(x) ((void)0) 25 #define __chk_io_ptr(x) ((void)0) 26 #define __acquires(x) 27 #define __releases(x) 28 #define __acquire(x) do { } while (0) 29 #define __release(x) do { } while (0) 30 #define __cond_lock(x,c) (c) 31 #define __force 32 #define __nocast 33 #define __safe 34 #define __builtin_warning(x, y...) (1) 35 36 #define ___PASTE(a,b) a##b 37 #define __PASTE(a,b) ___PASTE(a,b) 38 39 #define __diag_push() 40 #define __diag_pop() 41 #define __diag_ignore_all(...) 42 43 #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) 44 45 /* 46 * __builtin_counted_by_ref was introduced to 47 * - gcc in e7380688fa59 with a first release tag of gcc-15.1.0, 48 * - llvm in 7475156d49406 with a first release tag of llvmorg-20.1.0-rc1 49 * but cannot be used before 23 (22.x.y possibly) (see 09a3d830a888). 50 */ 51 #if (__has_builtin(__builtin_counted_by_ref)) && \ 52 (!defined(__clang__) || (__clang_major__ >= 23)) 53 #define __flex_counter(_field) __builtin_counted_by_ref(_field) 54 #else 55 #define __flex_counter(_field) ((void *)NULL) 56 #endif 57 58 #endif 59