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 Linux clear_bit_unlock
details: https://anonhg.NetBSD.org/src/rev/7bade696c64e
branches: trunk
changeset: 1028433:7bade696c64e
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 11:02:38 2021 +0000
description:
Linux clear_bit_unlock
diffstat:
sys/external/bsd/drm2/include/linux/atomic.h | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r 308dbf7873fd -r 7bade696c64e sys/external/bsd/drm2/include/linux/atomic.h
--- a/sys/external/bsd/drm2/include/linux/atomic.h Sun Dec 19 11:02:30 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/atomic.h Sun Dec 19 11:02:38 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic.h,v 1.31 2021/12/19 11:01:44 riastradh Exp $ */
+/* $NetBSD: atomic.h,v 1.32 2021/12/19 11:02:38 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -475,6 +475,16 @@
}
static inline void
+clear_bit_unlock(unsigned int bit, volatile unsigned long *ptr)
+{
+ const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
+
+ /* store-release */
+ smp_mb__before_atomic();
+ atomic_and_ulong(&ptr[bit / units], ~(1UL << (bit % units)));
+}
+
+static inline void
change_bit(unsigned int bit, volatile unsigned long *ptr)
{
const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
Home |
Main Index |
Thread Index |
Old Index