diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/patches/0001-Retire-procedure-old_mach_port_get_receive_status.patch | 125 | ||||
-rw-r--r-- | debian/patches/0002-XXX-Add-a-new-flavor-of-no-senders-notifications.patch | 371 | ||||
-rw-r--r-- | debian/patches/0003-fu-nwe-flavr.patch | 384 | ||||
-rw-r--r-- | debian/patches/series | 3 |
4 files changed, 883 insertions, 0 deletions
diff --git a/debian/patches/0001-Retire-procedure-old_mach_port_get_receive_status.patch b/debian/patches/0001-Retire-procedure-old_mach_port_get_receive_status.patch new file mode 100644 index 0000000..9b4e0e3 --- /dev/null +++ b/debian/patches/0001-Retire-procedure-old_mach_port_get_receive_status.patch @@ -0,0 +1,125 @@ +From b40ed413bde50db1805c949850425e7356e86272 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Sat, 6 Dec 2014 11:59:32 +0100 +Subject: [PATCH gnumach 1/3] Retire procedure + `old_mach_port_get_receive_status' + +Retire the compatibility RPC `old_mach_port_get_receive_status' that +works like `mach_port_get_receive_status' but returns an +`old_mach_port_status' object that lacks the `mps_seqno' field. + +Do not remove the type yet, so we do not break anyones build. The RPC +stubs currently distributed with the glibc require it. + +* include/mach/mach_port.defs (old_mach_port_get_receive_status): Drop RPC. +* include/mach/mach_types.defs (old_mach_port_status_t): Drop type. +* include/mach/port.h (old_mach_port_status_t): Add note to remove +this for the 1.6 release. +* ipc/mach_port.c (old_mach_port_get_receive_status): Drop function. +--- + include/mach/mach_port.defs | 9 +-------- + include/mach/mach_types.defs | 2 -- + include/mach/port.h | 2 ++ + ipc/mach_port.c | 40 ---------------------------------------- + 4 files changed, 3 insertions(+), 50 deletions(-) + +diff --git a/include/mach/mach_port.defs b/include/mach/mach_port.defs +index c7e8526..c21c34b 100644 +--- a/include/mach/mach_port.defs ++++ b/include/mach/mach_port.defs +@@ -176,14 +176,7 @@ routine mach_port_mod_refs( + right : mach_port_right_t; + delta : mach_port_delta_t); + +-/* +- * Temporary compatibility call. +- */ +- +-routine old_mach_port_get_receive_status( +- task : ipc_space_t; +- name : mach_port_name_t; +- out status : old_mach_port_status_t); ++skip; /* old old_mach_port_get_receive_status */ + + /* + * Only valid for receive rights. +diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs +index 85ad653..8e68d38 100644 +--- a/include/mach/mach_types.defs ++++ b/include/mach/mach_types.defs +@@ -60,8 +60,6 @@ serverprefix SERVERPREFIX; + + type mach_port_status_t = struct[9] of integer_t; + +-type old_mach_port_status_t = struct[8] of integer_t; /* compatibility */ +- + type task_t = mach_port_t + ctype: mach_port_t + #if KERNEL_SERVER +diff --git a/include/mach/port.h b/include/mach/port.h +index 53f6071..3036a92 100644 +--- a/include/mach/port.h ++++ b/include/mach/port.h +@@ -137,6 +137,8 @@ typedef struct mach_port_status { + /* + * Compatibility definitions, for code written + * before there was an mps_seqno field. ++ * ++ * XXX: Remove this before releasing Gnumach 1.6. + */ + + typedef struct old_mach_port_status { +diff --git a/ipc/mach_port.c b/ipc/mach_port.c +index 4ff39f2..c7d9b81 100644 +--- a/ipc/mach_port.c ++++ b/ipc/mach_port.c +@@ -744,46 +744,6 @@ mach_port_mod_refs( + } + + /* +- * Routine: old_mach_port_get_receive_status [kernel call] +- * Purpose: +- * Compatibility for code written before sequence numbers. +- * Retrieves mucho info about a receive right. +- * Conditions: +- * Nothing locked. +- * Returns: +- * KERN_SUCCESS Retrieved status. +- * KERN_INVALID_TASK The space is null. +- * KERN_INVALID_TASK The space is dead. +- * KERN_INVALID_NAME The name doesn't denote a right. +- * KERN_INVALID_RIGHT Name doesn't denote receive rights. +- */ +- +-kern_return_t +-old_mach_port_get_receive_status( +- ipc_space_t space, +- mach_port_t name, +- old_mach_port_status_t *statusp) +-{ +- mach_port_status_t status; +- kern_return_t kr; +- +- kr = mach_port_get_receive_status(space, name, &status); +- if (kr != KERN_SUCCESS) +- return kr; +- +- statusp->mps_pset = status.mps_pset; +- statusp->mps_mscount = status.mps_mscount; +- statusp->mps_qlimit = status.mps_qlimit; +- statusp->mps_msgcount = status.mps_msgcount; +- statusp->mps_sorights = status.mps_sorights; +- statusp->mps_srights = status.mps_srights; +- statusp->mps_pdrequest = status.mps_pdrequest; +- statusp->mps_nsrequest = status.mps_nsrequest; +- +- return KERN_SUCCESS; +-} +- +-/* + * Routine: mach_port_set_qlimit [kernel call] + * Purpose: + * Changes a receive right's queue limit. +-- +2.1.3 + diff --git a/debian/patches/0002-XXX-Add-a-new-flavor-of-no-senders-notifications.patch b/debian/patches/0002-XXX-Add-a-new-flavor-of-no-senders-notifications.patch new file mode 100644 index 0000000..27e1f85 --- /dev/null +++ b/debian/patches/0002-XXX-Add-a-new-flavor-of-no-senders-notifications.patch @@ -0,0 +1,371 @@ +From 8fbd0943f2076332cbd4a6b34ef57d6a974de847 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Sun, 7 Dec 2014 14:27:23 +0100 +Subject: [PATCH gnumach 2/3] XXX Add a new flavor of no-senders notifications + +The no-senders notifications do not carry a port name. Add a new +flavor of no-senders notifications `MACH_NOTIFY_NO_SENDERS2' that does +carry the name of the port that lost the last sender. + +* include/mach/notify.defs (mach_notify_no_senders2): New simple routine. +* include/mach/notify.h (MACH_NOTIFY_NO_SENDERS2): New macro. +* ipc/ipc_notify.c (ipc_notify_no_senders2_template, +ipc_notify_init_no_senders2, ipc_notify_init): Initialize a template. +(ipc_notify_no_senders): Test whether a new-style notification has +been requested. +(ipc_notify_no_senders2): New function. +* ipc/ipc_notify.h (ipc_notify_no_senders2): New declaration. +(NSREQUEST_FLAG_NO_SENDERS2, NSREQUEST_FLAG_MASK, NSREQUEST_IPC_PORT, +NSREQUEST_HAS_FLAG, NSREQUEST_SET_FLAG): Machinery to store flags in +the least significant bits of the `nsrequest' field. +* ipc/ipc_port.c (ipc_port_nsrequest2): Add `new_style' parameter, +rename from `ipc_port_nsrequest', set flag if `new_style' is given, +and filter it from the returned `previous' port. +(ipc_port_nsrequest): New function. +(ipc_port_destroy): Filter out flags from `ip_nsrequest'. +* ipc/ipc_port.h (struct ipc_port): Document the use of flags. +(ipc_port_nsrequest2): New declaration. +* ipc/mach_port.c (mach_port_request_notification): Handle +MACH_NOTIFY_NO_SENDERS2. +--- + include/mach/notify.defs | 9 ++++++ + include/mach/notify.h | 11 +++++++ + ipc/ipc_notify.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ + ipc/ipc_notify.h | 14 ++++++++ + ipc/ipc_port.c | 36 ++++++++++++++++++--- + ipc/ipc_port.h | 10 +++++- + ipc/mach_port.c | 6 ++-- + 7 files changed, 162 insertions(+), 8 deletions(-) + +diff --git a/include/mach/notify.defs b/include/mach/notify.defs +index 6ba4cde..06802ce 100644 +--- a/include/mach/notify.defs ++++ b/include/mach/notify.defs +@@ -110,3 +110,12 @@ simpleroutine mach_notify_dead_name( + msgseqno seqno : mach_port_seqno_t; + #endif + name : mach_port_name_t); ++ ++/* MACH_NOTIFY_NO_SENDERS2: 0111 */ ++simpleroutine mach_notify_no_senders2( ++ notify : notify_port_t; ++#if SEQNOS ++ msgseqno seqno : mach_port_seqno_t; ++#endif ++ name : mach_port_name_t; ++ mscount : mach_port_mscount_t); +diff --git a/include/mach/notify.h b/include/mach/notify.h +index 6d783dd..d3b4c01 100644 +--- a/include/mach/notify.h ++++ b/include/mach/notify.h +@@ -53,6 +53,9 @@ + /* An extant send-once right died */ + #define MACH_NOTIFY_DEAD_NAME (MACH_NOTIFY_FIRST + 010) + /* Send or send-once right died, leaving a dead-name */ ++#define MACH_NOTIFY_NO_SENDERS2 (MACH_NOTIFY_FIRST + 011) ++ /* Receive right has no extant send rights, ++ new version. */ + #define MACH_NOTIFY_LAST (MACH_NOTIFY_FIRST + 015) + + typedef struct { +@@ -81,6 +84,14 @@ typedef struct { + + typedef struct { + mach_msg_header_t not_header; ++ mach_msg_type_t not_port_type; /* MACH_MSG_TYPE_PORT_NAME */ ++ mach_port_t not_port; ++ mach_msg_type_t not_type; /* MACH_MSG_TYPE_INTEGER_32 */ ++ unsigned int not_count; ++} mach_no_senders_notification2_t; ++ ++typedef struct { ++ mach_msg_header_t not_header; + } mach_send_once_notification_t; + + typedef struct { +diff --git a/ipc/ipc_notify.c b/ipc/ipc_notify.c +index df5f68b..9465a39 100644 +--- a/ipc/ipc_notify.c ++++ b/ipc/ipc_notify.c +@@ -47,6 +47,7 @@ mach_port_deleted_notification_t ipc_notify_port_deleted_template; + mach_msg_accepted_notification_t ipc_notify_msg_accepted_template; + mach_port_destroyed_notification_t ipc_notify_port_destroyed_template; + mach_no_senders_notification_t ipc_notify_no_senders_template; ++mach_no_senders_notification2_t ipc_notify_no_senders2_template; + mach_send_once_notification_t ipc_notify_send_once_template; + mach_dead_name_notification_t ipc_notify_dead_name_template; + +@@ -175,6 +176,48 @@ ipc_notify_init_no_senders( + } + + /* ++ * Routine: ipc_notify_init_no_senders2 ++ * Purpose: ++ * Initialize a template for no-senders2 notifications. ++ */ ++ ++void ++ipc_notify_init_no_senders2( ++ mach_no_senders_notification2_t *n) ++{ ++ mach_msg_header_t *m = &n->not_header; ++ mach_msg_type_t *t; ++ ++ m->msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE, 0); ++ m->msgh_size = sizeof *n; ++ m->msgh_seqno = NOTIFY_MSGH_SEQNO; ++ m->msgh_local_port = MACH_PORT_NULL; ++ m->msgh_remote_port = MACH_PORT_NULL; ++ m->msgh_id = MACH_NOTIFY_NO_SENDERS2; ++ ++ t = &n->not_port_type; ++ t->msgt_name = MACH_MSG_TYPE_PORT_NAME; ++ t->msgt_size = PORT_T_SIZE_IN_BITS; ++ t->msgt_number = 1; ++ t->msgt_inline = TRUE; ++ t->msgt_longform = FALSE; ++ t->msgt_deallocate = FALSE; ++ t->msgt_unused = 0; ++ ++ t = &n->not_type; ++ t->msgt_name = MACH_MSG_TYPE_INTEGER_32; ++ t->msgt_size = PORT_T_SIZE_IN_BITS; ++ t->msgt_number = 1; ++ t->msgt_inline = TRUE; ++ t->msgt_longform = FALSE; ++ t->msgt_deallocate = FALSE; ++ t->msgt_unused = 0; ++ ++ n->not_port = MACH_PORT_NULL; ++ n->not_count = 0; ++} ++ ++/* + * Routine: ipc_notify_init_send_once + * Purpose: + * Initialize a template for send-once notifications. +@@ -238,6 +281,7 @@ ipc_notify_init(void) + ipc_notify_init_msg_accepted(&ipc_notify_msg_accepted_template); + ipc_notify_init_port_destroyed(&ipc_notify_port_destroyed_template); + ipc_notify_init_no_senders(&ipc_notify_no_senders_template); ++ ipc_notify_init_no_senders2(&ipc_notify_no_senders2_template); + ipc_notify_init_send_once(&ipc_notify_send_once_template); + ipc_notify_init_dead_name(&ipc_notify_dead_name_template); + } +@@ -366,6 +410,11 @@ 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); +@@ -384,6 +433,41 @@ ipc_notify_no_senders( + } + + /* ++ * Routine: ipc_notify_no_senders2 ++ * Purpose: ++ * Send a no-senders2 notification. ++ * Conditions: ++ * Nothing locked. ++ * Consumes a ref/soright for port. ++ */ ++ ++void ++ipc_notify_no_senders2( ++ ipc_port_t port, ++ mach_port_mscount_t mscount) ++{ ++ ipc_kmsg_t kmsg; ++ mach_no_senders_notification2_t *n; ++ ++ kmsg = ikm_alloc(sizeof *n); ++ if (kmsg == IKM_NULL) { ++ printf("dropped no-senders (0x%p, %u)\n", port, mscount); ++ ipc_port_release_sonce(port); ++ return; ++ } ++ ++ 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 ++ ++ ipc_mqueue_send_always(kmsg); ++} ++ ++/* + * Routine: ipc_notify_send_once + * Purpose: + * Send a send-once notification. +diff --git a/ipc/ipc_notify.h b/ipc/ipc_notify.h +index 789bd23..b1fa090 100644 +--- a/ipc/ipc_notify.h ++++ b/ipc/ipc_notify.h +@@ -50,6 +50,20 @@ 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); ++ ++/* No-senders notifications come in two flavors. We use the least ++ significant bit to indicate that the new flavor was requested. */ ++#define NSREQUEST_FLAG_NO_SENDERS2 0x1 ++#define NSREQUEST_FLAG_MASK 0x1 ++#define NSREQUEST_IPC_PORT(X) \ ++ ((ipc_port_t) ((unsigned long) (X) &~ NSREQUEST_FLAG_MASK)) ++#define NSREQUEST_HAS_FLAG(X, F) \ ++ ((unsigned long) (X) & F) ++#define NSREQUEST_SET_FLAG(X, F) \ ++ ((ipc_port_t) ((unsigned long) (X) | F)) ++ ++extern void + ipc_notify_send_once(ipc_port_t); + + extern void +diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c +index 89a5d67..8817c49 100644 +--- a/ipc/ipc_port.c ++++ b/ipc/ipc_port.c +@@ -290,7 +290,7 @@ ipc_port_pdrequest( + } + + /* +- * Routine: ipc_port_nsrequest ++ * Routine: ipc_port_nsrequest2 + * Purpose: + * Make a no-senders request, returning the + * previously registered send-once right. +@@ -302,8 +302,9 @@ ipc_port_pdrequest( + */ + + void +-ipc_port_nsrequest( ++ipc_port_nsrequest2( + ipc_port_t port, ++ boolean_t new_style, + mach_port_mscount_t sync, + ipc_port_t notify, + ipc_port_t *previousp) +@@ -313,7 +314,7 @@ ipc_port_nsrequest( + + assert(ip_active(port)); + +- previous = port->ip_nsrequest; ++ previous = NSREQUEST_IPC_PORT (port->ip_nsrequest); + mscount = port->ip_mscount; + + if ((port->ip_srights == 0) && +@@ -323,7 +324,10 @@ ipc_port_nsrequest( + ip_unlock(port); + ipc_notify_no_senders(notify, mscount); + } else { +- port->ip_nsrequest = notify; ++ port->ip_nsrequest = new_style ++ ? NSREQUEST_SET_FLAG (notify, ++ NSREQUEST_FLAG_NO_SENDERS2) ++ : notify; + ip_unlock(port); + } + +@@ -331,6 +335,28 @@ ipc_port_nsrequest( + } + + /* ++ * Routine: ipc_port_nsrequest ++ * Purpose: ++ * Make a no-senders request, returning the ++ * previously registered send-once right. ++ * Just cancels the previous request if notify is IP_NULL. ++ * Conditions: ++ * The port is locked and active. It is unlocked. ++ * Consumes a ref for notify (if non-null), and ++ * returns previous with a ref (if non-null). ++ */ ++ ++void ++ipc_port_nsrequest( ++ ipc_port_t port, ++ mach_port_mscount_t sync, ++ ipc_port_t notify, ++ ipc_port_t *previousp) ++{ ++ ipc_port_nsrequest2 (port, FALSE, sync, notify, previousp); ++} ++ ++/* + * Routine: ipc_port_set_qlimit + * Purpose: + * Changes a port's queue limit; the maximum number +@@ -698,7 +724,7 @@ ipc_port_destroy( + + /* throw away no-senders request */ + +- nsrequest = port->ip_nsrequest; ++ nsrequest = NSREQUEST_IPC_PORT (port->ip_nsrequest); + if (nsrequest != IP_NULL) + ipc_notify_send_once(nsrequest); /* consumes ref */ + +diff --git a/ipc/ipc_port.h b/ipc/ipc_port.h +index 6914c71..e614ae8 100644 +--- a/ipc/ipc_port.h ++++ b/ipc/ipc_port.h +@@ -88,7 +88,7 @@ struct ipc_port { + mach_port_rights_t ip_srights; + mach_port_rights_t ip_sorights; + +- struct ipc_port *ip_nsrequest; ++ struct ipc_port *ip_nsrequest; /* flags in the LSBs */ + struct ipc_port *ip_pdrequest; + struct ipc_port_request *ip_dnrequests; + +@@ -245,6 +245,14 @@ extern void ipc_port_nsrequest( + ipc_port_t notify, + ipc_port_t *previousp); + ++/* Make a no-senders request, new version. */ ++extern void ipc_port_nsrequest2( ++ ipc_port_t port, ++ boolean_t new_style, ++ mach_port_mscount_t sync, ++ ipc_port_t notify, ++ ipc_port_t *previousp); ++ + /* Change a port's queue limit */ + extern void ipc_port_set_qlimit( + ipc_port_t port, +diff --git a/ipc/mach_port.c b/ipc/mach_port.c +index c7d9b81..ad10cd2 100644 +--- a/ipc/mach_port.c ++++ b/ipc/mach_port.c +@@ -1202,7 +1202,8 @@ mach_port_request_notification( + break; + } + +- case MACH_NOTIFY_NO_SENDERS: { ++ case MACH_NOTIFY_NO_SENDERS: ++ case MACH_NOTIFY_NO_SENDERS2: { + ipc_port_t port; + + kr = ipc_port_translate_receive(space, name, &port); +@@ -1210,7 +1211,8 @@ mach_port_request_notification( + return kr; + /* port is locked and active */ + +- ipc_port_nsrequest(port, sync, notify, previousp); ++ ipc_port_nsrequest2 (port, id == MACH_NOTIFY_NO_SENDERS2, ++ sync, notify, previousp); + /* port is unlocked */ + break; + } +-- +2.1.3 + 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 + diff --git a/debian/patches/series b/debian/patches/series index 01571be..8f89b73 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,3 +9,6 @@ vm_cache_policy.patch tn-0001-kern-provide-notifications-about-new-tasks.patch tn-0002-include-add-X_IMPORTS-to-ipc-definitions.patch +0001-Retire-procedure-old_mach_port_get_receive_status.patch +0002-XXX-Add-a-new-flavor-of-no-senders-notifications.patch +0003-fu-nwe-flavr.patch |