From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 056433858C00 for ; Thu, 23 Feb 2023 15:14:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 056433858C00 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-lj1-x232.google.com with SMTP id e24so4893349ljj.3 for ; Thu, 23 Feb 2023 07:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=tQxhgR8Bn72zcThF/jlhz9lFsk3exkO0gs8DEQjo1Wo=; b=UxIwBPzvGF81F/A9Qw8g50vT9guBMUjaQjrAlDqYGea6Mx1k0XtkQYQo7tW64sSwen 3JrCJwkIg3bpZTsSDH5GlqbJljTTPPinwplfzo9CrI+g71+pCDf0H/m3c4dIQfsKAjer etq/2JtVLpg/EEhnGzqRSHTpt0xI5W12VUkqv1uZ01dFKWWGUIGoB/jmgg19IWxSsK7p cKEuHAUERvaDmp3iz9F8I0j7P4gac7HNFNLDUoKQQhygUFIvUNa7VP0aqb+NxlZy+Reo LzuYAulftFs1HS/Y5z9QXeqZ/tv8XN78tbSn7anGP+Sr3PcDOBLYGxXeM8I43/FLki/N Edsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tQxhgR8Bn72zcThF/jlhz9lFsk3exkO0gs8DEQjo1Wo=; b=d9wU15dH8isw5SlLzj0LAIVLBwlY4rDBHAt/XKBYwZ+0qW7lw8KRofOc897egI37a9 ohUkDleKkQDGugEhtYa2HMrWN0hABNXU/efMOBCcTbI8SM25aIs94Q9JEg9P4bou61/H p6YZMCIaIVflBvYZzOsIr3/vvSd5/IT+btsDNbERXajjzALZIB8vxwXTcRcOEL0wYKXr RFvWvSNMpVKmIayDVp7ldP4yhLVITJPbIYHx43F0+wZKogsOmMEmIRl9cM2bvj33kyKU jbU9wtw6EMkULtxZMQ0Wk6/infvkCVemB2UHN3yc6pWFBeRMO59wi8k7OXXSg4U0QQ7h OsQQ== X-Gm-Message-State: AO0yUKVtr/l9DN63FF9b/uKKn7b+thjlwIl7+JAHZ7UwK1SGdCp2QSrm bUZkjeKTQtvMy+MaFbEfvAA0v7lOb+j+SA== X-Google-Smtp-Source: AK7set8AUIY4yBfOGRGuSj2YUBrWu117dzADbPNejNzgCsvyXJnRCRPQjQZc/QEYeHWLYD0u79rQPw== X-Received: by 2002:a2e:a549:0:b0:293:4ff2:948b with SMTP id e9-20020a2ea549000000b002934ff2948bmr5895094ljn.16.1677165293544; Thu, 23 Feb 2023 07:14:53 -0800 (PST) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:3b42:e837:4d66:1be3]) by smtp.gmail.com with ESMTPSA id e18-20020a2eb1d2000000b002934abfb109sm924009lja.45.2023.02.23.07.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 07:14:52 -0800 (PST) From: Sergey Bugaev To: Samuel Thibault , bug-hurd@gnu.org, libc-alpha@sourceware.org Cc: Sergey Bugaev Subject: [PATCH v3 2/2] hurd: Generalize init-first.c to support x86_64 Date: Thu, 23 Feb 2023 18:14:36 +0300 Message-Id: <20230223151436.49180-2-bugaevc@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230223151436.49180-1-bugaevc@gmail.com> References: <20230223151436.49180-1-bugaevc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_NUMSUBJECT,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: Signed-off-by: Sergey Bugaev --- sysdeps/mach/hurd/{i386 => x86}/init-first.c | 6 ++++++ 1 file changed, 6 insertions(+) rename sysdeps/mach/hurd/{i386 => x86}/init-first.c (97%) diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/x86/init-first.c similarity index 97% rename from sysdeps/mach/hurd/i386/init-first.c rename to sysdeps/mach/hurd/x86/init-first.c index 05424563..2fccaefd 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/x86/init-first.c @@ -225,9 +225,15 @@ _hurd_stack_setup (void) void doinit (intptr_t *data) { init ((void **) data); +# ifdef __x86_64__ + asm volatile ("movq %0, %%rsp\n" /* Switch to new outermost stack. */ + "xorq %%rbp, %%rbp\n" /* Clear outermost frame pointer. */ + "jmp *%1" : : "r" (data), "r" (caller)); +# else asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack. */ "xorl %%ebp, %%ebp\n" /* Clear outermost frame pointer. */ "jmp *%1" : : "r" (data), "r" (caller)); +# endif __builtin_unreachable (); } -- 2.39.2