blob: 1e78ac3765b04a040ad884fc6ddd7c5e497bd45d [file] [log] [blame]
Christopher Ferris38062f92014-07-09 15:33:25 -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 __LINUX_PUBLIC_GNTDEV_H__
20#define __LINUX_PUBLIC_GNTDEV_H__
Christopher Ferris05d08e92016-02-04 13:16:38 -080021#include <linux/types.h>
Christopher Ferris38062f92014-07-09 15:33:25 -070022struct ioctl_gntdev_grant_ref {
Christopher Ferris05d08e92016-02-04 13:16:38 -080023 __u32 domid;
24 __u32 ref;
Christopher Ferris38062f92014-07-09 15:33:25 -070025};
Tao Baod7db5942015-01-28 10:07:51 -080026#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 -070027struct ioctl_gntdev_map_grant_ref {
Christopher Ferris05d08e92016-02-04 13:16:38 -080028 __u32 count;
29 __u32 pad;
30 __u64 index;
Tao Baod7db5942015-01-28 10:07:51 -080031 struct ioctl_gntdev_grant_ref refs[1];
Christopher Ferris38062f92014-07-09 15:33:25 -070032};
Tao Baod7db5942015-01-28 10:07:51 -080033#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 -070034struct ioctl_gntdev_unmap_grant_ref {
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 __u64 index;
36 __u32 count;
37 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -070038};
Tao Baod7db5942015-01-28 10:07:51 -080039#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 -070040struct ioctl_gntdev_get_offset_for_vaddr {
Christopher Ferris05d08e92016-02-04 13:16:38 -080041 __u64 vaddr;
42 __u64 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 __u32 count;
44 __u32 pad;
Christopher Ferris38062f92014-07-09 15:33:25 -070045};
Tao Baod7db5942015-01-28 10:07:51 -080046#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 -080047struct ioctl_gntdev_set_max_grants {
48 __u32 count;
Christopher Ferris38062f92014-07-09 15:33:25 -070049};
Tao Baod7db5942015-01-28 10:07:51 -080050#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
Christopher Ferris38062f92014-07-09 15:33:25 -070051struct ioctl_gntdev_unmap_notify {
Christopher Ferris05d08e92016-02-04 13:16:38 -080052 __u64 index;
53 __u32 action;
54 __u32 event_channel_port;
Christopher Ferris38062f92014-07-09 15:33:25 -070055};
Christopher Ferris106b3a82016-08-24 12:15:38 -070056struct gntdev_grant_copy_segment {
57 union {
58 void __user * virt;
Christopher Ferris106b3a82016-08-24 12:15:38 -070059 struct {
60 grant_ref_t ref;
61 __u16 offset;
62 domid_t domid;
Christopher Ferris106b3a82016-08-24 12:15:38 -070063 } foreign;
64 } source, dest;
65 __u16 len;
66 __u16 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -070067 __s16 status;
68};
69#define IOCTL_GNTDEV_GRANT_COPY _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
70struct ioctl_gntdev_grant_copy {
Christopher Ferris106b3a82016-08-24 12:15:38 -070071 unsigned int count;
72 struct gntdev_grant_copy_segment __user * segments;
73};
Christopher Ferris38062f92014-07-09 15:33:25 -070074#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
75#define UNMAP_NOTIFY_SEND_EVENT 0x2
Christopher Ferris9ce28842018-10-25 12:11:39 -070076#define GNTDEV_DMA_FLAG_WC (1 << 0)
77#define GNTDEV_DMA_FLAG_COHERENT (1 << 1)
78#define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS _IOC(_IOC_NONE, 'G', 9, sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs))
79struct ioctl_gntdev_dmabuf_exp_from_refs {
80 __u32 flags;
81 __u32 count;
82 __u32 fd;
83 __u32 domid;
84 __u32 refs[1];
85};
86#define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED _IOC(_IOC_NONE, 'G', 10, sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released))
87struct ioctl_gntdev_dmabuf_exp_wait_released {
88 __u32 fd;
89 __u32 wait_to_ms;
90};
91#define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS _IOC(_IOC_NONE, 'G', 11, sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs))
92struct ioctl_gntdev_dmabuf_imp_to_refs {
93 __u32 fd;
94 __u32 count;
95 __u32 domid;
96 __u32 reserved;
97 __u32 refs[1];
98};
99#define IOCTL_GNTDEV_DMABUF_IMP_RELEASE _IOC(_IOC_NONE, 'G', 12, sizeof(struct ioctl_gntdev_dmabuf_imp_release))
100struct ioctl_gntdev_dmabuf_imp_release {
101 __u32 fd;
102 __u32 reserved;
103};
Christopher Ferris38062f92014-07-09 15:33:25 -0700104#endif