iov_iter: Kill ITER_PIPE
[linux-block.git] / include / uapi / linux / sync_file.h
CommitLineData
e2be04c7 1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
64907b94
CC
2/*
3 * Copyright (C) 2012 Google, Inc.
4 *
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.
9 *
10 */
11
12#ifndef _UAPI_LINUX_SYNC_H
13#define _UAPI_LINUX_SYNC_H
14
15#include <linux/ioctl.h>
16#include <linux/types.h>
17
18/**
d71c11cc 19 * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences
64907b94 20 * @name: name of new fence
2d75c88f 21 * @fd2: file descriptor of second fence
64907b94 22 * @fence: returns the fd of the new fence to userspace
2d75c88f
GP
23 * @flags: merge_data flags
24 * @pad: padding for 64-bit alignment, should always be zero
d71c11cc
RC
25 *
26 * Creates a new fence containing copies of the sync_pts in both
27 * the calling fd and sync_merge_data.fd2. Returns the new fence's
28 * fd in sync_merge_data.fence
64907b94
CC
29 */
30struct sync_merge_data {
a64d6a68
GP
31 char name[32];
32 __s32 fd2;
33 __s32 fence;
2d75c88f
GP
34 __u32 flags;
35 __u32 pad;
64907b94
CC
36};
37
38/**
e1786348 39 * struct sync_fence_info - detailed fence information
64907b94 40 * @obj_name: name of parent sync_timeline
d71c11cc
RC
41 * @driver_name: name of driver implementing the parent
42 * @status: status of the fence 0:active 1:signaled <0:error
2d75c88f 43 * @flags: fence_info flags
64907b94 44 * @timestamp_ns: timestamp of status change in nanoseconds
64907b94 45 */
e1786348 46struct sync_fence_info {
64907b94
CC
47 char obj_name[32];
48 char driver_name[32];
49 __s32 status;
2d75c88f 50 __u32 flags;
64907b94 51 __u64 timestamp_ns;
64907b94
CC
52};
53
54/**
d71c11cc 55 * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file
64907b94
CC
56 * @name: name of fence
57 * @status: status of fence. 1: signaled 0:active <0:error
2d75c88f
GP
58 * @flags: sync_file_info flags
59 * @num_fences number of fences in the sync_file
60 * @pad: padding for 64-bit alignment, should always be zero
d71c11cc 61 * @sync_fence_info: pointer to array of struct &sync_fence_info with all
2d75c88f 62 * fences in the sync_file
d71c11cc
RC
63 *
64 * Takes a struct sync_file_info. If num_fences is 0, the field is updated
65 * with the actual number of fences. If num_fences is > 0, the system will
66 * use the pointer provided on sync_fence_info to return up to num_fences of
67 * struct sync_fence_info, with detailed fence information.
64907b94 68 */
b5b24ac5 69struct sync_file_info {
64907b94
CC
70 char name[32];
71 __s32 status;
2d75c88f
GP
72 __u32 flags;
73 __u32 num_fences;
74 __u32 pad;
64907b94 75
2d75c88f 76 __u64 sync_fence_info;
64907b94
CC
77};
78
79#define SYNC_IOC_MAGIC '>'
80
d71c11cc 81/*
2d75c88f
GP
82 * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the
83 * old API to get weird errors when trying to handling sync_files. The API
84 * change happened during the de-stage of the Sync Framework when there was
85 * no upstream users available.
86 */
87
2d75c88f 88#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
2d75c88f 89#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
64907b94
CC
90
91#endif /* _UAPI_LINUX_SYNC_H */