/root/src/xen/xen/include/xen/types.h
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef __TYPES_H__ |
2 | | #define __TYPES_H__ |
3 | | |
4 | | #include <xen/stdbool.h> |
5 | | |
6 | | #include <asm/types.h> |
7 | | |
8 | | #define BITS_TO_LONGS(bits) \ |
9 | 16.3M | (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) |
10 | | #define DECLARE_BITMAP(name,bits) \ |
11 | 7.09M | unsigned long name[BITS_TO_LONGS(bits)] |
12 | | |
13 | | #ifndef NULL |
14 | 215M | #define NULL ((void*)0) |
15 | | #endif |
16 | | |
17 | 0 | #define INT8_MIN (-127-1) |
18 | 0 | #define INT16_MIN (-32767-1) |
19 | 0 | #define INT32_MIN (-2147483647-1) |
20 | | |
21 | | #define INT8_MAX (127) |
22 | | #define INT16_MAX (32767) |
23 | | #define INT32_MAX (2147483647) |
24 | | |
25 | 1 | #define UINT8_MAX (255) |
26 | 0 | #define UINT16_MAX (65535) |
27 | 0 | #define UINT32_MAX (4294967295U) |
28 | | |
29 | 3.07k | #define INT_MAX ((int)(~0U>>1)) |
30 | 3.07k | #define INT_MIN (-INT_MAX - 1) |
31 | 270 | #define UINT_MAX (~0U) |
32 | | #define LONG_MAX ((long)(~0UL>>1)) |
33 | | #define LONG_MIN (-LONG_MAX - 1) |
34 | 16 | #define ULONG_MAX (~0UL) |
35 | | |
36 | | typedef __u8 uint8_t; |
37 | | typedef __s8 int8_t; |
38 | | |
39 | | typedef __u16 uint16_t; |
40 | | typedef __s16 int16_t; |
41 | | |
42 | | typedef __u32 uint32_t; |
43 | | typedef __s32 int32_t; |
44 | | |
45 | | typedef __u64 uint64_t; |
46 | | typedef __s64 int64_t; |
47 | | |
48 | | typedef __u16 __le16; |
49 | | typedef __u16 __be16; |
50 | | typedef __u32 __le32; |
51 | | typedef __u32 __be32; |
52 | | typedef __u64 __le64; |
53 | | typedef __u64 __be64; |
54 | | |
55 | | typedef unsigned int __attribute__((__mode__(__pointer__))) uintptr_t; |
56 | | |
57 | | typedef bool bool_t; |
58 | 3.84k | #define test_and_set_bool(b) xchg(&(b), true) |
59 | 7.99k | #define test_and_clear_bool(b) xchg(&(b), false) |
60 | | |
61 | | #endif /* __TYPES_H__ */ |