Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp954625rdb; Fri, 1 Dec 2023 03:17:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIaqZhtItVDaZPVfDGp4goKJ3eWBs0BYd8bhS86/qCZAOqf2TQeOtunTKXaQjz+SiaYaiy X-Received: by 2002:a05:6a20:1612:b0:18b:8dfa:8946 with SMTP id l18-20020a056a20161200b0018b8dfa8946mr27413057pzj.13.1701429429746; Fri, 01 Dec 2023 03:17:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701429429; cv=none; d=google.com; s=arc-20160816; b=g8sQaQzhomhzqiN97WmJFjj0u8aXM3uA10dAFypwPzc6C7Ra0zm8f2cBRGVs5yFV9n Ew40an7jMcxY8KDJ818ql4kqfuPKl5rWrslzERca/z21BW+kaQS66BNy0HKb6YNm5IMG 0PZp/dZf0yL0Cv3bFZFTnK8VlP8PSqaWVQbPoFk2A36zDssElnhr+hiCvXJeflXSKdeY 4ACAz39+gvORwNunu5JbVWyEPeEBpOSVPwtQ4RRVySt/cwLj6JLZUIkcOMs14yknz0k7 96R7+ms+Nv6SIeUCAlZyNG15IMS6Q0JlRpTqrP7vgGHDx9WtfGbfxWxv/LK1exNoiU6o B6mA== 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 :dkim-signature; bh=1f+FndhwKpT84ogIpFFowDtfhlo7ZPzn2H3k9c4MjvQ=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=zfCYOW7Hw0Wiea2Gncj2HjlKZ3eD/G1MhorS6FPifmFS/BqP/tBSMOqBEiV/3oayHV 6lEIbzF1ie40eyigpvOSBDq3hDES/rAIEfau2OcpJWx5/IXJRbDyhQERvQpDCJu8e55V NZS2RZQkEeGhhS3CbfRj83RkiT/k6vIMXPZG0xiY6earUU9ZCfRzAUZ1Js+yHTChNEDB tkTrssXbpgAH0W4GS3fJ5NhJA5x/l6Elsu7jmj8aIv952p0f3brhf6HcKhCOdpDKgLKk wni4raYzkEiXFCpWerH65gbKV4fYjFfU09g/JpySzOwwhtT4zUHoKzaoKS7wuaqV1Y3J 4izQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=X5zEUwuj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ck24-20020a056a02091800b005c5fe3ad1fdsi3190551pgb.357.2023.12.01.03.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 03:17:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=X5zEUwuj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A1D458057E40; Fri, 1 Dec 2023 03:16:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378554AbjLALPe (ORCPT + 99 others); Fri, 1 Dec 2023 06:15:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378501AbjLALPT (ORCPT ); Fri, 1 Dec 2023 06:15:19 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D61210DB; Fri, 1 Dec 2023 03:15:24 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3FB841C000E; Fri, 1 Dec 2023 11:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701429323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1f+FndhwKpT84ogIpFFowDtfhlo7ZPzn2H3k9c4MjvQ=; b=X5zEUwuj3+oWJrDX5oPjDahxnNQgwXPnT5JCIbmZIln9Qr9Q4mRhP8IpucdJpfotF6Itca 5iazj5uWge7Hu4rIQ6a78hp4hp0/oOye/UQXEMfqwJV8n0fu2TnzZoNTIUfx8Zf4R9u0nQ 8d0q3IkmxFCI3H2qVr+EBHGGvmfumHe4lyE0ds3UZvnGfHPlYnnu4hwgSwI+oEI/d5OkLS dww6KkZqlizxNaIcHfxlBqZaKHVBXWqnZTZFUqXEqme55jeQt1oRGPezg/eIwscPeUUVkW 3LKSDsa+8OsWF/UiKvJZ2t4wGwm07p4dFWJIYp+YZS/dpl7KA13dfjT9/eYBtQ== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Thomas Petazzoni Subject: [PATCH v3 02/22] MIPS: Export higher/highest relocation functions in uasm Date: Fri, 1 Dec 2023 12:14:45 +0100 Message-ID: <20231201111512.803120-3-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231201111512.803120-1-gregory.clement@bootlin.com> References: <20231201111512.803120-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: gregory.clement@bootlin.com 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, SPF_HELO_PASS,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 03:16:03 -0800 (PST) From: Jiaxun Yang 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 296bcf31abb57..12db6d2fca070 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 125140979d62c..6846bf2084c5e 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) { -- 2.42.0