Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/linux Add down_read_trylock an...
details: https://anonhg.NetBSD.org/src/rev/1f0d518febdf
branches: trunk
changeset: 992782:1f0d518febdf
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 07:47:01 2018 +0000
description:
Add down_read_trylock and downgrade_write.
diffstat:
sys/external/bsd/drm2/include/linux/rwsem.h | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diffs (35 lines):
diff -r 57cb6a2f011a -r 1f0d518febdf sys/external/bsd/drm2/include/linux/rwsem.h
--- a/sys/external/bsd/drm2/include/linux/rwsem.h Mon Aug 27 07:46:48 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/rwsem.h Mon Aug 27 07:47:01 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rwsem.h,v 1.1 2014/07/16 20:59:58 riastradh Exp $ */
+/* $NetBSD: rwsem.h,v 1.2 2018/08/27 07:47:01 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -70,6 +70,13 @@
rw_enter(&rwsem->rws_lock, RW_READER);
}
+static inline bool
+down_read_trylock(struct rw_semaphore *rwsem)
+{
+
+ return rw_tryenter(&rwsem->rws_lock, RW_READER);
+}
+
static inline void
down_write(struct rw_semaphore *rwsem)
{
@@ -91,4 +98,11 @@
rw_exit(&rwsem->rws_lock);
}
+static inline void
+downgrade_write(struct rw_semaphore *rwsem)
+{
+
+ rw_downgrade(&rwsem->rws_lock);
+}
+
#endif /* _LINUX_RWSEM_H_ */
Home |
Main Index |
Thread Index |
Old Index