blob: bda1ad6f770c5ea55f77852b7cb634cb80837ca7 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris38062f92014-07-09 15:33:25 -07007#ifndef __LINUX_PUBLIC_GNTDEV_H__
8#define __LINUX_PUBLIC_GNTDEV_H__
Christopher Ferris05d08e92016-02-04 13:16:38 -08009#include <linux/types.h>
Christopher Ferris38062f92014-07-09 15:33:25 -070010struct ioctl_gntdev_grant_ref {
Christopher Ferris05d08e92016-02-04 13:16:38 -080011 __u32 domid;
12 __u32 ref;
Christopher Ferris38062f92014-07-09 15:33:25 -070013};
Tao Baod7db5942015-01-28 10:07:51 -080014#define IOCTL_GNTDEV_MAP_GRANT_REF _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
Christopher Ferris38062f92014-07-09 15:33:25 -070015struct ioctl_gntdev_map_grant_ref {
Christopher Ferris05d08e92016-02-04 13:16:38 -080016 __u32 count;
17 __u32 pad;
18 __u64 index;
Tao Baod7db5942015-01-28 10:07:51 -080019 struct ioctl_gntdev_grant_ref refs[1];
Christopher Ferris38062f92014-07-09 15:33:25 -070020};
Tao Baod7db5942015-01-28 10:07:51 -080021#define IOCTL_GNTDEV_UNMAP_GRANT_REF _IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))
Christopher Ferris38062f92014-07-09 15:33:25 -070022struct ioctl_gntdev_unmap_grant_ref {
Christopher Ferris05d08e92016-02-04 13:16:38 -080023 __u64 index;
24 __u32 count;
25 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -070026};
Tao Baod7db5942015-01-28 10:07:51 -080027#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR _IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
Christopher Ferris38062f92014-07-09 15:33:25 -070028struct ioctl_gntdev_get_offset_for_vaddr {
Christopher Ferris05d08e92016-02-04 13:16:38 -080029 __u64 vaddr;
30 __u64 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080031 __u32 count;
32 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -070033};
Tao Baod7db5942015-01-28 10:07:51 -080034#define IOCTL_GNTDEV_SET_MAX_GRANTS _IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants))
Christopher Ferris05d08e92016-02-04 13:16:38 -080035struct ioctl_gntdev_set_max_grants {
36 __u32 count;
Christopher Ferris38062f92014-07-09 15:33:25 -070037};
Tao Baod7db5942015-01-28 10:07:51 -080038#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
Christopher Ferris38062f92014-07-09 15:33:25 -070039struct ioctl_gntdev_unmap_notify {
Christopher Ferris05d08e92016-02-04 13:16:38 -080040 __u64 index;
41 __u32 action;
42 __u32 event_channel_port;
Christopher Ferris38062f92014-07-09 15:33:25 -070043};
Christopher Ferris106b3a82016-08-24 12:15:38 -070044struct gntdev_grant_copy_segment {
45 union {
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070046 void * virt;
Christopher Ferris106b3a82016-08-24 12:15:38 -070047 struct {
48 grant_ref_t ref;
49 __u16 offset;
50 domid_t domid;
Christopher Ferris106b3a82016-08-24 12:15:38 -070051 } foreign;
52 } source, dest;
53 __u16 len;
54 __u16 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -070055 __s16 status;
56};
57#define IOCTL_GNTDEV_GRANT_COPY _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
58struct ioctl_gntdev_grant_copy {
Christopher Ferris106b3a82016-08-24 12:15:38 -070059 unsigned int count;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070060 struct gntdev_grant_copy_segment * segments;
Christopher Ferris106b3a82016-08-24 12:15:38 -070061};
Christopher Ferris38062f92014-07-09 15:33:25 -070062#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
63#define UNMAP_NOTIFY_SEND_EVENT 0x2
Christopher Ferris9ce28842018-10-25 12:11:39 -070064#define GNTDEV_DMA_FLAG_WC (1 << 0)
65#define GNTDEV_DMA_FLAG_COHERENT (1 << 1)
66#define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS _IOC(_IOC_NONE, 'G', 9, sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs))
67struct ioctl_gntdev_dmabuf_exp_from_refs {
68 __u32 flags;
69 __u32 count;
70 __u32 fd;
71 __u32 domid;
72 __u32 refs[1];
73};
74#define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED _IOC(_IOC_NONE, 'G', 10, sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released))
75struct ioctl_gntdev_dmabuf_exp_wait_released {
76 __u32 fd;
77 __u32 wait_to_ms;
78};
79#define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS _IOC(_IOC_NONE, 'G', 11, sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs))
80struct ioctl_gntdev_dmabuf_imp_to_refs {
81 __u32 fd;
82 __u32 count;
83 __u32 domid;
84 __u32 reserved;
85 __u32 refs[1];
86};
87#define IOCTL_GNTDEV_DMABUF_IMP_RELEASE _IOC(_IOC_NONE, 'G', 12, sizeof(struct ioctl_gntdev_dmabuf_imp_release))
88struct ioctl_gntdev_dmabuf_imp_release {
89 __u32 fd;
90 __u32 reserved;
91};
Christopher Ferris38062f92014-07-09 15:33:25 -070092#endif