compiler-intel.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_COMPILER_TYPES_H
  3. #error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead."
  4. #endif
  5. #ifdef __ECC
  6. /* Some compiler specific definitions are overwritten here
  7. * for Intel ECC compiler
  8. */
  9. #include <asm/intrinsics.h>
  10. /* Intel ECC compiler doesn't support gcc specific asm stmts.
  11. * It uses intrinsics to do the equivalent things.
  12. */
  13. #define barrier() __memory_barrier()
  14. #define barrier_data(ptr) barrier()
  15. #define RELOC_HIDE(ptr, off) \
  16. ({ unsigned long __ptr; \
  17. __ptr = (unsigned long) (ptr); \
  18. (typeof(ptr)) (__ptr + (off)); })
  19. /* This should act as an optimization barrier on var.
  20. * Given that this compiler does not have inline assembly, a compiler barrier
  21. * is the best we can do.
  22. */
  23. #define OPTIMIZER_HIDE_VAR(var) barrier()
  24. /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
  25. #define __must_be_array(a) 0
  26. #endif
  27. /* icc has this, but it's called _bswap16 */
  28. #define __HAVE_BUILTIN_BSWAP16__
  29. #define __builtin_bswap16 _bswap16
  30. /* The following are for compatibility with GCC, from compiler-gcc.h,
  31. * and may be redefined here because they should not be shared with other
  32. * compilers, like clang.
  33. */
  34. #define __visible __attribute__((externally_visible))