2 * Copyright (c) 2018 VMware, Inc.
4 * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
9 /* Some common utilities used by the VMCI kernel module. */
11 #ifndef _VMCI_KERNEL_DEFS_H_
12 #define _VMCI_KERNEL_DEFS_H_
14 #include <sys/param.h>
15 #include <sys/systm.h>
19 #define ASSERT(cond) KASSERT(cond, ("%s", #cond))
20 #define ASSERT_ON_COMPILE(e) _Static_assert(e, #e);
22 #define LIKELY(_exp) __predict_true(_exp)
23 #define UNLIKELY(_exp) __predict_false(_exp)
25 #define CONST64U(c) UINT64_C(c)
27 #define ARRAYSIZE(a) nitems(a)
29 #define ROUNDUP(x, y) roundup(x, y)
30 #define CEILING(x, y) howmany(x, y)
32 #endif /* !_VMCI_KERNEL_DEFS_H_ */