diff options
Diffstat (limited to 'debian/patches/0003-fu-nwe-flavr.patch')
-rw-r--r-- | debian/patches/0003-fu-nwe-flavr.patch | 384 |
1 files changed, 384 insertions, 0 deletions
diff --git a/debian/patches/0003-fu-nwe-flavr.patch b/debian/patches/0003-fu-nwe-flavr.patch new file mode 100644 index 0000000..26b9aa1 --- /dev/null +++ b/debian/patches/0003-fu-nwe-flavr.patch @@ -0,0 +1,384 @@ +From f35af2f0f109ea6fc732cf30b81fd96098557666 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Mon, 8 Dec 2014 22:30:09 +0100 +Subject: [PATCH gnumach 3/3] fu nwe flavr + +--- + ipc/ipc_kmsg.c | 8 ++++++-- + ipc/ipc_notify.c | 29 +++++++++++++++-------------- + ipc/ipc_notify.h | 2 +- + ipc/ipc_object.c | 2 +- + ipc/ipc_port.c | 17 +++++++++++------ + ipc/ipc_right.c | 20 +++++++++++++++----- + ipc/mach_msg.c | 5 ++++- + kern/exception.c | 4 +++- + 8 files changed, 56 insertions(+), 31 deletions(-) + +diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c +index 71a0d74..46406b0 100644 +--- a/ipc/ipc_kmsg.c ++++ b/ipc/ipc_kmsg.c +@@ -1789,13 +1789,15 @@ ipc_kmsg_copyout_header( + + if ((--dest->ip_srights == 0) && + ((nsrequest = dest->ip_nsrequest) != IP_NULL)) { ++ mach_port_t name; + mach_port_mscount_t mscount; + + dest->ip_nsrequest = IP_NULL; ++ name = dest->ip_receiver_name; + mscount = dest->ip_mscount; + ip_unlock(dest); + +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, name, mscount); + } else + ip_unlock(dest); + +@@ -1895,13 +1897,15 @@ ipc_kmsg_copyout_header( + + if ((--dest->ip_srights == 0) && + ((nsrequest = dest->ip_nsrequest) != IP_NULL)) { ++ mach_port_t name; + mach_port_mscount_t mscount; + + dest->ip_nsrequest = IP_NULL; ++ name = dest->ip_receiver_name; + mscount = dest->ip_mscount; + ip_unlock(dest); + +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, name, mscount); + } else + ip_unlock(dest); + +diff --git a/ipc/ipc_notify.c b/ipc/ipc_notify.c +index 9465a39..df2cc13 100644 +--- a/ipc/ipc_notify.c ++++ b/ipc/ipc_notify.c +@@ -410,11 +410,6 @@ ipc_notify_no_senders( + ipc_kmsg_t kmsg; + mach_no_senders_notification_t *n; + +- if (NSREQUEST_HAS_FLAG (port, NSREQUEST_FLAG_NO_SENDERS2)) { +- ipc_notify_no_senders2 (NSREQUEST_IPC_PORT (port), mscount); +- return; +- } +- + kmsg = ikm_alloc(sizeof *n); + if (kmsg == IKM_NULL) { + printf("dropped no-senders (0x%p, %u)\n", port, mscount); +@@ -442,29 +437,35 @@ ipc_notify_no_senders( + */ + + void +-ipc_notify_no_senders2( +- ipc_port_t port, +- mach_port_mscount_t mscount) ++ipc_notify_no_senders2 (ipc_port_t port, ++ mach_port_t name, ++ mach_port_mscount_t mscount) + { + ipc_kmsg_t kmsg; + mach_no_senders_notification2_t *n; + +- kmsg = ikm_alloc(sizeof *n); ++ if (! NSREQUEST_HAS_FLAG (port, NSREQUEST_FLAG_NO_SENDERS2)) { ++ ipc_notify_no_senders (NSREQUEST_IPC_PORT (port), mscount); ++ return; ++ } ++ port = NSREQUEST_IPC_PORT (port); ++ ++ kmsg = ikm_alloc (sizeof *n); + if (kmsg == IKM_NULL) { +- printf("dropped no-senders (0x%p, %u)\n", port, mscount); +- ipc_port_release_sonce(port); ++ printf ("dropped no-senders2 (0x%p, %u)\n", port, mscount); ++ ipc_port_release_sonce (port); + return; + } + +- ikm_init(kmsg, sizeof *n); ++ ikm_init (kmsg, sizeof *n); + n = (mach_no_senders_notification2_t *) &kmsg->ikm_header; + *n = ipc_notify_no_senders2_template; + + n->not_header.msgh_remote_port = (mach_port_t) port; + n->not_count = mscount; +- n->not_port = port->ip_receiver_name; // XXX Duh ++ n->not_port = name; + +- ipc_mqueue_send_always(kmsg); ++ ipc_mqueue_send_always (kmsg); + } + + /* +diff --git a/ipc/ipc_notify.h b/ipc/ipc_notify.h +index b1fa090..17fc4e1 100644 +--- a/ipc/ipc_notify.h ++++ b/ipc/ipc_notify.h +@@ -50,7 +50,7 @@ extern void + ipc_notify_no_senders(ipc_port_t, mach_port_mscount_t); + + extern void +-ipc_notify_no_senders2 (ipc_port_t, mach_port_mscount_t); ++ipc_notify_no_senders2 (ipc_port_t, mach_port_t, mach_port_mscount_t); + + /* No-senders notifications come in two flavors. We use the least + significant bit to indicate that the new flavor was requested. */ +diff --git a/ipc/ipc_object.c b/ipc/ipc_object.c +index db6ef01..419134d 100644 +--- a/ipc/ipc_object.c ++++ b/ipc/ipc_object.c +@@ -870,7 +870,7 @@ ipc_object_copyout_dest( + ip_unlock(port); + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, name, mscount); + + break; + } +diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c +index 8817c49..3033b9a 100644 +--- a/ipc/ipc_port.c ++++ b/ipc/ipc_port.c +@@ -310,24 +310,27 @@ ipc_port_nsrequest2( + ipc_port_t *previousp) + { + ipc_port_t previous; ++ mach_port_t name; + mach_port_mscount_t mscount; + + assert(ip_active(port)); + + previous = NSREQUEST_IPC_PORT (port->ip_nsrequest); ++ name = port->ip_receiver_name; + mscount = port->ip_mscount; + ++ if (new_style) ++ notify = NSREQUEST_SET_FLAG (notify, ++ NSREQUEST_FLAG_NO_SENDERS2); ++ + if ((port->ip_srights == 0) && + (sync <= mscount) && + (notify != IP_NULL)) { + port->ip_nsrequest = IP_NULL; + ip_unlock(port); +- ipc_notify_no_senders(notify, mscount); ++ ipc_notify_no_senders2 (notify, name, mscount); + } else { +- port->ip_nsrequest = new_style +- ? NSREQUEST_SET_FLAG (notify, +- NSREQUEST_FLAG_NO_SENDERS2) +- : notify; ++ port->ip_nsrequest = notify; + ip_unlock(port); + } + +@@ -1074,6 +1077,7 @@ ipc_port_release_send( + ipc_port_t port) + { + ipc_port_t nsrequest = IP_NULL; ++ mach_port_t name; + mach_port_mscount_t mscount; + + assert(IP_VALID(port)); +@@ -1092,6 +1096,7 @@ ipc_port_release_send( + nsrequest = port->ip_nsrequest; + if (nsrequest != IP_NULL) { + port->ip_nsrequest = IP_NULL; ++ name = port->ip_receiver_name; + mscount = port->ip_mscount; + } + } +@@ -1099,7 +1104,7 @@ ipc_port_release_send( + ip_unlock(port); + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, name, mscount); + } + + /* +diff --git a/ipc/ipc_right.c b/ipc/ipc_right.c +index 503eb1f..b4db2fa 100644 +--- a/ipc/ipc_right.c ++++ b/ipc/ipc_right.c +@@ -483,6 +483,7 @@ ipc_right_clean( + ipc_port_t port = (ipc_port_t) entry->ie_object; + ipc_port_t dnrequest; + ipc_port_t nsrequest = IP_NULL; ++ mach_port_t nsname = MACH_PORT_NULL; + mach_port_mscount_t mscount = 0; /* '=0' to shut up lint */ + + assert(port != IP_NULL); +@@ -502,6 +503,7 @@ ipc_right_clean( + nsrequest = port->ip_nsrequest; + if (nsrequest != IP_NULL) { + port->ip_nsrequest = IP_NULL; ++ nsname = port->ip_receiver_name; + mscount = port->ip_mscount; + } + } +@@ -526,7 +528,7 @@ ipc_right_clean( + } + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, nsname, mscount); + + if (dnrequest != IP_NULL) + ipc_notify_port_deleted(dnrequest, name); +@@ -597,6 +599,7 @@ ipc_right_destroy( + case MACH_PORT_TYPE_SEND_ONCE: { + ipc_port_t port = (ipc_port_t) entry->ie_object; + ipc_port_t nsrequest = IP_NULL; ++ mach_port_t nsname = MACH_PORT_NULL; + mach_port_mscount_t mscount = 0; /* '=0' to shut up lint */ + ipc_port_t dnrequest; + +@@ -640,6 +643,7 @@ ipc_right_destroy( + nsrequest = port->ip_nsrequest; + if (nsrequest != IP_NULL) { + port->ip_nsrequest = IP_NULL; ++ nsname = port->ip_receiver_name; + mscount = port->ip_mscount; + } + } +@@ -664,7 +668,7 @@ ipc_right_destroy( + } + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, nsname, mscount); + + if (dnrequest != IP_NULL) + ipc_notify_port_deleted(dnrequest, name); +@@ -761,6 +765,7 @@ ipc_right_dealloc( + ipc_port_t port; + ipc_port_t dnrequest = IP_NULL; + ipc_port_t nsrequest = IP_NULL; ++ mach_port_t nsname = MACH_PORT_NULL; + mach_port_mscount_t mscount = 0; /* '=0' to shut up lint */ + + assert(IE_BITS_UREFS(bits) > 0); +@@ -782,6 +787,7 @@ ipc_right_dealloc( + nsrequest = port->ip_nsrequest; + if (nsrequest != IP_NULL) { + port->ip_nsrequest = IP_NULL; ++ nsname = port->ip_receiver_name; + mscount = port->ip_mscount; + } + } +@@ -805,7 +811,7 @@ ipc_right_dealloc( + is_write_unlock(space); + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, nsname, mscount); + + if (dnrequest != IP_NULL) + ipc_notify_port_deleted(dnrequest, name); +@@ -815,6 +821,7 @@ ipc_right_dealloc( + case MACH_PORT_TYPE_SEND_RECEIVE: { + ipc_port_t port; + ipc_port_t nsrequest = IP_NULL; ++ mach_port_t nsname = MACH_PORT_NULL; + mach_port_mscount_t mscount = 0; /* '=0' to shut up lint */ + + assert(IE_BITS_UREFS(bits) > 0); +@@ -833,6 +840,7 @@ ipc_right_dealloc( + nsrequest = port->ip_nsrequest; + if (nsrequest != IP_NULL) { + port->ip_nsrequest = IP_NULL; ++ nsname = port->ip_receiver_name; + mscount = port->ip_mscount; + } + } +@@ -846,7 +854,7 @@ ipc_right_dealloc( + is_write_unlock(space); + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, nsname, mscount); + break; + } + +@@ -1086,6 +1094,7 @@ ipc_right_delta( + ipc_port_t port; + ipc_port_t dnrequest = IP_NULL; + ipc_port_t nsrequest = IP_NULL; ++ mach_port_t nsname = MACH_PORT_NULL; + mach_port_mscount_t mscount = 0; /* '=0' to shut up lint */ + + if ((bits & MACH_PORT_TYPE_SEND) == 0) +@@ -1115,6 +1124,7 @@ ipc_right_delta( + nsrequest = port->ip_nsrequest; + if (nsrequest != IP_NULL) { + port->ip_nsrequest = IP_NULL; ++ nsname = port->ip_receiver_name; + mscount = port->ip_mscount; + } + } +@@ -1151,7 +1161,7 @@ ipc_right_delta( + is_write_unlock(space); + + if (nsrequest != IP_NULL) +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, nsname, mscount); + + if (dnrequest != IP_NULL) + ipc_notify_port_deleted(dnrequest, name); +diff --git a/ipc/mach_msg.c b/ipc/mach_msg.c +index 1e122c7..a3bc22c 100644 +--- a/ipc/mach_msg.c ++++ b/ipc/mach_msg.c +@@ -1119,16 +1119,19 @@ mach_msg_trap( + if ((--dest_port->ip_srights == 0) && + (dest_port->ip_nsrequest != IP_NULL)) { + ipc_port_t nsrequest; ++ mach_port_t name; + mach_port_mscount_t mscount; + + /* a rather rare case */ + + nsrequest = dest_port->ip_nsrequest; ++ name = dest_port->ip_receiver_name; + mscount = dest_port->ip_mscount; + dest_port->ip_nsrequest = IP_NULL; + ip_unlock(dest_port); + +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, ++ name, mscount); + } else + ip_unlock(dest_port); + +diff --git a/kern/exception.c b/kern/exception.c +index 7954fba..98ca730 100644 +--- a/kern/exception.c ++++ b/kern/exception.c +@@ -648,16 +648,18 @@ exception_raise( + if ((--dest_port->ip_srights == 0) && + (dest_port->ip_nsrequest != IP_NULL)) { + ipc_port_t nsrequest; ++ mach_port_t name; + mach_port_mscount_t mscount; + + /* a rather rare case */ + + nsrequest = dest_port->ip_nsrequest; ++ name = dest_port->ip_receiver_name; + mscount = dest_port->ip_mscount; + dest_port->ip_nsrequest = IP_NULL; + ip_unlock(dest_port); + +- ipc_notify_no_senders(nsrequest, mscount); ++ ipc_notify_no_senders2 (nsrequest, name, mscount); + } else + ip_unlock(dest_port); + +-- +2.1.3 + |