From patchwork Fri Oct 27 22:10:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 159177 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp913447vqb; Fri, 27 Oct 2023 15:12:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOIgUaMtM8j2vUuwr3XtcqrxvqrKBWH7FERsYGW0PWu+fcSX+hoivFcyrgCJcUnHdFhw0Q X-Received: by 2002:a17:903:28d0:b0:1ca:3e40:be9c with SMTP id kv16-20020a17090328d000b001ca3e40be9cmr4035201plb.34.1698444759555; Fri, 27 Oct 2023 15:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698444759; cv=none; d=google.com; s=arc-20160816; b=cOxw+LlNOclCpjYfFWH3WSi6sAPsyWMJbE/u3w+/RvxBz1vybirnoiz2mGsKLoDAer KAfQUiPyXMWHHyGihY6Qfq3y3lO9YqgPa6Q515m1y3JgCvK4wuCpYDOGvPevCyDM7UJ0 kq757IVNYsSNrtNp35nJDClPkJbgSlOWuBh/ijKPyZTQgScTQhknPBbHgIT8BaPpW7ND 9DuC7+76S2LabasPeHeSES9/w2CIZiQCNOYmV8PtQBkqQjb7WUvCG0+FlCG58kdZ31Mf vEwZt+HrScYm2kSPDmWL8bbMWBRJhnqqf0KMF85PsdZrGDmzI0Q7rTc7th7ygfTMrfgI qdGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=QkagzItTcmygJhd+IgCnn6qdrUYk56vVzdHfbFmNb0k=; fh=34VXqKbbbRVUWYKB0XlF9D4jmhXxe51P2+smd1zcTfU=; b=f5wVexAwR0R8w8NZeSeCEdg6Rg82h63Ev94sBaFJVjE50+GG4ahifq8vtwJwbApgN5 TQUAynjrcJxEm4HBOBKg7ZZOmlWCc8caApTsRLlwTS/H5NDqAKCwdcfi4H9S8rXqgWz3 LRQ9h+W1meTZTTAGGR6bANoWz1ZaM0y5oFjNjVMPSOlRMyKAHOFpRwmxIK3/txrNsAoK LwMcBVObUvf9LWfbUlqr8cQ3FS2UmYG3A5K/lWPK3GsRJjPQ8T7RuMYTNLXVSiuG4bzE E57qg3GLWbtajv6ynOTOR90SgHLrhUNbjtM/doWQzcWPmQnl+NBpXU101EnQatKk8TbO 8POg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=U5qTKlfx; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ecq6gFaF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k18-20020a170902c41200b001cc30cb3f9asi245546plk.14.2023.10.27.15.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 15:12:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=U5qTKlfx; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ecq6gFaF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 800FA80A990D; Fri, 27 Oct 2023 15:11:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346635AbjJ0WLV (ORCPT + 27 others); Fri, 27 Oct 2023 18:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346583AbjJ0WLT (ORCPT ); Fri, 27 Oct 2023 18:11:19 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18181B6; Fri, 27 Oct 2023 15:11:17 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D0BC43200930; Fri, 27 Oct 2023 18:11:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 27 Oct 2023 18:11:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1698444673; x= 1698531073; bh=QkagzItTcmygJhd+IgCnn6qdrUYk56vVzdHfbFmNb0k=; b=U 5qTKlfx1FZYPNAKnzlTeLKGKoofCV7h76mwVgJ50l/M6yFvDiBQrVIRc3F3UIamy RNdQTuGM3mqjx+YXckktQGhOPZy0iggxdsf59DjA8s2e29ANS/6kMEEfoOiOQEIi I0C+R/BuYbWM/InhMq1Y9ZTH8awtTpJG9tgUcySj7KuTFnJlAns2fLgbUnz/RXCk xV0Z1vsKuHqotYnHQWDnsCKOL9/6GBvhzmaPeSTTvmn61/gx6VteF2wTx49AErHQ J3meEd9xI2tsXBX+0CqLVKzZdLXQd90xrmovm5tBi/kdQDd/dfiDAbw+0pXu9rws knnY8gcrDNT2F2kqA+F2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1698444673; x= 1698531073; bh=QkagzItTcmygJhd+IgCnn6qdrUYk56vVzdHfbFmNb0k=; b=e cq6gFaFi5FoZ0T12bdQZf0URDU0JWp3hUeKNP5Ien5CVyaSgB+YaR3JdtEy179cg ZIPpHfRnST41jiFW9SbwYbObuhqVbHdYRFTMIB9mOqRCk5NqN+Jjx9KUyhHtS2rO eOpQBo5ROzqDAlkwbwZse46nHo1WiCcN+wshDLtlkGI2jWA3OyVrpN1OINqmthI6 Zxp3guM85S8wVpsIZ8Jtfum+0uXb1Mii4+5GIooKn/SrSrj6/av54t7VsIYft6kG VeGr2xSZWfvuynaAkROFIOd3ML7wd7U5TjaKHYb1d/BO9T+lxgYqw1s/UuiJKMtg waHNVGX1XEZ+zl4gBfV3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleehgddtjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvuedvvd egkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihgh horghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Oct 2023 18:11:12 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, gregory.clement@bootlin.com, vladimir.kondratiev@intel.com, Jiaxun Yang Subject: [PATCH v2 01/10] MIPS: Export higher/highest relocation functions in uasm Date: Fri, 27 Oct 2023 23:10:57 +0100 Message-Id: <20231027221106.405666-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231027221106.405666-1-jiaxun.yang@flygoat.com> References: <20231027221106.405666-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 15:11:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780948411837708326 X-GMAIL-MSGID: 1780948411837708326 Export uasm_rel_{higher,highest} functions. Those functions can be helpful in dealing with 64bit immediates. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/uasm.h | 2 ++ arch/mips/mm/uasm.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index 296bcf31abb5..12db6d2fca07 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h @@ -196,6 +196,8 @@ void uasm_build_label(struct uasm_label **lab, u32 *addr, #ifdef CONFIG_64BIT int uasm_in_compat_space_p(long addr); #endif +int uasm_rel_highest(long val); +int uasm_rel_higher(long val); int uasm_rel_hi(long val); int uasm_rel_lo(long val); void UASM_i_LA_mostly(u32 **buf, unsigned int rs, long addr); diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c index 125140979d62..6846bf2084c5 100644 --- a/arch/mips/mm/uasm.c +++ b/arch/mips/mm/uasm.c @@ -425,7 +425,7 @@ int uasm_in_compat_space_p(long addr) } UASM_EXPORT_SYMBOL(uasm_in_compat_space_p); -static int uasm_rel_highest(long val) +int uasm_rel_highest(long val) { #ifdef CONFIG_64BIT return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000; @@ -433,8 +433,9 @@ static int uasm_rel_highest(long val) return 0; #endif } +UASM_EXPORT_SYMBOL(uasm_rel_highest); -static int uasm_rel_higher(long val) +int uasm_rel_higher(long val) { #ifdef CONFIG_64BIT return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000; @@ -442,6 +443,7 @@ static int uasm_rel_higher(long val) return 0; #endif } +UASM_EXPORT_SYMBOL(uasm_rel_higher); int uasm_rel_hi(long val) {