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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
#ifndef HABMM_H
#define HABMM_H
#include <linux/types.h>
struct hab_send {
__u64 data;
__s32 vcid;
__u32 sizebytes;
__u32 flags;
};
struct hab_recv {
__u64 data;
__s32 vcid;
__u32 sizebytes;
__u32 flags;
};
struct hab_open {
__s32 vcid;
__u32 mmid;
__u32 timeout;
__u32 flags;
};
struct hab_close {
__s32 vcid;
__u32 flags;
};
struct hab_export {
__u64 buffer;
__s32 vcid;
__u32 sizebytes;
__u32 exportid;
__u32 flags;
};
struct hab_import {
__u64 index;
__u64 kva;
__s32 vcid;
__u32 sizebytes;
__u32 exportid;
__u32 flags;
};
struct hab_unexport {
__s32 vcid;
__u32 exportid;
__u32 flags;
};
struct hab_unimport {
__s32 vcid;
__u32 exportid;
__u64 kva;
__u32 flags;
};
struct hab_info {
__s32 vcid;
__u64 ids; /* high part remote; low part local */
__u64 names;
__u32 namesize; /* single name length */
__u32 flags;
};
#define HAB_IOC_TYPE 0x0A
#define HAB_MAX_MSG_SIZEBYTES 0x1000
#define HAB_MAX_EXPORT_SIZE 0x8000000
#define HAB_MMID_CREATE(major, minor) ((major&0xFFFF) | ((minor&0xFF)<<16))
#define MM_AUD_START 100
#define MM_AUD_1 101
#define MM_AUD_2 102
#define MM_AUD_3 103
#define MM_AUD_4 104
#define MM_AUD_END 105
#define MM_CAM_START 200
#define MM_CAM_1 201
#define MM_CAM_2 202
#define MM_CAM_END 203
#define MM_DISP_START 300
#define MM_DISP_1 301
#define MM_DISP_2 302
#define MM_DISP_3 303
#define MM_DISP_4 304
#define MM_DISP_5 305
#define MM_DISP_END 306
#define MM_GFX_START 400
#define MM_GFX 401
#define MM_GFX_END 402
#define MM_VID_START 500
#define MM_VID 501
#define MM_VID_END 502
#define MM_MISC_START 600
#define MM_MISC 601
#define MM_MISC_END 602
#define MM_QCPE_START 700
#define MM_QCPE_VM1 701
#define MM_QCPE_VM2 702
#define MM_QCPE_VM3 703
#define MM_QCPE_VM4 704
#define MM_QCPE_END 705
#define MM_CLK_START 800
#define MM_CLK_VM1 801
#define MM_CLK_VM2 802
#define MM_CLK_END 803
#define MM_FDE_START 900
#define MM_FDE_1 901
#define MM_FDE_END 902
#define MM_BUFFERQ_START 1000
#define MM_BUFFERQ_1 1001
#define MM_BUFFERQ_END 1002
#define MM_ID_MAX 1003
#define HABMM_SOCKET_OPEN_FLAGS_SINGLE_BE_SINGLE_FE 0x00000000
#define HABMM_SOCKET_OPEN_FLAGS_SINGLE_BE_SINGLE_DOMU 0x00000001
#define HABMM_SOCKET_OPEN_FLAGS_SINGLE_BE_MULTI_DOMUS 0x00000002
#define HABMM_SOCKET_SEND_FLAGS_NON_BLOCKING 0x00000001
/*
* Collect cross-VM stats: client provides stat-buffer large enough to allow 2
* ets of a 2-uint64_t pair to collect seconds and nano-seconds at the
* beginning of the stat-buffer. Stats are collected when the stat-buffer leaves
* VM1, then enters VM2
*/
#define HABMM_SOCKET_SEND_FLAGS_XING_VM_STAT 0x00000002
#define HABMM_SOCKET_RECV_FLAGS_NON_BLOCKING 0x00000001
#define HABMM_EXP_MEM_TYPE_DMA 0x00000001
#define HABMM_IMPORT_FLAGS_CACHED 0x00000001
#define IOCTL_HAB_SEND \
_IOW(HAB_IOC_TYPE, 0x2, struct hab_send)
#define IOCTL_HAB_RECV \
_IOWR(HAB_IOC_TYPE, 0x3, struct hab_recv)
#define IOCTL_HAB_VC_OPEN \
_IOWR(HAB_IOC_TYPE, 0x4, struct hab_open)
#define IOCTL_HAB_VC_CLOSE \
_IOW(HAB_IOC_TYPE, 0x5, struct hab_close)
#define IOCTL_HAB_VC_EXPORT \
_IOWR(HAB_IOC_TYPE, 0x6, struct hab_export)
#define IOCTL_HAB_VC_IMPORT \
_IOWR(HAB_IOC_TYPE, 0x7, struct hab_import)
#define IOCTL_HAB_VC_UNEXPORT \
_IOW(HAB_IOC_TYPE, 0x8, struct hab_unexport)
#define IOCTL_HAB_VC_UNIMPORT \
_IOW(HAB_IOC_TYPE, 0x9, struct hab_unimport)
#define IOCTL_HAB_VC_QUERY \
_IOWR(HAB_IOC_TYPE, 0xA, struct hab_info)
#endif /* HABMM_H */
|