summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/libports-lockless-refcounting.patch49
1 files changed, 46 insertions, 3 deletions
diff --git a/debian/patches/libports-lockless-refcounting.patch b/debian/patches/libports-lockless-refcounting.patch
index 5b487da0..cacb7a64 100644
--- a/debian/patches/libports-lockless-refcounting.patch
+++ b/debian/patches/libports-lockless-refcounting.patch
@@ -1,4 +1,4 @@
-commit 7f46aeee292d80d89140f15028067891ab8adddd
+commit 7f438fd440c0d636ff352924f0b7ec8ebe9f5ae1
Author: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Sat May 3 01:02:35 2014 +0200
@@ -17,6 +17,7 @@ Date: Sat May 3 01:02:35 2014 +0200
* libports/port-ref.c: Likewise.
* libports/reallocate-from-external.c: Likewise.
* libports/transfer-right.c: Likewise.
+ * utils/rpctrace.c: Likewise.
diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
index 498cf13..38a9f7a 100644
@@ -219,10 +220,10 @@ index 8cccb2a..4dfc59c 100644
pi->port_right = receive;
diff --git a/libports/refcount.h b/libports/refcount.h
new file mode 100644
-index 0000000..9f71a85
+index 0000000..43da5b4
--- /dev/null
+++ b/libports/refcount.h
-@@ -0,0 +1,56 @@
+@@ -0,0 +1,72 @@
+#ifndef _PORTS_REFCOUNT_H_
+#define _PORTS_REFCOUNT_H_
+
@@ -278,6 +279,22 @@ index 0000000..9f71a85
+ __atomic_sub_fetch (ref, op.rc, __ATOMIC_RELAXED);
+}
+
++extern inline uint32_t
++refcount_hard_refs (reference_counts *ref)
++{
++ union _refs result;
++ result.rc = __atomic_load_n (ref, __ATOMIC_RELAXED);
++ return result.refs.hard;
++}
++
++extern inline uint32_t
++refcount_weak_refs (reference_counts *ref)
++{
++ union _refs result;
++ result.rc = __atomic_load_n (ref, __ATOMIC_RELAXED);
++ return result.refs.weak;
++}
++
+#endif /* _PORTS_REFCOUNT_H_ */
diff --git a/libports/transfer-right.c b/libports/transfer-right.c
index 72488a9..f4e0c86 100644
@@ -292,3 +309,29 @@ index 72488a9..f4e0c86 100644
}
}
+diff --git a/utils/rpctrace.c b/utils/rpctrace.c
+index fc913e3..248d4e2 100644
+--- a/utils/rpctrace.c
++++ b/utils/rpctrace.c
+@@ -431,7 +431,8 @@ destroy_receiver_info (struct receiver_info *info)
+ while (send_wrapper)
+ {
+ struct sender_info *next = send_wrapper->next;
+- assert (TRACED_INFO (send_wrapper)->pi.refcnt == 1);
++ assert (refcount_hard_refs (&TRACED_INFO (send_wrapper)->pi.refcounts)
++ == 1);
+ /* Reset the receive_right of the send wrapper in advance to avoid
+ * destroy_receiver_info is called when the port info is destroyed. */
+ send_wrapper->receive_right = NULL;
+@@ -848,7 +849,10 @@ rewrite_right (mach_port_t *right, mach_msg_type_name_t *type,
+ hurd_ihash_locp_remove (&traced_names, receiver_info->locp);
+
+ send_wrapper2 = get_send_wrapper (receiver_info, dest, &rr);
+- assert (TRACED_INFO (send_wrapper2)->pi.refcnt == 1);
++ assert (
++ refcount_hard_refs (&TRACED_INFO (send_wrapper2)->pi.refcounts)
++ == 1);
++
+ name = TRACED_INFO (send_wrapper2)->name;
+ TRACED_INFO (send_wrapper2)->name = NULL;
+ /* send_wrapper2 isn't destroyed normally, so we need to unlink