Skip to content

Commit 70e8b22

Browse files
committed
Add a check for untested compilers
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
1 parent 81c2585 commit 70e8b22

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/libocxl_internal.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@
2222
#include <stdbool.h>
2323
#include <pthread.h>
2424

25+
/* LibOCXL is only tested with the following compilers:
26+
* GCC 6
27+
* GCC 7
28+
*
29+
* Use of other compilers may result in the MMIO functions emitting instructions
30+
* that do not result in a 32/64 bit transfer across the OpenCAPI link.
31+
*
32+
* The above compilers have been manually verified to produce the following
33+
* instructions in the mmio_*_native functions:
34+
* lwz/ld
35+
* stw/std
36+
*/
37+
#if !defined(__GNUC__) || __GNUC__ < 6
38+
#error LibOCXL is only tested with GCC 6 & GCC 7, remove this error at your own peril
39+
#endif
40+
2541
#define LIKELY(condition) __builtin_expect((condition), 1)
2642
#define UNLIKELY(condition) __builtin_expect((condition), 0)
2743

0 commit comments

Comments
 (0)