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 More <linux/reservation....



details:   https://anonhg.NetBSD.org/src/rev/0b76d645cef9
branches:  trunk
changeset: 366015:0b76d645cef9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:34:41 2018 +0000

description:
More <linux/reservation.h> stubs.

diffstat:

 sys/external/bsd/drm2/include/linux/reservation.h |  41 +++++++++++++++++++++-
 1 files changed, 38 insertions(+), 3 deletions(-)

diffs (88 lines):

diff -r 2bc24e4fe91d -r 0b76d645cef9 sys/external/bsd/drm2/include/linux/reservation.h
--- a/sys/external/bsd/drm2/include/linux/reservation.h Mon Aug 27 07:34:32 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/reservation.h Mon Aug 27 07:34:41 2018 +0000
@@ -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 @@
 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 @@
        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_ */



Home | Main Index | Thread Index | Old Index