Go to the source code of this file.
|
#define | ARRAY_SIZE(a) (sizeof(a) / sizeof(*a)) |
|
#define | ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) |
|
#define | ASSERT(cond) |
|
#define | BUILD_BUG_ON(cond) ((void)sizeof(struct { char: -!!(cond); })) |
|
#define | min(a, b) |
|
#define | max(a, b) |
|
#define | ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1)) |
|
◆ ARRAY_SIZE
#define ARRAY_SIZE |
( |
|
a | ) |
(sizeof(a) / sizeof(*a)) |
Definition at line 8 of file lib.h.
◆ ACCESS_ONCE
#define ACCESS_ONCE |
( |
|
x | ) |
(*(volatile typeof(x) *)&(x)) |
Definition at line 10 of file lib.h.
◆ ASSERT
Value: do { if ( !(cond) ) \
panic("ASSERT(%s) failed at %s:%u\n", \
#cond, __FILE__, __LINE__); \
} while ( 0 )
Definition at line 14 of file lib.h.
◆ BUILD_BUG_ON
#define BUILD_BUG_ON |
( |
|
cond | ) |
((void)sizeof(struct { char: -!!(cond); })) |
Definition at line 24 of file lib.h.
◆ min
Value: ({ \
const typeof(a) _a = (a); \
const typeof(b) _b = (b); \
(void)(&_a == &_b); \
_a < _b ? _a : _b; \
})
Definition at line 28 of file lib.h.
◆ max
Value: ({ \
const typeof(a) _a = (a); \
const typeof(b) _b = (b); \
(void)(&_a == &_b); \
_a > _b ? _a : _b; \
})
Definition at line 36 of file lib.h.
◆ ROUNDUP
#define ROUNDUP |
( |
|
x, |
|
|
|
a |
|
) |
| (((x) + (a) - 1) & ~((a) - 1)) |
Definition at line 44 of file lib.h.
◆ panic()
void panic |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 15 of file lib.c.
◆ heapsort()
void heapsort |
( |
void * |
base, |
|
|
size_t |
nmemb, |
|
|
size_t |
size, |
|
|
int(*)(const void *, const void *) |
compar, |
|
|
void(*)(void *, void *) |
swap |
|
) |
| |
◆ exec_user_param()
unsigned long exec_user_param |
( |
unsigned long(*)(unsigned long) |
fn, |
|
|
unsigned long |
p1 |
|
) |
| |
Execute fn(p1) at user privilege, passing its return value back.
fn() is executed on user_stack[], and is non-reentrant.
◆ exec_user()
static unsigned long exec_user |
( |
unsigned long(*)(void) |
fn | ) |
|
|
inlinestatic |
Definition at line 62 of file lib.h.
◆ exec_user_void()
static void exec_user_void |
( |
void(*)(void) |
fn | ) |
|
|
inlinestatic |
Definition at line 70 of file lib.h.
◆ xtf_probe_sysctl_interface_version()
int xtf_probe_sysctl_interface_version |
( |
void |
| ) |
|
Probe for the SYSCTL_INTERFACE_VERSION in use by the hypervisor.
- Returns
- version, or -1 on failure.
Definition at line 32 of file lib.c.
◆ xtf_get_domid()
int xtf_get_domid |
( |
void |
| ) |
|
Obtain the current domid.
- Returns
- domid, or -1 on failure.
Definition at line 47 of file lib.c.