blob: 3e85e104903cd66cdf26c63c4d9c48ac65ab7dcf [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
Christopher Ferris05d08e92016-02-04 13:16:38 -080021#include <stdint.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080024#include <linux/virtio_types.h>
25#define VRING_DESC_F_NEXT 1
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define VRING_DESC_F_WRITE 2
27#define VRING_DESC_F_INDIRECT 4
Christopher Ferris05d08e92016-02-04 13:16:38 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define VRING_USED_F_NO_NOTIFY 1
30#define VRING_AVAIL_F_NO_INTERRUPT 1
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define VIRTIO_RING_F_INDIRECT_DESC 28
32#define VIRTIO_RING_F_EVENT_IDX 29
Christopher Ferris05d08e92016-02-04 13:16:38 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070034struct vring_desc {
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 __virtio64 addr;
36 __virtio32 len;
37 __virtio16 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080039 __virtio16 next;
Ben Cheng655a7c02013-10-16 16:09:24 -070040};
Ben Cheng655a7c02013-10-16 16:09:24 -070041struct vring_avail {
Christopher Ferris05d08e92016-02-04 13:16:38 -080042 __virtio16 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080044 __virtio16 idx;
45 __virtio16 ring[];
Ben Cheng655a7c02013-10-16 16:09:24 -070046};
47struct vring_used_elem {
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080049 __virtio32 id;
50 __virtio32 len;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52struct vring_used {
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080054 __virtio16 flags;
55 __virtio16 idx;
Tao Baod7db5942015-01-28 10:07:51 -080056 struct vring_used_elem ring[];
Ben Cheng655a7c02013-10-16 16:09:24 -070057};
Christopher Ferris05d08e92016-02-04 13:16:38 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct vring {
Tao Baod7db5942015-01-28 10:07:51 -080060 unsigned int num;
Tao Baod7db5942015-01-28 10:07:51 -080061 struct vring_desc * desc;
62 struct vring_avail * avail;
Christopher Ferris05d08e92016-02-04 13:16:38 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 struct vring_used * used;
Ben Cheng655a7c02013-10-16 16:09:24 -070065};
Christopher Ferris05d08e92016-02-04 13:16:38 -080066#define VRING_AVAIL_ALIGN_SIZE 2
67#define VRING_USED_ALIGN_SIZE 4
Ben Cheng655a7c02013-10-16 16:09:24 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080069#define VRING_DESC_ALIGN_SIZE 16
Ben Cheng655a7c02013-10-16 16:09:24 -070070#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
Christopher Ferris05d08e92016-02-04 13:16:38 -080071#define vring_avail_event(vr) (* (__virtio16 *) & (vr)->used->ring[(vr)->num])
Ben Cheng655a7c02013-10-16 16:09:24 -070072#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */