From patchwork Thu Apr 6 21:54:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 80546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1323741vqo; Thu, 6 Apr 2023 14:56:46 -0700 (PDT) X-Google-Smtp-Source: AKy350bmb+mgM/lP0vH9AUxxMMQuhfuDpxFwJmsPx8opoeYqUiKJoYLMmZKj+xGwR6R0QfYdLorx X-Received: by 2002:a17:90a:3de1:b0:237:44c3:df0b with SMTP id i88-20020a17090a3de100b0023744c3df0bmr15424pjc.32.1680818206657; Thu, 06 Apr 2023 14:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680818206; cv=none; d=google.com; s=arc-20160816; b=rlX5PV4xyGq03TkeFc4qNvkrj+PJGJfbAoB63xc10QPd4k/yAL9uEPBIHC7Auz+JGi cbuH5ksOTu8lgBSOpbmC0cqVerXOMKMgJUQkUd5kKVyPtTHxWqS8r+SZbM96hEpG+avr 8Pej4YDRbt2Kbq4R+/JqGtj+sLRGCVGLd+WgB2A8++5s7tV3a4hz+SGA5N4yRAsFofpa +bcKorBd5iVDyujjng+AEPn23zIY/QTfFo6AdsUOmqX8f+6gEczgh4PCJNpLcZN6XvuT HUkQUgwfTs7y+H7mWAY3/19eluc5gUoMVspTEeZDTXp49OJdg2V1nZ2dlUeOnYa6ONwL q2LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=LEASzUmKot6hbvLjW4HS/lZu+w3jmqOxQ1lULFQSMLs=; b=BxgvTKv8xLRNcy6IAKYGH6mvk+DaZyXf7akvEH+iuH1xWOhs2JWFb/oqDlGFMl9k9N lcab3sAygXsRCRRN72N2mjuE5sTSJQyeE6Qrvls30f+PpyR3NwO+cyA/mJxxo3jXsT47 6oQyQd46nqvh07JnuYyv0tFn0gHwqdqs0+IO/nZIIJEqL/9NnHTY0JzPKpkx/vy2z83b Q7cbJEe/WU2UnDQCx1DMH+6rLwKxK9SaFT+7aDpZ/5qtlysdLWKpwyOzrQqEq3KR1hxe zCC+7mzL9AJVjurlXEORShSwOpOeyU2YgJO1fKkZX+fhUmyG8A9qruAdGpQMyTcufiaZ hMnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=YhGVNWFG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a63ef02000000b004fba312c233si2181701pgh.413.2023.04.06.14.56.34; Thu, 06 Apr 2023 14:56:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=YhGVNWFG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238717AbjDFVzD (ORCPT + 99 others); Thu, 6 Apr 2023 17:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjDFVy5 (ORCPT ); Thu, 6 Apr 2023 17:54:57 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12FC2A5FC; Thu, 6 Apr 2023 14:54:55 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1680818092; bh=3MGSvpy8BgTYO3uiUf6A95riQqbsUtkLORdyUz+rY5k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YhGVNWFGblJqJWs5/gQoihyXPPCDuEPXbZVJP3XV1KRglAlmIcWaBwLqf/H8CJ61E h516d2nFvm/zpOQzOkzlUm9KDG/erlCOyqOb1eUYQ8TrgbiDK0AktAMBIxMJpHXeyb htTcz/aZN9FBqV+Ilblc8tuBMwE0h+70rHE1fvp0= Date: Thu, 06 Apr 2023 21:54:50 +0000 Subject: [PATCH v2 04/11] tools/nolibc: x86_64: use C89 comment syntax MIME-Version: 1.0 Message-Id: <20230328-nolibc-c99-v2-4-c989f2289222@weissschuh.net> References: <20230328-nolibc-c99-v2-0-c989f2289222@weissschuh.net> In-Reply-To: <20230328-nolibc-c99-v2-0-c989f2289222@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680818091; l=3259; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=3MGSvpy8BgTYO3uiUf6A95riQqbsUtkLORdyUz+rY5k=; b=D61vWCH2rhmbgKzdGMopqMSfr6vlwxQF6lgD+EmocanAw8HUPZ5lsikNV4rCjvpy4Ap9DnS3n UqAEckRLu2hC/F8gM0MCVDKvCw3U1fBZeVqtWY94dhtzAONYuK4jsiW X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762465631428783715?= X-GMAIL-MSGID: =?utf-8?q?1762465631428783715?= Most of nolibc is already using C89 comments. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/arch-x86_64.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/include/nolibc/arch-x86_64.h b/tools/include/nolibc/arch-x86_64.h index f7f2a11d4c3b..d98f6c89d143 100644 --- a/tools/include/nolibc/arch-x86_64.h +++ b/tools/include/nolibc/arch-x86_64.h @@ -194,27 +194,27 @@ void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) _start(void) { __asm__ volatile ( #ifdef NOLIBC_STACKPROTECTOR - "call __stack_chk_init\n" // initialize stack protector + "call __stack_chk_init\n" /* initialize stack protector */ #endif - "pop %rdi\n" // argc (first arg, %rdi) - "mov %rsp, %rsi\n" // argv[] (second arg, %rsi) - "lea 8(%rsi,%rdi,8),%rdx\n" // then a NULL then envp (third arg, %rdx) - "mov %rdx, environ\n" // save environ - "xor %ebp, %ebp\n" // zero the stack frame - "mov %rdx, %rax\n" // search for auxv (follows NULL after last env) + "pop %rdi\n" /* argc (first arg, %rdi) */ + "mov %rsp, %rsi\n" /* argv[] (second arg, %rsi) */ + "lea 8(%rsi,%rdi,8),%rdx\n" /* then a NULL then envp (third arg, %rdx) */ + "mov %rdx, environ\n" /* save environ */ + "xor %ebp, %ebp\n" /* zero the stack frame */ + "mov %rdx, %rax\n" /* search for auxv (follows NULL after last env) */ "0:\n" - "add $8, %rax\n" // search for auxv using rax, it follows the - "cmp -8(%rax), %rbp\n" // ... NULL after last env (rbp is zero here) + "add $8, %rax\n" /* search for auxv using rax, it follows the */ + "cmp -8(%rax), %rbp\n" /* ... NULL after last env (rbp is zero here) */ "jnz 0b\n" - "mov %rax, _auxv\n" // save it into _auxv - "and $-16, %rsp\n" // x86 ABI : esp must be 16-byte aligned before call - "call main\n" // main() returns the status code, we'll exit with it. - "mov %eax, %edi\n" // retrieve exit code (32 bit) - "mov $60, %eax\n" // NR_exit == 60 - "syscall\n" // really exit - "hlt\n" // ensure it does not return + "mov %rax, _auxv\n" /* save it into _auxv */ + "and $-16, %rsp\n" /* x86 ABI : esp must be 16-byte aligned before call */ + "call main\n" /* main() returns the status code, we'll exit with it. */ + "mov %eax, %edi\n" /* retrieve exit code (32 bit) */ + "mov $60, %eax\n" /* NR_exit == 60 */ + "syscall\n" /* really exit */ + "hlt\n" /* ensure it does not return */ ); __builtin_unreachable(); } -#endif // _NOLIBC_ARCH_X86_64_H +#endif /* _NOLIBC_ARCH_X86_64_H */