Add test programs for lage page
Tests arm64 specific, contiguous bit based large pages as well. Change-Id: I09edad8cfde6c23a259f1f32cfc97974d9cb63c3
This commit is contained in:
committed by
Dominique Martinet
parent
100754f556
commit
9f7425c152
56
test/large_page/util.h
Normal file
56
test/large_page/util.h
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef __UTIL_H_INCLUDED__
|
||||
#define __UTIL_H_INCLUDED__
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#define dprintf(...) do { \
|
||||
char msg[1024]; \
|
||||
sprintf(msg, __VA_ARGS__); \
|
||||
fprintf(stderr, "%s: %s", __func__, msg); \
|
||||
} while (0)
|
||||
#else
|
||||
#define dprintf(...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define eprintf(...) do { \
|
||||
char msg[1024]; \
|
||||
sprintf(msg, __VA_ARGS__); \
|
||||
fprintf(stderr, "%s: ERROR: %s", __func__, msg); \
|
||||
} while (0)
|
||||
|
||||
#define CHKANDJUMP(cond, err, ...) do { \
|
||||
if (cond) { \
|
||||
eprintf(__VA_ARGS__); \
|
||||
ret = err; \
|
||||
goto fn_fail; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _OKNG(verb, jump, cond, fmt, args...) do { \
|
||||
if (cond) { \
|
||||
if (verb) \
|
||||
printf("\t[ OK ] " fmt, ##args); \
|
||||
} else { \
|
||||
printf("\t[ NG ] " fmt, ##args); \
|
||||
if (jump) \
|
||||
goto fn_fail; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define OKNG(args...) _OKNG(1, 1, ##args)
|
||||
#define NG(args...) _OKNG(0, 1, ##args)
|
||||
#define OKNGNOJUMP(args...) _OKNG(1, 0, ##args)
|
||||
|
||||
#define Q(x) #x
|
||||
#define QUOTE(x) Q(x)
|
||||
|
||||
extern char *mck_dir;
|
||||
extern char *arch;
|
||||
extern char *target;
|
||||
|
||||
int get_config(void);
|
||||
void destroy_config(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user