8 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a)) 10 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) 14 #define ASSERT(cond) \ 16 panic("ASSERT(%s) failed at %s:%u\n", \ 17 #cond, __FILE__, __LINE__); \ 20 #if __has_extension(c_static_assert) 21 # define BUILD_BUG_ON(cond) \ 22 _Static_assert(!(cond), "!(" #cond ")") 24 # define BUILD_BUG_ON(cond) \ 25 ((void)sizeof(struct { char: -!!(cond); })) 30 const typeof(a) _a = (a); \ 31 const typeof(b) _b = (b); \ 38 const typeof(a) _a = (a); \ 39 const typeof(b) _b = (b); \ 44 #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1)) 46 void heapsort(
void *base,
size_t nmemb,
size_t size,
47 int (*compar)(
const void *,
const void *),
48 void (*swap)(
void *,
void *));
62 static inline unsigned long exec_user(
unsigned long (*fn)(
void))
unsigned long exec_user_param(unsigned long(*fn)(unsigned long), unsigned long p1)
Execute fn(p1) at user privilege, passing its return value back.
Common declarations for all tests.
void panic(const char *fmt,...)
int xtf_get_domid(void)
Obtain the current domid.
static void exec_user_void(void(*fn)(void))
int xtf_probe_sysctl_interface_version(void)
Probe for the SYSCTL_INTERFACE_VERSION in use by the hypervisor.
static unsigned long exec_user(unsigned long(*fn)(void))
void heapsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *), void(*swap)(void *, void *))