lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 Aug 2013 20:30:23 +0800
From:	Xiaolong Ye <yexl@...vell.com>
To:	<hjk@...sjkoch.de>, <greg@...ah.com>,
	<linux-kernel@...r.kernel.org>
CC:	Xiaolong Ye <yexl@...vell.com>
Subject: [PATCH] uio: add uio_event_sync interface

This interface is called to sync listener->event_count and device
event count in multi-instances case.

Change-Id: Ibb1e4888ce55b4993394b61e4bcd6dce8b8291f0
Signed-off-by: Xiaolong Ye <yexl@...vell.com>
---
 drivers/uio/uio.c          |   12 ++++++++++++
 include/linux/uio_driver.h |    1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index ba47563..95d559f 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -408,6 +408,18 @@ void uio_event_notify(struct uio_info *info)
 EXPORT_SYMBOL_GPL(uio_event_notify);
 
 /**
+ * uio_event_sync - sync listener's event count with UIO device
+ * @listener: uio_listener structure
+ */
+void uio_event_sync(struct uio_listener *listener)
+{
+	struct uio_device *idev = listener->dev;
+
+	listener->event_count = atomic_read(&idev->event);
+}
+EXPORT_SYMBOL_GPL(uio_event_sync);
+
+/**
  * uio_interrupt - hardware interrupt handler
  * @irq: IRQ number, can be UIO_IRQ_CYCLIC for cyclic timer
  * @dev_id: Pointer to the devices uio_device structure
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 1ad4724..d10e634 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -108,6 +108,7 @@ extern int __must_check
 
 extern void uio_unregister_device(struct uio_info *info);
 extern void uio_event_notify(struct uio_info *info);
+extern void uio_event_sync(struct uio_listener *listener);
 
 /* defines for uio_info->irq */
 #define UIO_IRQ_CUSTOM	-1
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ