From 61fefecfd88282e1bb4dfdb4499518e33d18c6d8 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 3 Dec 2023 02:06:09 +0100 Subject: Revert "Update hurd code to handle the new ABI for sending inlined port rights." This reverts commit 33c30b4ff76ca22bdedce4aa41d05736a546d86b. --- libfshelp/start-translator-long.c | 16 ++++++++-------- proc/stubs.c | 8 +++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c index f788f0a7..0b16e7d0 100644 --- a/libfshelp/start-translator-long.c +++ b/libfshelp/start-translator-long.c @@ -39,7 +39,7 @@ struct fsys_startup_request mach_msg_type_t flagsType; int flags; mach_msg_type_t control_portType; - mach_port_name_inlined_t control_port; + mach_port_t control_port; }; struct fsys_startup_reply @@ -48,7 +48,7 @@ struct fsys_startup_reply mach_msg_type_t RetCodeType; kern_return_t RetCode; mach_msg_type_t realnodeType; - mach_port_name_inlined_t realnode; + mach_port_t realnode; }; /* Wait around for an fsys_startup message on the port PORT from the @@ -76,7 +76,7 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn, void *cookie, const mach_msg_type_t control_portCheck = { .msgt_name = MACH_MSG_TYPE_PORT_SEND, - .msgt_size = 8 * sizeof(mach_port_name_inlined_t), + .msgt_size = 32, .msgt_number = 1, .msgt_inline = TRUE, .msgt_longform = FALSE, @@ -96,7 +96,7 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn, void *cookie, const mach_msg_type_t realnodeType = { .msgt_name = (unsigned char) MACH_MSG_TYPE_POLYMORPHIC, - .msgt_size = 8 * sizeof(mach_port_name_inlined_t), + .msgt_size = 32, .msgt_number = 1, .msgt_inline = TRUE, .msgt_longform = FALSE, @@ -157,17 +157,17 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn, void *cookie, { mach_msg_type_name_t realnode_type; - *control = request.startup.control_port.name; + *control = request.startup.control_port; reply.RetCode = (*underlying_open_fn) (request.startup.flags, - &reply.realnode.name, &realnode_type, task, + &reply.realnode, &realnode_type, task, cookie); reply.realnodeType = realnodeType; reply.realnodeType.msgt_name = realnode_type; - if (!reply.RetCode && reply.realnode.name != MACH_PORT_NULL) + if (!reply.RetCode && reply.realnode != MACH_PORT_NULL) /* The message can't be simple because of the port. */ reply.head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; } @@ -180,7 +180,7 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn, void *cookie, && reply.realnodeType.msgt_name == MACH_MSG_TYPE_MOVE_SEND) /* For MACH_SEND_INTERRUPTED, we'll have pseudo-received the message and might have to clean up a generated send right. */ - mach_port_deallocate (mach_task_self (), reply.realnode.name); + mach_port_deallocate (mach_task_self (), reply.realnode); if (reply.RetCode) /* Make our error return be the earlier one. */ diff --git a/proc/stubs.c b/proc/stubs.c index 0b4a2cea..dc621ba1 100644 --- a/proc/stubs.c +++ b/proc/stubs.c @@ -37,7 +37,7 @@ struct msg_sig_post_request mach_msg_type_t sigcode_type; natural_t sigcode; mach_msg_type_t refporttype; - mach_port_name_inlined_t refport; + mach_port_t refport; }; /* Send the Mach message indicated by msg_spec. */ @@ -124,16 +124,14 @@ send_signal (mach_port_t msgport, .refporttype = { /* Type descriptor for refport */ .msgt_name = MACH_MSG_TYPE_COPY_SEND, - .msgt_size = 8 * sizeof(mach_port_name_inlined_t), + .msgt_size = 32, .msgt_number = 1, .msgt_inline = TRUE, .msgt_longform = FALSE, .msgt_deallocate = FALSE, .msgt_unused = 0 }, - .refport = { - .name = refport - } + .refport = refport }; err = mach_msg ((mach_msg_header_t *)&message, -- cgit v1.2.3