diff options
Diffstat (limited to 'debian')
6 files changed, 0 insertions, 1137 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 deleted file mode 100644 index 9b4e0e3..0000000 --- a/debian/patches/0001-Retire-procedure-old_mach_port_get_receive_status.patch +++ /dev/null @@ -1,125 +0,0 @@ -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 deleted file mode 100644 index 27e1f85..0000000 --- a/debian/patches/0002-XXX-Add-a-new-flavor-of-no-senders-notifications.patch +++ /dev/null @@ -1,371 +0,0 @@ -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 deleted file mode 100644 index 26b9aa1..0000000 --- a/debian/patches/0003-fu-nwe-flavr.patch +++ /dev/null @@ -1,384 +0,0 @@ -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 8f89b73..52021c2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,9 +6,3 @@ Add-some-padding-to-make-objects-fit-a-single-cache-.patch 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 diff --git a/debian/patches/tn-0001-kern-provide-notifications-about-new-tasks.patch b/debian/patches/tn-0001-kern-provide-notifications-about-new-tasks.patch deleted file mode 100644 index dec19b7..0000000 --- a/debian/patches/tn-0001-kern-provide-notifications-about-new-tasks.patch +++ /dev/null @@ -1,187 +0,0 @@ -From 19c34e37ddc72850b097fbb46823d108dbb984bb Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Tue, 4 Nov 2014 18:46:42 +0100 -Subject: [PATCH gnumach 1/2] kern: provide notifications about new tasks - -These notifications are sent to the port registered via -`register_new_task_notification' and provide a robust parental -relation between tasks to a userspace server. - -* Makefrag.am: Add task_notify.defs. -* include/mach/gnumach.defs: Add register_new_task_notification. -* include/mach/task_notify.defs: New file. -* kern/task.c (new_task_notification): New variable. -(task_create): Send new task notifications. -(register_new_task_notification): Add server function. -* kern/task_notify.cli: New file. ---- - Makefrag.am | 8 ++++++++ - include/mach/gnumach.defs | 8 ++++++++ - include/mach/task_notify.defs | 36 ++++++++++++++++++++++++++++++++++++ - kern/task.c | 33 +++++++++++++++++++++++++++++++++ - kern/task_notify.cli | 7 +++++++ - 5 files changed, 92 insertions(+) - create mode 100644 include/mach/task_notify.defs - create mode 100644 kern/task_notify.cli - -diff --git a/Makefrag.am b/Makefrag.am -index 5e98b21..410f56d 100644 ---- a/Makefrag.am -+++ b/Makefrag.am -@@ -364,6 +364,7 @@ include_mach_HEADERS = \ - include/mach/mach.defs \ - include/mach/mach4.defs \ - include/mach/gnumach.defs \ -+ include/mach/task_notify.defs \ - include/mach/mach_host.defs \ - include/mach/mach_port.defs \ - include/mach/mach_types.defs \ -@@ -488,6 +489,13 @@ nodist_libkernel_a_SOURCES += \ - # device/device_reply.user.defs - # device/memory_object_reply.user.defs - -+nodist_lib_dep_tr_for_defs_a_SOURCES += \ -+ kern/task_notify.user.defs.c -+nodist_libkernel_a_SOURCES += \ -+ kern/task_notify.user.h \ -+ kern/task_notify.user.c \ -+ kern/task_notify.user.msgids -+ - # Server stubs. - nodist_lib_dep_tr_for_defs_a_SOURCES += \ - device/device.server.defs.c \ -diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs -index 6cfbb0d..bac3b09 100644 ---- a/include/mach/gnumach.defs -+++ b/include/mach/gnumach.defs -@@ -72,3 +72,11 @@ simpleroutine thread_terminate_release( - simpleroutine task_set_name( - task : task_t; - name : kernel_debug_name_t); -+ -+/* -+ * Register a port to which a notification about newly created tasks -+ * are sent. -+ */ -+routine register_new_task_notification( -+ host_priv : host_priv_t; -+ notification : mach_port_send_t); -diff --git a/include/mach/task_notify.defs b/include/mach/task_notify.defs -new file mode 100644 -index 0000000..5485d4e ---- /dev/null -+++ b/include/mach/task_notify.defs -@@ -0,0 +1,36 @@ -+/* -+ * Copyright (C) 2014 Free Software Foundation -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see <http://www.gnu.org/licenses/>. -+ */ -+ -+subsystem -+#if KERNEL_SERVER -+ KernelServer -+#endif /* KERNEL_SERVER */ -+#if KERNEL_USER -+ KernelUser -+#endif /* KERNEL_USER */ -+ task_notify 4400; -+ -+#include <mach/std_types.defs> -+#include <mach/mach_types.defs> -+ -+/* These notifications are sent to the port registered via -+ `register_new_task_notification' and provide a robust parental -+ relation between tasks. */ -+simpleroutine mach_notify_new_task( -+ notify : mach_port_t; -+ task : task_t; -+ parent : task_t); -diff --git a/kern/task.c b/kern/task.c -index 20acc6a..bcc2a4e 100644 ---- a/kern/task.c -+++ b/kern/task.c -@@ -50,12 +50,16 @@ - #include <kern/sched_prim.h> /* for thread_wakeup */ - #include <kern/ipc_tt.h> - #include <kern/syscall_emulation.h> -+#include <kern/task_notify.user.h> - #include <vm/vm_kern.h> /* for kernel_map, ipc_kernel_map */ - #include <machine/machspl.h> /* for splsched */ - - task_t kernel_task = TASK_NULL; - struct kmem_cache task_cache; - -+/* Where to send notifications about newly created tasks. */ -+ipc_port_t new_task_notification = NULL; -+ - void task_init(void) - { - kmem_cache_init(&task_cache, "task", sizeof(struct task), 0, -@@ -169,6 +173,14 @@ kern_return_t task_create( - - snprintf (new_task->name, sizeof new_task->name, "%p", new_task); - -+ if (new_task_notification != NULL) { -+ task_reference (new_task); -+ task_reference (parent_task); -+ mach_notify_new_task (new_task_notification, -+ convert_task_to_port (new_task), -+ convert_task_to_port (parent_task)); -+ } -+ - ipc_task_enable(new_task); - - *child_task = new_task; -@@ -1230,3 +1242,24 @@ task_ras_control( - #endif /* FAST_TAS */ - return ret; - } -+ -+/* -+ * register_new_task_notification -+ * -+ * Register a port to which a notification about newly created -+ * tasks are sent. -+ */ -+kern_return_t -+register_new_task_notification( -+ const host_t host, -+ ipc_port_t notification) -+{ -+ if (host == HOST_NULL) -+ return KERN_INVALID_HOST; -+ -+ if (new_task_notification != NULL) -+ return KERN_NO_ACCESS; -+ -+ new_task_notification = notification; -+ return KERN_SUCCESS; -+} -diff --git a/kern/task_notify.cli b/kern/task_notify.cli -new file mode 100644 -index 0000000..c6c85d9 ---- /dev/null -+++ b/kern/task_notify.cli -@@ -0,0 +1,7 @@ -+/* XXX */ -+ -+/* This is a client presentation file. */ -+ -+#define KERNEL_USER 1 -+ -+#include <mach/task_notify.defs> --- -2.1.1 - diff --git a/debian/patches/tn-0002-include-add-X_IMPORTS-to-ipc-definitions.patch b/debian/patches/tn-0002-include-add-X_IMPORTS-to-ipc-definitions.patch deleted file mode 100644 index e79ac54..0000000 --- a/debian/patches/tn-0002-include-add-X_IMPORTS-to-ipc-definitions.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 1f60234ceb8c3fa90333658528f24ae887ece6f8 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Thu, 6 Nov 2014 16:57:35 +0100 -Subject: [PATCH gnumach 2/2] include: add X_IMPORTS to ipc definitions - -This makes it possible to inject imports. - -* include/mach/gnumach.defs: Make it possible to inject imports. -* include/mach/mach.defs: Likewise. -* include/mach/mach_host.defs: Likewise. ---- - include/mach/gnumach.defs | 4 ++++ - include/mach/mach.defs | 4 ++++ - include/mach/mach_host.defs | 4 ++++ - 3 files changed, 12 insertions(+) - -diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs -index bac3b09..dd4da87 100644 ---- a/include/mach/gnumach.defs -+++ b/include/mach/gnumach.defs -@@ -29,6 +29,10 @@ subsystem - #include <mach/mach_types.defs> - #include <mach_debug/mach_debug_types.defs> - -+#ifdef GNUMACH_IMPORTS -+GNUMACH_IMPORTS -+#endif -+ - type vm_cache_statistics_data_t = struct[11] of integer_t; - - /* -diff --git a/include/mach/mach.defs b/include/mach/mach.defs -index 5851080..3786f65 100644 ---- a/include/mach/mach.defs -+++ b/include/mach/mach.defs -@@ -46,6 +46,10 @@ userprefix r_; - #include <mach/std_types.defs> - #include <mach/mach_types.defs> - -+#ifdef MACH_IMPORTS -+MACH_IMPORTS -+#endif -+ - skip; /* old port_allocate */ - skip; /* old port_deallocate */ - skip; /* old port_enable */ -diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs -index 2644146..6699a50 100644 ---- a/include/mach/mach_host.defs -+++ b/include/mach/mach_host.defs -@@ -47,6 +47,10 @@ subsystem - #include <mach/std_types.defs> - #include <mach/mach_types.defs> - -+#ifdef MACH_HOST_IMPORTS -+MACH_HOST_IMPORTS -+#endif -+ - /* - * Get list of processors on this host. - */ --- -2.1.1 - |