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/linux linux: Add clear_and_wake_up_bit.
details: https://anonhg.NetBSD.org/src/rev/ae75abec6fef
branches: trunk
changeset: 1028611:ae75abec6fef
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 11:26:50 2021 +0000
description:
linux: Add clear_and_wake_up_bit.
diffstat:
sys/external/bsd/drm2/include/linux/wait_bit.h | 4 +++-
sys/external/bsd/drm2/linux/linux_wait_bit.c | 15 +++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diffs (61 lines):
diff -r 8f25ec4f3dbe -r ae75abec6fef sys/external/bsd/drm2/include/linux/wait_bit.h
--- a/sys/external/bsd/drm2/include/linux/wait_bit.h Sun Dec 19 11:26:42 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/wait_bit.h Sun Dec 19 11:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wait_bit.h,v 1.2 2021/12/19 01:42:01 riastradh Exp $ */
+/* $NetBSD: wait_bit.h,v 1.3 2021/12/19 11:26:50 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
#ifndef _LINUX_WAIT_BIT_H_
#define _LINUX_WAIT_BIT_H_
+#define clear_and_wake_up_bit linux_clear_and_wake_up_bit
#define wait_on_bit linux_wait_on_bit
#define wait_on_bit_timeout linux_wait_on_bit_timeout
#define wake_up_bit linux_wake_up_bit
@@ -40,6 +41,7 @@
void linux_wait_bit_fini(void);
void wake_up_bit(const volatile unsigned long *, unsigned);
+void clear_and_wake_up_bit(int, volatile unsigned long *);
int wait_on_bit(const volatile unsigned long *, unsigned, int);
int wait_on_bit_timeout(const volatile unsigned long *, unsigned, int,
unsigned long);
diff -r 8f25ec4f3dbe -r ae75abec6fef sys/external/bsd/drm2/linux/linux_wait_bit.c
--- a/sys/external/bsd/drm2/linux/linux_wait_bit.c Sun Dec 19 11:26:42 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_wait_bit.c Sun Dec 19 11:26:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_wait_bit.c,v 1.3 2021/12/19 01:42:02 riastradh Exp $ */
+/* $NetBSD: linux_wait_bit.c,v 1.4 2021/12/19 11:26:50 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_wait_bit.c,v 1.3 2021/12/19 01:42:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_wait_bit.c,v 1.4 2021/12/19 11:26:50 riastradh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -114,6 +114,17 @@
wait_bit_exit(wbe);
}
+void
+clear_and_wake_up_bit(int bit, volatile unsigned long *bitmap)
+{
+ struct waitbitentry *wbe;
+
+ wbe = wait_bit_enter(bitmap, bit);
+ clear_bit(bit, bitmap);
+ cv_broadcast(&wbe->cv);
+ wait_bit_exit(wbe);
+}
+
int
wait_on_bit(const volatile unsigned long *bitmap, unsigned bit, int flags)
{
Home |
Main Index |
Thread Index |
Old Index