blob: 9190b45731483d207ce7557d3cd00100fc9d62ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/*-
* Copyright (c) 2018 VMware, Inc.
*
* SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
*/
/* Some common utilities used by the VMCI kernel module. */
#ifndef _VMCI_KERNEL_DEFS_H_
#define _VMCI_KERNEL_DEFS_H_
#include <sys/param.h>
#include <sys/systm.h>
typedef uint32_t PPN;
#define ASSERT(cond) KASSERT(cond, ("%s", #cond))
#define ASSERT_ON_COMPILE(e) _Static_assert(e, #e);
#define LIKELY(_exp) __predict_true(_exp)
#define UNLIKELY(_exp) __predict_false(_exp)
#define CONST64U(c) UINT64_C(c)
#define ARRAYSIZE(a) nitems(a)
#define ROUNDUP(x, y) roundup(x, y)
#define CEILING(x, y) howmany(x, y)
#endif /* !_VMCI_KERNEL_DEFS_H_ */
|