xpmem: Support large page attachment

Change-Id: I4d672eee1c905160ece204d278f0afd9b6d7dc01
Refs: #1259
This commit is contained in:
Masamichi Takagi
2019-04-04 02:29:34 +00:00
committed by Ken Sato
parent 569dc33a9c
commit a8696d811d
35 changed files with 2394 additions and 104 deletions

31
test/issues/1259/util2.h Normal file
View File

@@ -0,0 +1,31 @@
#define CHKANDJUMP(cond, ...) do { \
if (cond) { \
fprintf(stderr, " [NG] "); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, " failed\n"); \
goto fn_fail; \
} \
} while (0)
#define OKNG(cond, ...) do { \
if (cond) { \
CHKANDJUMP(cond, __VA_ARGS__); \
} else { \
fprintf(stdout, " [OK] "); \
fprintf(stdout, __VA_ARGS__); \
fprintf(stdout, "\n"); \
} \
} while (0)
#ifdef __aarch64__
#define LARGE_PAGE_SHIFT 21
#elif defined(__x86_64__)
#define LARGE_PAGE_SHIFT 21
#else
#error "Non-compliant architecture."
#endif
#define MAP_HUGE_SHIFT 26
#define SZ_MEM (2 * (1ULL << LARGE_PAGE_SHIFT))
#define TEST_VAL 0x1129