From patchwork Wed Jun 28 13:14:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 113881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8936058vqr; Wed, 28 Jun 2023 06:42:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Jh7PsKR7PKsLA6mCDhSvTMXp6nNMCBZGdnl16V9hI6LuwseKXRnRr852MY3kDPMkP1OlX X-Received: by 2002:aa7:d9d7:0:b0:51d:914a:9f43 with SMTP id v23-20020aa7d9d7000000b0051d914a9f43mr7994879eds.36.1687959766401; Wed, 28 Jun 2023 06:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687959766; cv=none; d=google.com; s=arc-20160816; b=XyFACGF276hWdLJ+laXcRmaQ8rkkVAXNVOR4z3ArqqDWMe+Zr9S+/XBJP09zPUuqBs rBl5/v5LQ9xBWMW77M9CfTA0QXeN5z2/iE8aPZPKO7k81gx1bkl9J5E1Uzg8uU727xy3 wVahLpY2MZaypu8+1C45wxU7yCCoSfUWANbDPVAHoGtmGgFwQe7g/W9JFpbC23ucDr4p MNMLC23iIClTgMt8yKYRpu4/QM9WrfEW3fm/gDbqAXbX/DAePC/Sb/boVRYBEseei1zz 23y3Zi2PWXbnUq3+wdw2U6FTJo7wtV7g16MUeKHi62EIJmZGEty96jis0h/HpVyRRMJ0 YNNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=rZ66qxF22pG0Ry+PL9fQZ9KIjZ2M/KWZ+sr6gpCONeY=; fh=CABfkMhKo5yB9DuGBIJJBQ5z8vnCCyGNX8ln70ySW7c=; b=T97ne10W51Tm3iF0u/drBgYWCkIaAbAjjUFYeTO963bITcyR39K1FBbWstQmI7TbDb vN1GO879z8C/vGsqKcSxSbA5oDqG4fhvND+yZUp3ej7K9rweFrGBlXV+5VS/zKpxdveR a9ithmhk6S1T/OfVKTYL1wwaZWP3anPF4aPOxG8N74TKOR8pK4UANUdOem4UEV3oI3LM YGOMJLkSOADNNUckOaZ9X49KJ5CddUEABAx9S4REkodOqq1IaLM8kx7BUcNEIlpBKM7h eNnuzyuUU9WgVcKCvvgyuTUdatI644JakEjQ3LDdLiY0kHC2SOlOEhxiJ+jIdZlxss1h oPtg== ARC-Authentication-Results: i=1; mx.google.com; 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 ca5-20020aa7cd65000000b0051daa00bdd6si2170452edb.691.2023.06.28.06.42.20; Wed, 28 Jun 2023 06:42: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; 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 S231597AbjF1NQn (ORCPT + 99 others); Wed, 28 Jun 2023 09:16:43 -0400 Received: from bg4.exmail.qq.com ([43.154.54.12]:44540 "EHLO bg4.exmail.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjF1NQ3 (ORCPT ); Wed, 28 Jun 2023 09:16:29 -0400 X-QQ-mid: bizesmtp76t1687958175ts14rjnr Received: from linux-lab-host.localdomain ( [116.30.129.193]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 28 Jun 2023 21:16:14 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: 7YFKcddXagi2DVqxpVhCFo/vBHtMVaf8YdumO5sFURZlqB7s7a6X/9zpcHepq iPnG3ViG8HcSLGdZpQrvhSkyOrwOy0h6Y8KUmaU/t7wp1oMA/OcOL4wClUH0CNXRBqMxrMj GIC2HanU6i16pKbLA4pUUdIh34XWQG1o6j3DuERi6steSM2QS/B9rNh6xMOJTVS+A7AWUD1 UfXJVTCTX2iF3kWRfOX254z5xX+/tuKpG6mzKcDKXigvnH0AxzW/a/wbLIkM3T/CMMvsx7C wZoPlQgV61dxlMnc65CO5dJ4akf+jSCmbBJTA7K3GFSZ4fsRIRleXmsVgXTncgucLNpMf/b 89PJ8cHlmQ7V6djTC3psejkdfzrHomVv6U+zM5Q9fR039DUYyUvMNNy+nzUNQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 3330608914897829044 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, david.laight@aculab.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v5 04/14] tools/nolibc: unistd.h: reorder the syscall macros Date: Wed, 28 Jun 2023 21:14:53 +0800 Message-Id: <0e97fc7e36290e729d07e35db27caacb95354d87.1687957589.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 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?1769954099888054659?= X-GMAIL-MSGID: =?utf-8?q?1769954099888054659?= Tune the macros in the using order and align most of them. Signed-off-by: Zhangjin Wu --- tools/include/nolibc/unistd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h index fabc846f797b..e38f3660c051 100644 --- a/tools/include/nolibc/unistd.h +++ b/tools/include/nolibc/unistd.h @@ -56,9 +56,9 @@ int tcsetpgrp(int fd, pid_t pid) return ioctl(fd, TIOCSPGRP, &pid); } -#define _syscall(N, ...) __sysret(my_syscall##N(__VA_ARGS__)) -#define _syscall_narg(...) __syscall_narg(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) #define __syscall_narg(_0, _1, _2, _3, _4, _5, _6, N, ...) N +#define _syscall_narg(...) __syscall_narg(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) +#define _syscall(N, ...) __sysret(my_syscall##N(__VA_ARGS__)) #define _syscall_n(N, ...) _syscall(N, __VA_ARGS__) #define syscall(...) _syscall_n(_syscall_narg(__VA_ARGS__), ##__VA_ARGS__)