8#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
10#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
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))
46void heapsort(
void *base,
size_t nmemb,
size_t size,
47 int (*compar)(
const void *,
const void *),
48 void (*swap)(
void *,
void *));
62static inline unsigned long exec_user(
unsigned long (*fn)(
void))
static 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.
void heapsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *), void(*swap)(void *, void *))
int xtf_get_domid(void)
Obtain the current domid.
int xtf_probe_sysctl_interface_version(void)
Probe for the SYSCTL_INTERFACE_VERSION in use by the hypervisor.
void panic(const char *fmt,...)
static void exec_user_void(void(*fn)(void))
Common declarations for all tests.