From patchwork Mon May 29 13:07:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 100259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1509908vqr; Mon, 29 May 2023 06:22:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7uDM33cw5LpTmOm+cRURLxTO5Dt0mQQtDuqY8TL5vaH0/y1HGDRstuuzRgL4iagH6ngHfH X-Received: by 2002:a17:903:245:b0:1aa:ebaa:51ce with SMTP id j5-20020a170903024500b001aaebaa51cemr15551259plh.14.1685366536286; Mon, 29 May 2023 06:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685366536; cv=none; d=google.com; s=arc-20160816; b=CFy0TBa0UOA2HopScz7f2AjKq1PROiyPpCYO+O9yJQkQrv5EBR+/qj4UM0gm5PAnb/ rjIxL1UQB7m711W0Cb55N3hJMKZgKLJN+gJvCpRuILsDDe40B4cRxg8CmnhHrzz0CYrc AwSrA8vpcEgjJOAHvnwz33c04HcQQ7yD4Zfx2W0zm+3E3EM8d11ZNFXzE0lWNQrzj/5T H3Ue+cBk76C7/BL6SCZA5XZTpu8FA+y4GXHOzRsl9R39eBYybpSU0UUeVR4IKpX12Puf 5CvR6rZZ1pHHkgxP/EyUbj2tfGG22iTxbUeXY2U7cDYrofxwYGgo8Tp8vht9HQ9XECM5 wwSQ== 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=/RFNdUcQHw70d0KcW0LPqqFMcFHeXHUV7LhXYuqd8U0=; b=YbP0uUvcrD4DZX6JM8QlUECqdQgecXhpdCz0+iiSQFUv40JxHzEQ03wrIV6tsBiLvq pEQR+9c8TvIL5LaAhtGSpA4LFEDO/sKAum6pa5E/73/SfRH8N7cjHhI3tRXvYMJ4/hII 5kt04T1WHXp80nYlg1HpBqna48dKUUISk4mWK+A/Udvrjhj19RFganS6fHnWMGOOFmyA CdYN7ZMNUrep0UIb26Uf4/OfziJf3Y+UBIH+HeyrA6OiShGrtHPU1alzmyOJMLIPUN6b 0RNgHhcIur/KXPoEdB5jx4+1dDwcj8E+xkDAW+SmXv9MS+CGGqFRAkNn4so5zdwFnFgE 7gWA== 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 z8-20020a1709028f8800b001a6f0eab385si9592863plo.55.2023.05.29.06.22.04; Mon, 29 May 2023 06:22:16 -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 S229601AbjE2NH7 (ORCPT + 99 others); Mon, 29 May 2023 09:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjE2NH5 (ORCPT ); Mon, 29 May 2023 09:07:57 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 693B091; Mon, 29 May 2023 06:07:55 -0700 (PDT) X-QQ-mid: bizesmtp85t1685365665tgzca5zc Received: from linux-lab-host.localdomain ( [119.123.130.80]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 29 May 2023 21:07:44 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: hvKw+PyJ8U6+uRVu/0AXG0i6+eBsNcwRbz2CZsT5niaVOLEjABKXMEbu2AisN uImWTWIWpl/bgpjuSuZqGv9sxOil3B8sj88KJEHleCbTRcmkdCIZoLB6KuLdqDUTW/bfNHC qcNmAe1dPOSnMPzWdJrTK1Ms82OBZOdRa1pz17Cotzmwgaz+8DZqQVeH3+/EUj/1QaNFLGz b2cbQLpbMgX9/StyBR2UmwLCa8hQ3pd50wYkdVem43lLqUAUknVygFLGVgwnoRvuXt9XlD+ WyFHJ5lc3V/61Lo3BiaP/0HyPHI9bUnvaaUqXjUNVMv/vv4BLH2GeBCvf6tk9glgdi9gP0O rWlZSsaWPXG4mlGnUKp0F+MP099LijaKfcqzPbPVlQN2SixFKEGVRTrwrpVqUAPa09QjuW9 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13225124570130202105 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH v2 6/7] tools/nolibc: arm: add missing my_syscall6 Date: Mon, 29 May 2023 21:07:42 +0800 Message-Id: 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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?1767234901576168857?= X-GMAIL-MSGID: =?utf-8?q?1767234901576168857?= This is required by the coming removal of the oldselect and newselect support. pselect6/pselect6_time64 will be used unconditionally, they have 6 arguments. Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/linux-riscv/20230524182431.268908-1-falcon@tinylab.org/T/#t Signed-off-by: Zhangjin Wu --- tools/include/nolibc/arch-arm.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc/arch-arm.h index 45b89ffe8247..ca4c66987497 100644 --- a/tools/include/nolibc/arch-arm.h +++ b/tools/include/nolibc/arch-arm.h @@ -198,6 +198,29 @@ struct sys_stat_struct { _arg1; \ }) +#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ +({ \ + register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \ + register long _arg1 __asm__ ("r0") = (long)(arg1); \ + register long _arg2 __asm__ ("r1") = (long)(arg2); \ + register long _arg3 __asm__ ("r2") = (long)(arg3); \ + register long _arg4 __asm__ ("r3") = (long)(arg4); \ + register long _arg5 __asm__ ("r4") = (long)(arg5); \ + register long _arg6 __asm__ ("r5") = (long)(arg6); \ + \ + __asm__ volatile ( \ + _NOLIBC_THUMB_SET_R7 \ + "svc #0\n" \ + _NOLIBC_THUMB_RESTORE_R7 \ + : "=r"(_arg1), "=r" (_num) \ + : "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5), \ + "r"(_arg6), "r"(_num) \ + : "memory", "cc", "lr" \ + ); \ + _arg1; \ +}) + + char **environ __attribute__((weak)); const unsigned long *_auxv __attribute__((weak));