From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 188093858CDB for ; Sun, 2 Apr 2023 23:23:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 188093858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj739-0004c3-HV; Sun, 02 Apr 2023 19:23:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=In-Reply-To:MIME-Version:References:Subject:To:From: Date; bh=SnxgNOAGnYjll0cJvpqTkigwyJTQbUwu1+RU+OOhjxU=; b=k1iXMLo77GneGINMTaN6 pKULdyQljYwKK8sdS7Bmw7JZqhrfFBfAa0EB/rGy8QscgfCGdKIAHYR+JihpPwK0GOdk86T0iL1T4 xozn0S4LA1zm1TvxPeC5XH5N31muhS/bkujjYHQU0mFGAuXB/RL1JQsVAu9Tyg59VKc1sDn4NiZMo /U3uTtrml3cVkUm+bKJbqoJ9ElofXAzRNHt+zs3L8GeEiCl/85+uCiDFn8IZeJ7iPI3DpMwvSm7Iu ALcQkuOv8x4vfHoAEw+O/a6neOAx80TCjRj6OmEWTJ3ek6W9OFruD5Bj+JE6u25A0C1SDs1JLw81N HpZm2Q5Nlr2u/A==; Received: from [2a01:cb19:4a:a400:de41:a9ff:fe47:ec49] (helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj739-0000y8-BK; Sun, 02 Apr 2023 19:23:51 -0400 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pj737-00AtcO-2n; Mon, 03 Apr 2023 01:23:49 +0200 Date: Mon, 3 Apr 2023 01:23:49 +0200 From: Samuel Thibault To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [RFC PATCH glibc 28/34] hurd: Implement _hurd_longjmp_thread_state for x86_64 Message-ID: <20230402232349.auulf2hwzmlmoaqk@begin> Mail-Followup-To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20230319151017.531737-1-bugaevc@gmail.com> <20230319151017.531737-29-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230319151017.531737-29-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,KAM_SHORT,SPF_HELO_PASS,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: Applied, thanks! Sergey Bugaev, le dim. 19 mars 2023 18:10:11 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > sysdeps/mach/hurd/x86_64/longjmp-ts.c | 41 +++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100644 sysdeps/mach/hurd/x86_64/longjmp-ts.c > > diff --git a/sysdeps/mach/hurd/x86_64/longjmp-ts.c b/sysdeps/mach/hurd/x86_64/longjmp-ts.c > new file mode 100644 > index 00000000..2c57d26a > --- /dev/null > +++ b/sysdeps/mach/hurd/x86_64/longjmp-ts.c > @@ -0,0 +1,41 @@ > +/* Perform a `longjmp' on a Mach thread_state. x86_64 version. > + Copyright (C) 1991-2023 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library 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 > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > +#include > +#include > + > + > +/* Set up STATE to do the equivalent of `longjmp (ENV, VAL);'. */ > + > +void > +_hurd_longjmp_thread_state (void *state, jmp_buf env, int val) > +{ > + struct i386_thread_state *ts = state; > + > + ts->rbx = env[0].__jmpbuf[JB_RBX]; > + ts->rbp = env[0].__jmpbuf[JB_RBP]; > + ts->r12 = env[0].__jmpbuf[JB_R12]; > + ts->r13 = env[0].__jmpbuf[JB_R13]; > + ts->r14 = env[0].__jmpbuf[JB_R14]; > + ts->r15 = env[0].__jmpbuf[JB_R15]; > + ts->ursp = env[0].__jmpbuf[JB_RSP]; > + ts->rip = env[0].__jmpbuf[JB_PC]; > + ts->rax = val ?: 1; > +} > -- > 2.39.2 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.