public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] Revert "Update code to handle the new ABI for sending inlined port rights."
Date: Sun,  3 Dec 2023 01:06:47 +0000 (GMT)	[thread overview]
Message-ID: <20231203010647.93DD13858413@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d776a59723b22192d33557d2127e13cb31905382

commit d776a59723b22192d33557d2127e13cb31905382
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Dec 3 02:06:29 2023 +0100

    Revert "Update code to handle the new ABI for sending inlined port rights."
    
    This reverts commit 7e23b3c2c008e0b9b5da055e675d40cc27bb10ef.

Diff:
---
 hurd/intr-msg.c    | 26 ++------------------------
 mach/msg-destroy.c | 12 +++---------
 2 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c
index d52e90449e..24184f827f 100644
--- a/hurd/intr-msg.c
+++ b/hurd/intr-msg.c
@@ -199,28 +199,6 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
 		    __vm_deallocate (__mach_task_self (), (vm_address_t) data, length);
 		}
 
-	      inline void clean_inlined_ports (mach_port_name_inlined_t *ports)
-		{
-		  mach_msg_type_number_t i;
-		  switch (name)
-		    {
-		    case MACH_MSG_TYPE_MOVE_SEND:
-		      for (i = 0; i < number; i++)
-			__mach_port_deallocate (__mach_task_self (), ports[i].name);
-		      if (ty->msgtl_header.msgt_longform)
-			ty->msgtl_name = MACH_MSG_TYPE_COPY_SEND;
-		      else
-			ty->msgtl_header.msgt_name = MACH_MSG_TYPE_COPY_SEND;
-		      break;
-		    case MACH_MSG_TYPE_COPY_SEND:
-		    case MACH_MSG_TYPE_MOVE_RECEIVE:
-		      break;
-		    default:
-		      if (MACH_MSG_TYPE_PORT_ANY (name))
-			assert (! "unexpected port type in interruptible RPC");
-		    }
-		}
-
 	      char *data;
 	      if (ty->msgtl_header.msgt_longform)
 		{
@@ -237,11 +215,11 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
 		  data = (char *) ty + sizeof (mach_msg_type_t);
 		}
 
-	      /* Calculate length of data in bytes.  */
 	      const vm_size_t length = ((number * size) + 7) >> 3;
 	      if (ty->msgtl_header.msgt_inline)
 		{
-		  clean_inlined_ports (data);
+		  /* Calculate length of data in bytes.  */
+		  clean_ports_and_memory (data, length, 0);
 		  /* Move to the next argument.  */
 		  ty = (void *) PTR_ALIGN_UP (data + length, __alignof__ (uintptr_t));
 		}
diff --git a/mach/msg-destroy.c b/mach/msg-destroy.c
index 8640c965bd..19137baa62 100644
--- a/mach/msg-destroy.c
+++ b/mach/msg-destroy.c
@@ -108,17 +108,11 @@ __mach_msg_destroy (mach_msg_header_t *msg)
 	    addr = is_inline ? saddr : * (vm_offset_t *) saddr;
 
 	    if (MACH_MSG_TYPE_PORT_ANY(name)) {
+		mach_port_t *ports = (mach_port_t *) addr;
 		mach_msg_type_number_t i;
 
-		if (is_inline) {
-		    mach_port_name_inlined_t *inlined_ports = (mach_port_name_inlined_t *)addr;
-		    for (i = 0; i < number; i++)
-			mach_msg_destroy_port(inlined_ports[i].name, name);
-		} else {
-		    mach_port_t *ports = (mach_port_t *) addr;
-		    for (i = 0; i < number; i++)
-			mach_msg_destroy_port(ports[i], name);
-		}
+		for (i = 0; i < number; i++)
+		    mach_msg_destroy_port(*ports++, name);
 	    }
 
 	    if (is_inline) {

                 reply	other threads:[~2023-12-03  1:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231203010647.93DD13858413@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).