vhost: convert vhost device driver to a plugin
[vpp.git] / src / plugins / vhost / vhost_std.h
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef __VHOST_STD_H__
16 #define __VHOST_STD_H__
17
18 typedef struct
19 {
20   u64 guest_phys_addr;
21   u64 memory_size;
22   u64 userspace_addr;
23   u64 mmap_offset;
24 } vhost_memory_region_t;
25
26 typedef struct
27 {
28   u32 nregions;
29   u32 padding;
30   vhost_memory_region_t regions[0];
31 } vhost_memory_t;
32
33 typedef struct
34 {
35   u32 index;
36   u32 num;
37 } vhost_vring_state_t;
38
39 typedef struct
40 {
41   u32 index;
42   int fd;
43 } vhost_vring_file_t;
44
45 typedef struct
46 {
47   u32 index;
48   u32 flags;
49   u64 desc_user_addr;
50   u64 used_user_addr;
51   u64 avail_user_addr;
52   u64 log_guest_addr;
53 } vhost_vring_addr_t;
54
55 typedef struct
56 {
57   u64 size;
58   u64 offset;
59 } vhost_user_log_t;
60
61 #endif
62
63 /*
64  * fd.io coding-style-patch-verification: ON
65  *
66  * Local Variables:
67  * eval: (c-set-style "gnu")
68  * End:
69  */