From patchwork Sun Nov 19 05:08:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Cruz X-Patchwork-Id: 1865619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=N4TGDGuS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SXzFk4YkMz1yS4 for ; Sun, 19 Nov 2023 16:09:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 961E33858C5F for ; Sun, 19 Nov 2023 05:09:03 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id ECF233858D37 for ; Sun, 19 Nov 2023 05:08:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECF233858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECF233858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::836 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700370534; cv=none; b=OT8vNPBHFPTc4okPLYejklZZIykHGwUYoUkgXUoLDzfPwbqMmHOuzscDq/0BITjj/FhDpGwDMWV1bHaQ+IKclbJeDxnyuDxJVmIL+7b9OvVD4ucA4RQR2NAo5/aNLyMET90xp/fFn/A5koPFjjp7cHVWHG5g6fbyW7polcDCVoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700370534; c=relaxed/simple; bh=dp8R8m67jh2tNaIBDVdrjQ5SJzPNO/BN5+ywaGNWJQQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=IPC+U5y2WyyAHSGu/KPPfAE1K9gDpBFrIflkM+kQEvSqFaCBBiGZx+KWuMpaGIDLLq6ad1SzfmbJBqQUEgODCaWrj0jGnrGUxjsK2Lbs9Ku8Wk7KXYL69HMe51CzruLcGrZg7yb4ON0mlQA2BH31zCCn6cuTdZ1NlWPfu0A2rAQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-41cc535cd5cso19463101cf.2 for ; Sat, 18 Nov 2023 21:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700370530; x=1700975330; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=CCheLSwSA7lsfS0xG0L6P8ZwapY1P+Nn8k/xNqEOocY=; b=N4TGDGuSvycXNy7jdcv7guTc2XbQptxbuGCWBPvocu6A+koeI/eCd6AHTVrOvmXEhb 8eFXJCJ5P8Jdm6s5/T76kUPvKVXd591Q7KKweeok9qhUbBiSIT89I1m8CyqqQC1QZGw6 eHKkPplLSn40gzgj0k+y/3330DzZ+SD5+GnDAFsOUqtQ5FUAaj7iL8fkb/mrBNqpkiMp 32WI5V+y57Eum8d4fbqmxwPKXIZhVnspPG2krCGnMi0AAZYRoSModCb3PGzPjvJsXhij ZFEdh/YViSJiFRXRrhZJ/vnLedoSfBBQw4/38wdk0vejM3D/w2HNOmwXKf/aOuCDe0+R trRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700370530; x=1700975330; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CCheLSwSA7lsfS0xG0L6P8ZwapY1P+Nn8k/xNqEOocY=; b=OhKDVFYaQYhDT3gh6R6QumANVgwpZ5uhxu23rSHvql9dznpZTQrP4jgy5B08X29U0O LchuXvEvexyHE8jwSnu40tdiH8WUMyopJ5XuDQ5XkLsKt9oiUhMXb4oQ3RWQFXOkIRcl eO/1xXBXBdaDHREmDH5f9OciPY1KHVsi5rJXccc5ln9Rm7IMWxKDbSMLuNyBPZnxSS9d C7iPuE2vYJ/u6PvHAn9qAV4qCjqc7bYlcAYMgiW1AsICoDplzn0zG7dJqHUL+7YrcZ/h JgGHtOjZYL3w0EQfxqEyrJEgl1KYJJVlgnICcavwOZ1r/hAckhM5Arpr8xnp9PHyysgK Z3/w== X-Gm-Message-State: AOJu0Yw7bHhHutEwVeTAU7yWPEaXZZImIuZGRUfdTeyIN0kfTiOLwi+W Ql9TMPRmdug2jOPTm0jT8A== X-Google-Smtp-Source: AGHT+IF3HfVRGrm8xG2w60t8GCSD/NKNFBfwMpR6mn6iImehIe6wZFi+oQDCjH+1JGGN2kriXt9eyQ== X-Received: by 2002:a05:622a:1ca:b0:417:9962:4de9 with SMTP id t10-20020a05622a01ca00b0041799624de9mr5107038qtw.1.1700370530041; Sat, 18 Nov 2023 21:08:50 -0800 (PST) Received: from jupiter.tail36e24.ts.net ([24.154.253.225]) by smtp.gmail.com with ESMTPSA id j17-20020ac86651000000b0041b3deef647sm1743382qtp.8.2023.11.18.21.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 21:08:49 -0800 (PST) Date: Sun, 19 Nov 2023 00:08:47 -0500 From: Flavio Cruz To: bug-hurd@gnu.org, libc-alpha@sourceware.org Subject: [PATCH glibc] Remove untyped mach RPC code. Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Existing MiG does not support untyped messages and the Hurd will continue to use typed messages for the foreseeable future. --- hurd/hurdfault.c | 4 --- hurd/intr-msg.c | 69 ---------------------------------------------- mach/msg-destroy.c | 64 ------------------------------------------ mach/msgserver.c | 4 --- 4 files changed, 141 deletions(-) diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c index dae889a9..1578b88e 100644 --- a/hurd/hurdfault.c +++ b/hurd/hurdfault.c @@ -115,10 +115,6 @@ _hurdsig_fault_catch_exception_raise_state_identity #endif -#ifdef NDR_CHAR_ASCII /* OSF Mach flavors have different names. */ -# define mig_reply_header_t mig_reply_error_t -#endif - static void faulted (void) { diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c index 737bfe0f..24184f82 100644 --- a/hurd/intr-msg.c +++ b/hurd/intr-msg.c @@ -25,10 +25,6 @@ #include "intr-msg.h" -#ifdef NDR_CHAR_ASCII /* OSF Mach flavors have different names. */ -# define mig_reply_header_t mig_reply_error_t -#endif - error_t _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, mach_msg_option_t option, @@ -45,11 +41,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, struct clobber { -#ifdef NDR_CHAR_ASCII - NDR_record_t ndr; -#else mach_msg_type_t type; -#endif error_t err; }; union msg @@ -59,11 +51,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, struct { mach_msg_header_t header; -#ifdef NDR_CHAR_ASCII - NDR_record_t ndr; -#else mach_msg_type_t type; -#endif int code; } check; struct @@ -171,7 +159,6 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, } if (msg->msgh_bits & MACH_MSGH_BITS_COMPLEX) { -#ifndef MACH_MSG_PORT_DESCRIPTOR /* Check for MOVE_SEND rights in the message. These hold refs that we need to release in case the message is in fact never re-sent later. Since it might in fact be re-sent, we turn @@ -243,62 +230,6 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, ty = (void *) data + sizeof (void *); } } -#else /* Untyped Mach IPC flavor. */ - mach_msg_body_t *body = (void *) (msg + 1); - mach_msg_descriptor_t *desc = (void *) (body + 1); - mach_msg_descriptor_t *desc_end = desc + body->msgh_descriptor_count; - for (; desc < desc_end; ++desc) - switch (desc->type.type) - { - case MACH_MSG_PORT_DESCRIPTOR: - switch (desc->port.disposition) - { - case MACH_MSG_TYPE_MOVE_SEND: - __mach_port_deallocate (mach_task_self (), - desc->port.name); - desc->port.disposition = MACH_MSG_TYPE_COPY_SEND; - break; - case MACH_MSG_TYPE_COPY_SEND: - case MACH_MSG_TYPE_MOVE_RECEIVE: - break; - default: - assert (! "unexpected port type in interruptible RPC"); - } - break; - case MACH_MSG_OOL_DESCRIPTOR: - if (desc->out_of_line.deallocate) - __vm_deallocate (__mach_task_self (), - (vm_address_t) desc->out_of_line.address, - desc->out_of_line.size); - break; - case MACH_MSG_OOL_PORTS_DESCRIPTOR: - switch (desc->ool_ports.disposition) - { - case MACH_MSG_TYPE_MOVE_SEND: - { - mach_msg_size_t i; - const mach_port_t *ports = desc->ool_ports.address; - for (i = 0; i < desc->ool_ports.count; ++i) - __mach_port_deallocate (__mach_task_self (), ports[i]); - desc->ool_ports.disposition = MACH_MSG_TYPE_COPY_SEND; - break; - } - case MACH_MSG_TYPE_COPY_SEND: - case MACH_MSG_TYPE_MOVE_RECEIVE: - break; - default: - assert (! "unexpected port type in interruptible RPC"); - } - if (desc->ool_ports.deallocate) - __vm_deallocate (__mach_task_self (), - (vm_address_t) desc->ool_ports.address, - desc->ool_ports.count - * sizeof (mach_port_t)); - break; - default: - assert (! "unexpected descriptor type in interruptible RPC"); - } -#endif } break; diff --git a/mach/msg-destroy.c b/mach/msg-destroy.c index 0a8b46c8..19137baa 100644 --- a/mach/msg-destroy.c +++ b/mach/msg-destroy.c @@ -71,69 +71,6 @@ __mach_msg_destroy (mach_msg_header_t *msg) mach_msg_destroy_port(msg->msgh_remote_port, MACH_MSGH_BITS_REMOTE(mbits)); if (mbits & MACH_MSGH_BITS_COMPLEX) { -#ifdef MACH_MSG_PORT_DESCRIPTOR - mach_msg_body_t *body; - mach_msg_descriptor_t *saddr, *eaddr; - - body = (mach_msg_body_t *) (msg + 1); - saddr = (mach_msg_descriptor_t *) - ((mach_msg_base_t *) msg + 1); - eaddr = saddr + body->msgh_descriptor_count; - - for ( ; saddr < eaddr; saddr++) { - switch (saddr->type.type) { - - case MACH_MSG_PORT_DESCRIPTOR: { - mach_msg_port_descriptor_t *dsc; - - /* - * Destroy port rights carried in the message - */ - dsc = &saddr->port; - mach_msg_destroy_port(dsc->name, dsc->disposition); - break; - } - - case MACH_MSG_OOL_DESCRIPTOR : { - mach_msg_ool_descriptor_t *dsc; - - /* - * Destroy memory carried in the message - */ - dsc = &saddr->out_of_line; - if (dsc->deallocate) { - mach_msg_destroy_memory((vm_offset_t)dsc->address, - dsc->size); - } - break; - } - - case MACH_MSG_OOL_PORTS_DESCRIPTOR : { - mach_port_t *ports; - mach_msg_ool_ports_descriptor_t *dsc; - mach_msg_type_number_t j; - - /* - * Destroy port rights carried in the message - */ - dsc = &saddr->ool_ports; - ports = (mach_port_t *) dsc->address; - for (j = 0; j < dsc->count; j++, ports++) { - mach_msg_destroy_port(*ports, dsc->disposition); - } - - /* - * Destroy memory carried in the message - */ - if (dsc->deallocate) { - mach_msg_destroy_memory((vm_offset_t)dsc->address, - dsc->count * sizeof(mach_port_t)); - } - break; - } - } - } -#else vm_offset_t saddr; vm_offset_t eaddr; @@ -185,7 +122,6 @@ __mach_msg_destroy (mach_msg_header_t *msg) saddr += sizeof(vm_offset_t); } } -#endif } } diff --git a/mach/msgserver.c b/mach/msgserver.c index 9ffe71ed..8f8beedd 100644 --- a/mach/msgserver.c +++ b/mach/msgserver.c @@ -66,10 +66,6 @@ #include /* For malloc and free. */ #include -#ifdef NDR_CHAR_ASCII /* OSF Mach flavors have different names. */ -# define mig_reply_header_t mig_reply_error_t -#endif - mach_msg_return_t __mach_msg_server_timeout (boolean_t (*demux) (mach_msg_header_t *request, mach_msg_header_t *reply),