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 lockdep_pin/unpin_lock



details:   https://anonhg.NetBSD.org/src/rev/676fe9af8166
branches:  trunk
changeset: 1028449:676fe9af8166
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:04:42 2021 +0000

description:
lockdep_pin/unpin_lock

diffstat:

 sys/external/bsd/drm2/include/linux/lockdep.h |  21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 5cda214c5480 -r 676fe9af8166 sys/external/bsd/drm2/include/linux/lockdep.h
--- a/sys/external/bsd/drm2/include/linux/lockdep.h     Sun Dec 19 11:04:36 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/lockdep.h     Sun Dec 19 11:04:42 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lockdep.h,v 1.3 2021/12/19 09:43:26 riastradh Exp $    */
+/*     $NetBSD: lockdep.h,v 1.4 2021/12/19 11:04:42 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,6 +32,9 @@
 #ifndef _LINUX_LOCKDEP_H_
 #define _LINUX_LOCKDEP_H_
 
+struct mutex;
+struct spinlock;
+
 #define        __acquires(lock)        /* XXX lockdep annotation */
 #define        __releases(lock)        /* XXX lockdep annotation */
 
@@ -60,4 +63,20 @@
 
 #define        SINGLE_DEPTH_NESTING    0
 
+struct pin_cookie {
+       int     dummy;
+};
+
+static inline struct pin_cookie
+lockdep_pin_lock(struct mutex *m)
+{
+       return (struct pin_cookie) { (int)(intptr_t)m };
+}
+
+static inline void
+lockdep_unpin_lock(struct mutex *m, struct pin_cookie cookie)
+{
+       KASSERT(cookie.dummy == (int)(intptr_t)m);
+}
+
 #endif /* _LINUX_LOCKDEP_H_ */



Home | Main Index | Thread Index | Old Index