2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
15 /* create 64-bit mask with bytes 0 to size-1 set to 0xff */
16 #define BYTE_MASK(size) (0xffffffffffffffffULL >> ((8 - (size)) * 8))
18 /* create 64-bit mask with all bits in [last:first] set */
19 #define BIT_MASK(last, first) \
20 ((0xffffffffffffffffULL >> (64 - ((last) + 1 - (first)))) << (first))
22 #define MAX(a, b) ((a) >= (b) ? (a) : (b))