From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 17CC4385B51F for ; Sun, 19 Mar 2023 15:11:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 17CC4385B51F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x12c.google.com with SMTP id b10so10841649lfb.9 for ; Sun, 19 Mar 2023 08:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679238670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SMWj0fstC7UP69bTZDa/dTHSkMzeZu8osDgN5HtG+Ho=; b=Ji2kCll7VrfKxJytl3DdrbJHfsgXJfcMCwVDxxGq/K+aA243LcaL/9GVGBcfw8gYWr nfIWoo3ZK87y0el6XFbXpRXDdYL0Oa7XBuhJ0YTdo5Kdkw5Z9SffgOF6hxK8Ffyeqhy6 X/8LHPbJzYs24CaA+Xpk1xwcXcm5u+CDBfWoz3oucsmoskLETpTibiYo6X/ZdtULAu+t 9ktyQzjKi75FkD7Kvsm5e/7cfPeuqwZuijRiMvr6G0lC00eW/wbv/Ca0J9YLeZDtJves ICVrxwfZ+PCmZAv9CvAp7ujV+wyB+TKWkn7E3RMvO7ZSFhUTfrmXue3DCxvKQILq1QZh YUaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679238670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SMWj0fstC7UP69bTZDa/dTHSkMzeZu8osDgN5HtG+Ho=; b=YloiXf1nCZB+lcNSituUf7L4oEG0DpmpdwexOMiIVdRgawiNM6y526vBI9ETzM6rQU D2Av26Ja4hOhoTPr+8rS9uaO9J6X/PxLI1SeYSNn9ufC7k+8QCll3sORMl8LQSTl6xho cE5ri1KwyLxNhczf8dMg1nKblsH8OXUylpCkKmZOR9v2rxvdaTTgcBf8NNCakfKkmJ6X LLLdIL2as9fMIavR12iq/paiBSOBwuuPuWSB+qcEr+F958tu7/cQnAuhTJbjDQSDBYW6 OY+AW/VqFA5FXMV0kM8KSUhWh4xEUg/m3DwcqZi+AXepnVZU6VZjL44ck0qMP72s56bV 7GUA== X-Gm-Message-State: AO0yUKUxXCpe3TCFZr+R3fApLPE/jjR/boNtbnABoesDGKCYgNSnoj5C e+scEr4d0eTMd8Z/OQAYFcT9K3qDBqlKrg== X-Google-Smtp-Source: AK7set/pYj855xZhIBAwepkHjrvhKoxFVXYBgkZtjW+Tk7pgwRFO7++Nc0A424nReD2RVnyeGuGNiA== X-Received: by 2002:ac2:488f:0:b0:4d5:95c9:4eb9 with SMTP id x15-20020ac2488f000000b004d595c94eb9mr5685192lfc.44.1679238670240; Sun, 19 Mar 2023 08:11:10 -0700 (PDT) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:577a:76f4:df43:5e66]) by smtp.gmail.com with ESMTPSA id m19-20020ac24253000000b004e90dee5469sm1274089lfl.157.2023.03.19.08.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 08:11:09 -0700 (PDT) From: Sergey Bugaev To: libc-alpha@sourceware.org, bug-hurd@gnu.org Cc: Samuel Thibault , Sergey Bugaev Subject: [RFC PATCH glibc 15/34] hurd: Use uintptr_t for register values in trampoline.c Date: Sun, 19 Mar 2023 18:09:58 +0300 Message-Id: <20230319151017.531737-16-bugaevc@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319151017.531737-1-bugaevc@gmail.com> References: <20230319151017.531737-1-bugaevc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is more correct, if only because these fields are defined as having the type unsigned int in the Mach headers, so casting them to a signed int and then back is suboptimal. Also, remove an extra reassignment of uesp -- this is another remnant of the ecx kludge. Signed-off-by: Sergey Bugaev --- sysdeps/mach/hurd/i386/trampoline.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c index 8f481e79..ab67fb9c 100644 --- a/sysdeps/mach/hurd/i386/trampoline.c +++ b/sysdeps/mach/hurd/i386/trampoline.c @@ -270,24 +270,23 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action _hurdsig_end_catch_fault (); - state->basic.eip = (int) rpc_wait_trampoline; + state->basic.eip = (uintptr_t) rpc_wait_trampoline; /* The reply-receiving trampoline code runs initially on the original user stack. We pass it the signal stack pointer in %ebx. */ - state->basic.uesp = state->basic.esp; /* Restore mach_msg syscall SP. */ - state->basic.ebx = (int) sigsp; + state->basic.ebx = (uintptr_t) sigsp; /* After doing the message receive, the trampoline code will need to update the %eax value to be restored by sigreturn. To simplify the assembly code, we pass the address of its slot in SCP to the trampoline code in %ecx. */ - state->basic.ecx = (int) &scp->sc_eax; + state->basic.ecx = (uintptr_t) &scp->sc_eax; } else { - state->basic.eip = (int) trampoline; - state->basic.uesp = (int) sigsp; + state->basic.eip = (uintptr_t) trampoline; + state->basic.uesp = (uintptr_t) sigsp; } /* We pass the handler function to the trampoline code in %edx. */ - state->basic.edx = (int) handler; + state->basic.edx = (uintptr_t) handler; /* The x86 ABI says the DF bit is clear on entry to any function. */ state->basic.efl &= ~EFL_DF; -- 2.39.2