-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathxen-types.h
140 lines (105 loc) · 2.87 KB
/
xen-types.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#ifndef __TYPES_H__
#define __TYPES_H__
#ifndef __X86_TYPES_H__
#define __X86_TYPES_H__
#ifndef __ASSEMBLY__
//#include <xen/config.h>
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#if defined(__i386__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#elif defined(__x86_64__)
typedef __signed__ long __s64;
typedef unsigned long __u64;
#endif
#endif
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
#if defined(__i386__)
typedef signed long long s64;
typedef unsigned long long u64;
typedef unsigned long paddr_t;
#define PRIpaddr "08lx"
#elif defined(__x86_64__)
typedef signed long s64;
typedef unsigned long u64;
typedef unsigned long paddr_t;
#define PRIpaddr "016lx"
#endif
typedef unsigned long size_t;
typedef unsigned long xen_pfn_t;
#endif /* __ASSEMBLY__ */
#if defined(__i386__)
#define BITS_PER_LONG 32
#define BYTES_PER_LONG 4
#define LONG_BYTEORDER 2
#elif defined(__x86_64__)
#define BITS_PER_LONG 64
#define BYTES_PER_LONG 8
#define LONG_BYTEORDER 3
#endif
#endif /* __X86_TYPES_H__ */
//#include <xen/config.h>
//#include <asm/types.h>
#define BITS_TO_LONGS(bits) \
(((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
#define DECLARE_BITMAP(name,bits) \
unsigned long name[BITS_TO_LONGS(bits)]
#ifndef NULL
#define NULL ((void*)0)
#endif
#ifndef INT_MAX
#define INT_MAX ((int)(~0U>>1))
#endif
#ifndef INT_MIN
#define INT_MIN (-INT_MAX - 1)
#endif
#ifndef UINT_MAX
#define UINT_MAX (~0U)
#endif
#ifndef LONG_MAX
#define LONG_MAX ((long)(~0UL>>1))
#endif
#ifndef LONG_MIN
#define LONG_MIN (-LONG_MAX - 1)
#endif
#ifndef ULONG_MAX
#define ULONG_MAX (~0UL)
#endif
/* bsd */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
/* sysv */
typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef __u8 uint8_t;
typedef __u8 u_int8_t;
typedef __s8 int8_t;
typedef __u16 uint16_t;
typedef __u16 u_int16_t;
typedef __s16 int16_t;
typedef __u32 uint32_t;
typedef __u32 u_int32_t;
typedef __s32 int32_t;
typedef __u64 uint64_t;
typedef __u64 u_int64_t;
typedef __s64 int64_t;
struct domain;
struct vcpu;
// Make sure we don't also include conflicting kernel type names
#define _LINUX_TYPES_H
#endif /* __TYPES_H__ */