Robert P. J. Day | 94f582f | 2007-10-16 23:26:11 -0700 | [diff] [blame] | 1 | #ifndef __LINUX_COMPILER_H |
| 2 | #error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead." |
| 3 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | #ifdef __ECC |
| 6 | |
| 7 | /* Some compiler specific definitions are overwritten here |
| 8 | * for Intel ECC compiler |
| 9 | */ |
| 10 | |
| 11 | #include <asm/intrinsics.h> |
| 12 | |
| 13 | /* Intel ECC compiler doesn't support gcc specific asm stmts. |
| 14 | * It uses intrinsics to do the equivalent things. |
| 15 | */ |
Daniel Borkmann | b86a50c | 2015-06-25 15:01:05 -0700 | [diff] [blame] | 16 | #undef barrier |
Daniel Borkmann | 7829fb0 | 2015-04-30 04:13:52 +0200 | [diff] [blame] | 17 | #undef barrier_data |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #undef RELOC_HIDE |
Cesar Eduardo Barros | fe8c8a1 | 2013-11-25 22:00:41 -0200 | [diff] [blame] | 19 | #undef OPTIMIZER_HIDE_VAR |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Daniel Borkmann | b86a50c | 2015-06-25 15:01:05 -0700 | [diff] [blame] | 21 | #define barrier() __memory_barrier() |
Daniel Borkmann | 7829fb0 | 2015-04-30 04:13:52 +0200 | [diff] [blame] | 22 | #define barrier_data(ptr) barrier() |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #define RELOC_HIDE(ptr, off) \ |
| 25 | ({ unsigned long __ptr; \ |
| 26 | __ptr = (unsigned long) (ptr); \ |
| 27 | (typeof(ptr)) (__ptr + (off)); }) |
| 28 | |
Cesar Eduardo Barros | fe8c8a1 | 2013-11-25 22:00:41 -0200 | [diff] [blame] | 29 | /* This should act as an optimization barrier on var. |
| 30 | * Given that this compiler does not have inline assembly, a compiler barrier |
| 31 | * is the best we can do. |
| 32 | */ |
| 33 | #define OPTIMIZER_HIDE_VAR(var) barrier() |
| 34 | |
Rusty Russell | c5e631cf | 2007-05-06 14:51:05 -0700 | [diff] [blame] | 35 | /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ |
| 36 | #define __must_be_array(a) 0 |
| 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #endif |
Borislav Petkov | 9490991 | 2007-05-06 14:49:17 -0700 | [diff] [blame] | 39 | |
David Woodhouse | cf66bb9 | 2012-12-03 16:25:40 +0000 | [diff] [blame] | 40 | #ifndef __HAVE_BUILTIN_BSWAP16__ |
| 41 | /* icc has this, but it's called _bswap16 */ |
| 42 | #define __HAVE_BUILTIN_BSWAP16__ |
| 43 | #define __builtin_bswap16 _bswap16 |
| 44 | #endif |
| 45 | |