xref: /linux-6.15/include/uapi/linux/ntsync.h (revision ecc2ee36)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Kernel support for NT synchronization primitive emulation
4  *
5  * Copyright (C) 2021-2022 Elizabeth Figura <[email protected]>
6  */
7 
8 #ifndef __LINUX_NTSYNC_H
9 #define __LINUX_NTSYNC_H
10 
11 #include <linux/types.h>
12 
13 struct ntsync_sem_args {
14 	__u32 count;
15 	__u32 max;
16 };
17 
18 struct ntsync_mutex_args {
19 	__u32 owner;
20 	__u32 count;
21 };
22 
23 #define NTSYNC_WAIT_REALTIME	0x1
24 
25 struct ntsync_wait_args {
26 	__u64 timeout;
27 	__u64 objs;
28 	__u32 count;
29 	__u32 index;
30 	__u32 flags;
31 	__u32 owner;
32 	__u32 pad[2];
33 };
34 
35 #define NTSYNC_MAX_WAIT_COUNT 64
36 
37 #define NTSYNC_IOC_CREATE_SEM		_IOW ('N', 0x80, struct ntsync_sem_args)
38 #define NTSYNC_IOC_WAIT_ANY		_IOWR('N', 0x82, struct ntsync_wait_args)
39 #define NTSYNC_IOC_WAIT_ALL		_IOWR('N', 0x83, struct ntsync_wait_args)
40 #define NTSYNC_IOC_CREATE_MUTEX		_IOW ('N', 0x84, struct ntsync_mutex_args)
41 
42 #define NTSYNC_IOC_SEM_RELEASE		_IOWR('N', 0x81, __u32)
43 #define NTSYNC_IOC_MUTEX_UNLOCK		_IOWR('N', 0x85, struct ntsync_mutex_args)
44 #define NTSYNC_IOC_MUTEX_KILL		_IOW ('N', 0x86, __u32)
45 
46 #endif
47