Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 07:34:41 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/include/linux: reservation.h

Log Message:
More <linux/reservation.h> stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
    src/sys/external/bsd/drm2/include/linux/reservation.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/reservation.h
diff -u src/sys/external/bsd/drm2/include/linux/reservation.h:1.3 src/sys/external/bsd/drm2/include/linux/reservation.h:1.4
--- src/sys/external/bsd/drm2/include/linux/reservation.h:1.3	Mon Aug 27 07:32:22 2018
+++ src/sys/external/bsd/drm2/include/linux/reservation.h	Mon Aug 27 07:34:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: reservation.h,v 1.3 2018/08/27 07:32:22 riastradh Exp $	*/
+/*	$NetBSD: reservation.h,v 1.4 2018/08/27 07:34:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,6 +34,7 @@
 
 #include <sys/atomic.h>
 
+#include <linux/rcupdate.h>
 #include <linux/ww_mutex.h>
 
 struct fence;
@@ -41,18 +42,32 @@ struct fence;
 extern struct ww_class	reservation_ww_class;
 
 struct reservation_object {
-	struct ww_mutex	lock;
+	struct ww_mutex		lock;
 
-	struct fence *robj_fence_excl;
+	struct reservation_object_list __rcu	*robj_objlist;
+	struct fence __rcu			*robj_fence_excl;
+};
+
+struct reservation_object_list {
+	uint32_t		shared_count;
+	struct fence __rcu	*shared[];
 };
 
 #define	reservation_object_add_excl_fence	linux_reservation_object_add_excl_fence
 #define	reservation_object_add_shared_fence	linux_reservation_object_add_shared_fence
+#define	reservation_object_reserve_shared	linux_reservation_object_reserve_shared
+#define	reservation_object_test_signaled_rcu	linux_reservation_object_test_signaled_rcu
+#define	reservation_object_wait_timeout_rcu	linux_reservation_object_wait_timeout_rcu
 
 void	reservation_object_add_excl_fence(struct reservation_object *,
 	    struct fence *);
 void	reservation_object_add_shared_fence(struct reservation_object *,
 	    struct fence *);
+int	reservation_object_reserve_shared(struct reservation_object *);
+bool	reservation_object_test_signaled_rcu(struct reservation_object *,
+	    bool);
+long	reservation_object_wait_timeout_rcu(struct reservation_object *,
+	    bool, bool, unsigned long);
 
 static inline void
 reservation_object_init(struct reservation_object *reservation)
@@ -68,15 +83,35 @@ reservation_object_fini(struct reservati
 	ww_mutex_destroy(&reservation->lock);
 }
 
+static inline bool
+reservation_object_held(struct reservation_object *reservation)
+{
+
+	return ww_mutex_is_locked(&reservation->lock);
+}
+
 static inline struct fence *
 reservation_object_get_excl(struct reservation_object *reservation)
 {
 	struct fence *fence;
 
+	KASSERT(reservation_object_held(reservation));
 	fence = reservation->robj_fence_excl;
 	membar_datadep_consumer();
 
 	return fence;
 }
 
+static inline struct reservation_object_list *
+reservation_object_get_list(struct reservation_object *reservation)
+{
+	struct reservation_object_list *objlist;
+
+	KASSERT(reservation_object_held(reservation));
+	objlist = reservation->robj_objlist;
+	membar_datadep_consumer();
+
+	return objlist;
+}
+
 #endif  /* _LINUX_RESERVATION_H_ */

Reply via email to