blob: a17187408e80c61aa11dfe2fda78453014ab9b0b [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_VIRTIO_RING_H
20#define _UAPI_LINUX_VIRTIO_RING_H
21#include <linux/types.h>
22#define VRING_DESC_F_NEXT 1
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define VRING_DESC_F_WRITE 2
25#define VRING_DESC_F_INDIRECT 4
26#define VRING_USED_F_NO_NOTIFY 1
27#define VRING_AVAIL_F_NO_INTERRUPT 1
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define VIRTIO_RING_F_INDIRECT_DESC 28
30#define VIRTIO_RING_F_EVENT_IDX 29
31struct vring_desc {
Tao Baod7db5942015-01-28 10:07:51 -080032 __u64 addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034 __u32 len;
35 __u16 flags;
36 __u16 next;
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39struct vring_avail {
Tao Baod7db5942015-01-28 10:07:51 -080040 __u16 flags;
41 __u16 idx;
42 __u16 ring[];
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44};
45struct vring_used_elem {
Tao Baod7db5942015-01-28 10:07:51 -080046 __u32 id;
47 __u32 len;
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49};
50struct vring_used {
Tao Baod7db5942015-01-28 10:07:51 -080051 __u16 flags;
52 __u16 idx;
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 struct vring_used_elem ring[];
Ben Cheng655a7c02013-10-16 16:09:24 -070055};
56struct vring {
Tao Baod7db5942015-01-28 10:07:51 -080057 unsigned int num;
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 struct vring_desc * desc;
60 struct vring_avail * avail;
61 struct vring_used * used;
Ben Cheng655a7c02013-10-16 16:09:24 -070062};
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
Tao Baod7db5942015-01-28 10:07:51 -080065#define vring_avail_event(vr) (* (__u16 *) & (vr)->used->ring[(vr)->num])
Ben Cheng655a7c02013-10-16 16:09:24 -070066#endif