From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 61B053858D39 for ; Tue, 21 Feb 2023 21:19:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61B053858D39 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-x12d.google.com with SMTP id w27so7512127lfu.4 for ; Tue, 21 Feb 2023 13:19:40 -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=ZH6AOvocsh/qDaHaXXo3hhuKnkAuH8BhUrA3ifp3vAU=; b=o6+fNbHbZLIusfe55KasbWCfNe1Ri9lpFCnk2mIty+dyttDfCuCAS7c8Ku+AQYZlEa 09iipZOfLXcnojFZOL2BS4fleBhUS+rDkYFH/jetRb7LYvE4l4NsnoKP/xJBTGLBO1iG fXaSX7hoceD3Z0WbHDMm7Bz1poeGwIawl/TpsZOZiEglaLpQd9vJwVxk1ZjU1Wxx/ZtJ /TL1rqZqjq2da+ym+utLlP1doRePDlb02Q6H2ZoOeW2vHrKHRheHA/zQ4Ee4W1WxargJ pphfNiJvnlFHGlUO3+6IaAvT+3TvYMOhZGWCiS2pOuxGHN2Lr8nq9T2PUn6kzTN0Mgo5 KU2w== 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=ZH6AOvocsh/qDaHaXXo3hhuKnkAuH8BhUrA3ifp3vAU=; b=iLiFj2ppHm5fwu3daIaKT7UWfyHqduIEWlsH4IDcGzMMlTHJZa2rPEdnzB5t+W8v1I SMdQk2E7YnCNVTG3eo9LC+6/Az3KrYcMWRo3ygfyWJHrP/lE1Hall3SfFPIzsSqOwvca G43KrjxPfAoqvhhJzmy9VQ3nSq3iJr2YX1nEJpRUeDtK8zOKWdZswPtWFBrC6+6hseC+ hayexKxj/Kt577z27gkXGPHuf1/gF6/TfGVgJqrcGxD3zpSVrEow2ll4nW/DMjmtNl/a fKotbIWA7Zhg+DpH2bdVSzyygSANUXX44WZAHjUTzO4G0Jh0mAGhMdaTvTT8O+4sCLqy O1mA== X-Gm-Message-State: AO0yUKUgRl31gyIG/7DJeCNi4e/y+PiWMmu64GMpfX+jQvlen8ZQefxO rjwlc8F6soIn/FYaUB4v8ho= X-Google-Smtp-Source: AK7set+cocoqvkzoQ6QQVOW/GbChPAYrTA0tcNBBa51GdmW1uYCuTt4ajiHp99n+L2mv12J2s144MQ== X-Received: by 2002:a05:6512:104f:b0:4d8:86c1:477f with SMTP id c15-20020a056512104f00b004d886c1477fmr1912654lfb.20.1677014378831; Tue, 21 Feb 2023 13:19:38 -0800 (PST) Received: from surface-pro-6.. ([2a00:1370:818c:4a57:d7b6:7913:7a86:3102]) by smtp.gmail.com with ESMTPSA id m17-20020a195211000000b00498f77cfa63sm1949097lfb.280.2023.02.21.13.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 13:19:38 -0800 (PST) From: Sergey Bugaev To: bug-hurd@gnu.org, libc-alpha@sourceware.org Cc: =?UTF-8?q?Fl=C3=A1vio=20Cruz?= , Noah Goldstein , Samuel Thibault , Sergey Bugaev Subject: [PATCH v2 2/4] hurd: Generalize init-first.c to support x86_64 Date: Wed, 22 Feb 2023 00:19:30 +0300 Message-Id: <20230221211932.296459-3-bugaevc@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230221211932.296459-1-bugaevc@gmail.com> References: <20230221211932.296459-1-bugaevc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 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 34e8dcc0..a187af82 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/x86/init-first.c @@ -238,9 +238,15 @@ _hurd_stack_setup (void) void doinit (intptr_t *data) { init ((int *) 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