Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ntsync: Introduce NTSYNC_IOC_EVENT_PULSE.

This corresponds to the NT syscall NtPulseEvent().

This wakes up any waiters as if the event had been set, but does not set the
event, instead resetting it if it had been signalled. Thus, for a manual-reset
event, all waiters are woken, whereas for an auto-reset event, at most one
waiter is woken.

Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241213193511.457338-12-zfigura@codeweavers.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Elizabeth Figura and committed by
Greg Kroah-Hartman
12b29d30 bbb97975

+7 -2
+6 -2
drivers/misc/ntsync.c
··· 534 534 return ret; 535 535 } 536 536 537 - static int ntsync_event_set(struct ntsync_obj *event, void __user *argp) 537 + static int ntsync_event_set(struct ntsync_obj *event, void __user *argp, bool pulse) 538 538 { 539 539 struct ntsync_device *dev = event->dev; 540 540 __u32 prev_state; ··· 550 550 if (all) 551 551 try_wake_all_obj(dev, event); 552 552 try_wake_any_event(event); 553 + if (pulse) 554 + event->u.event.signaled = false; 553 555 554 556 ntsync_unlock_obj(dev, event, all); 555 557 ··· 607 605 case NTSYNC_IOC_MUTEX_KILL: 608 606 return ntsync_mutex_kill(obj, argp); 609 607 case NTSYNC_IOC_EVENT_SET: 610 - return ntsync_event_set(obj, argp); 608 + return ntsync_event_set(obj, argp, false); 611 609 case NTSYNC_IOC_EVENT_RESET: 612 610 return ntsync_event_reset(obj, argp); 611 + case NTSYNC_IOC_EVENT_PULSE: 612 + return ntsync_event_set(obj, argp, true); 613 613 default: 614 614 return -ENOIOCTLCMD; 615 615 }
+1
include/uapi/linux/ntsync.h
··· 50 50 #define NTSYNC_IOC_MUTEX_KILL _IOW ('N', 0x86, __u32) 51 51 #define NTSYNC_IOC_EVENT_SET _IOR ('N', 0x88, __u32) 52 52 #define NTSYNC_IOC_EVENT_RESET _IOR ('N', 0x89, __u32) 53 + #define NTSYNC_IOC_EVENT_PULSE _IOR ('N', 0x8a, __u32) 53 54 54 55 #endif