Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp66478rwl; Thu, 6 Apr 2023 14:56:32 -0700 (PDT) X-Google-Smtp-Source: AKy350ZLk6WjmnckJ1vBPKq6uZwk5OLSYpJ4WUMtk0grkA1oLaRup7fOeA6VIxSFmPtMk18GosMd X-Received: by 2002:a17:90b:4c4d:b0:233:ee50:d26d with SMTP id np13-20020a17090b4c4d00b00233ee50d26dmr156429pjb.4.1680818192599; Thu, 06 Apr 2023 14:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680818192; cv=none; d=google.com; s=arc-20160816; b=lUtv82NlU85enu34puSrXoLC5hqs6tEN+ShpLUTfHFk1+UcJ7fOatdNJiojxjQdYmc JXyPI15fn6JbvyFzcGJXsH0t9sRto+YY+aD3QVVKRmk7mP/6KGQQKnMmDt6gFTsWPAMz a3TlI6ih2aanZLhZHwp0LcBFFX86kZs+GDnj5PdmQVNzdsIpKAjvXgCsvashSaDDPOoM vWVGpcwWYuAaXvlmIJwwb2EZQI8BZoPcsjeF24DNoteZjHC+0NVgM+96OK3ORW6qYkIi JECg0PiJd/APYTAYNDW+Y+STpqcci5Zi8JYeYzDVLnx6nXHV9ql/p5K5JWl9azguugbP QrfA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp2-20020a17090b4a8200b0022bbae722fcsi7028220pjb.1.2023.04.06.14.56.21; Thu, 06 Apr 2023 14:56:32 -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 S238666AbjDFVzD (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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 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 */ -- 2.40.0