From patchwork Wed Jun 28 13:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 113877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8934966vqr; Wed, 28 Jun 2023 06:40:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6eGjSBbxHprNUPEOxmA5mF4HwGSIeaE933PPp+HWMVh1eEpR6YN4mBiSbhv9WIvGjJNk16 X-Received: by 2002:a05:6a00:1a8a:b0:680:ddd6:7d8b with SMTP id e10-20020a056a001a8a00b00680ddd67d8bmr2236484pfv.15.1687959656759; Wed, 28 Jun 2023 06:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687959656; cv=none; d=google.com; s=arc-20160816; b=IB297WL6yUMIZ+74LgdkRjBlmuCVtrOPyGBgf6I/H9r38oKZYyqUtC8CKWwpWN6Ozh yBUSbYM/QVtIkePu602JkAFdgIKfD22XNNWs1cqXXUZ53Wr/wOevk1zT8EzHCDh3kWxH a1XZ18NGwYys57YLv9DolffwO7dolxg60xEXK4owwrRpKqiU/fnI6HwXNyofH1VoFE0O HZKQnNc8/uxQwxmYJ0bxjcY4VN1tDyneoHci9AmDtDB8+mWwbqpwBGTirG6S/OoN0Vm1 0Bic0JahY0htjcmklYNKTK40fLWDzwes7AhH2nSH32HbuycJkVNtKEENxAveBzm8WR4t wDWw== 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=o+XWqNWrKZfL0q65kllcs7ElT5BKR65TeLuKgX30XE8=; fh=CABfkMhKo5yB9DuGBIJJBQ5z8vnCCyGNX8ln70ySW7c=; b=OQKSvfsr4CsJCN6sGlLgEJQ09mou475f8iV+Pt5qkDoCQIaeQl2vECYskZGZCTwgHm glTiO5M6YERtpqJ4oWi2aGEJupA63+xUTOIj4T+nss6jhZ3F0TeXIAc/EN3hhSvbLOZV dKsBk0BbRGNEzrHWvD+VIisuHoEuUiKEanAm1hUyqSgh1G+UJ+EYIip4OjCb3SNeb7ZW 9qDe6QwJ3EmK0WQ/xd3AAxpobEG82H911BcIb+VVyGGai58Bf1NyryWncjlkjrIaNJuA WeZHdzp4V7RbLQP8OU/pXFm01vx75cWqL7emnyCUYsbbq7W7af7I/UnW0jG5DGouIHgb ublw== 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 n185-20020a6340c2000000b0054fd5bfaf1bsi9295889pga.892.2023.06.28.06.40.44; Wed, 28 Jun 2023 06:40:56 -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 S232048AbjF1Ngx (ORCPT + 99 others); Wed, 28 Jun 2023 09:36:53 -0400 Received: from bg4.exmail.qq.com ([43.154.54.12]:28837 "EHLO bg4.exmail.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbjF1Ngm (ORCPT ); Wed, 28 Jun 2023 09:36:42 -0400 X-QQ-mid: bizesmtp68t1687959386tfk2bzmm Received: from linux-lab-host.localdomain ( [116.30.129.193]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 28 Jun 2023 21:36:24 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: znfcQSa1hKaTu/Ha7ZQ1+V2pKPKgcx9n9xqgBcc+SOYAX8h6kkRGQ1foUBAeE kncvdehoqJs9juDKWFcfnf91v40tNFH0eQpUaw2087LC37IxT3o70ShZHzxi4qbU8j9f4Jf OjQC38WI2V8z38rxPbae6PLJ7uZIFfF0g0UWlirZRWVd7RAIUtlkOg0YAdNOG7nAc701TXf g0LWaq6rxYsTiXEGw5rt3bGahKrMMBKAxfA1Z220RnBaJ+5lds/fz4bTaMuZjVqYqdKB4vJ CYpmXXl+DIMJE2YeOLonC/ZLLx35FWmy08Mx6wHrLSe8+5+1VVxXmzDcJcJDFWG5D/R9cFA zUiGHVhsiY0vSp2vIBMvWK7tymqDyhYUVoV5h3yHFMWKg9BnCvyvWng45N1mA== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 10609451260477278999 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 08/14] tools/nolibc: arch-mips.h: shrink with SYSCALL_CLOBBERLIST Date: Wed, 28 Jun 2023 21:31:25 +0800 Message-Id: <9e932ce3fdba8ed744319b170ce094a916ac71be.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?1769953984732352975?= X-GMAIL-MSGID: =?utf-8?q?1769953984732352975?= my_syscall share a same long clobber list, define a macro for them. Signed-off-by: Zhangjin Wu --- tools/include/nolibc/arch-mips.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h index 1fd1eedc12a6..55a9f01825e0 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -57,6 +57,10 @@ struct sys_stat_struct { * don't have to experience issues with register constraints. */ +#define SYSCALL_CLOBBERLIST \ + "memory", "cc", "at", "v1", "hi", "lo", \ + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" + #define my_syscall0(num) \ ({ \ register long _num __asm__ ("v0") = (num); \ @@ -68,8 +72,7 @@ struct sys_stat_struct { "addiu $sp, $sp, 32\n" \ : "=r"(_num), "=r"(_arg4) \ : "r"(_num) \ - : "memory", "cc", "at", "v1", "hi", "lo", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ + : SYSCALL_CLOBBERLIST \ ); \ _arg4 ? -_num : _num; \ }) @@ -87,8 +90,7 @@ struct sys_stat_struct { : "=r"(_num), "=r"(_arg4) \ : "0"(_num), \ "r"(_arg1) \ - : "memory", "cc", "at", "v1", "hi", "lo", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ + : SYSCALL_CLOBBERLIST \ ); \ _arg4 ? -_num : _num; \ }) @@ -107,8 +109,7 @@ struct sys_stat_struct { : "=r"(_num), "=r"(_arg4) \ : "0"(_num), \ "r"(_arg1), "r"(_arg2) \ - : "memory", "cc", "at", "v1", "hi", "lo", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ + : SYSCALL_CLOBBERLIST \ ); \ _arg4 ? -_num : _num; \ }) @@ -128,8 +129,7 @@ struct sys_stat_struct { : "=r"(_num), "=r"(_arg4) \ : "0"(_num), \ "r"(_arg1), "r"(_arg2), "r"(_arg3) \ - : "memory", "cc", "at", "v1", "hi", "lo", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ + : SYSCALL_CLOBBERLIST \ ); \ _arg4 ? -_num : _num; \ }) @@ -149,8 +149,7 @@ struct sys_stat_struct { : "=r" (_num), "=r"(_arg4) \ : "0"(_num), \ "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4) \ - : "memory", "cc", "at", "v1", "hi", "lo", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ + : SYSCALL_CLOBBERLIST \ ); \ _arg4 ? -_num : _num; \ }) @@ -172,8 +171,7 @@ struct sys_stat_struct { : "=r" (_num), "=r"(_arg4) \ : "0"(_num), \ "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), "r"(_arg5) \ - : "memory", "cc", "at", "v1", "hi", "lo", \ - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ + : SYSCALL_CLOBBERLIST \ ); \ _arg4 ? -_num : _num; \ })