-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ntsync: Introduce NTSYNC_IOC_CREATE_SEM.
This corresponds to the NT syscall NtCreateSemaphore(). Semaphores are one of three types of object to be implemented in this driver, the others being mutexes and events. An NT semaphore contains a 32-bit counter, and is signaled and can be acquired when the counter is nonzero. The counter has a maximum value which is specified at creation time. The initial value of the semaphore is also specified at creation time. There are no restrictions on the maximum and initial value. Each object is exposed as an file, to which any number of fds may be opened. When all fds are closed, the object is deleted. Objects hold a pointer to the ntsync_device that created them. The device's reference count is driven by struct file. Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Frade <kernel@xanmod.org>
- Loading branch information
Showing
3 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
/* | ||
* Kernel support for NT synchronization primitive emulation | ||
* | ||
* Copyright (C) 2021-2022 Elizabeth Figura <zfigura@codeweavers.com> | ||
*/ | ||
|
||
#ifndef __LINUX_NTSYNC_H | ||
#define __LINUX_NTSYNC_H | ||
|
||
#include <linux/types.h> | ||
|
||
struct ntsync_sem_args { | ||
__u32 sem; | ||
__u32 count; | ||
__u32 max; | ||
}; | ||
|
||
#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args) | ||
|
||
#endif |