Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5391620imd; Tue, 30 Oct 2018 17:15:07 -0700 (PDT) X-Google-Smtp-Source: AJdET5dVIMMoGS0J/Has7jr13Bg7QvuzBnGEiL+CwDDDN5WuWI2qvxs+i2tEFFMsTjjarX0MTHXF X-Received: by 2002:a63:4a4a:: with SMTP id j10-v6mr889746pgl.0.1540944907186; Tue, 30 Oct 2018 17:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540944907; cv=none; d=google.com; s=arc-20160816; b=f3i2I+4Z/j68V8qzMQ73dh+6s6x1izQQHmfeySHby0gHXmW+1m/DFR7yF4eNJ4q4H/ ZxtPOm23QM4p6C14SIfu1LzVPo8WK4H0Liu86dvkz3d7ZoUrc8vRuZ8XKHD4SDAJQtgR ZbB2Bvu3H4MrE8yCtw13f878UwfAF3HTldbBG/K+DhdChH6PrS01f4KODLzrVrLtxb/8 3y53jqYMk5FwACKhjozFplxN50pW1KZdKXgI2WjBCPEBnK+BnqchrUXzZYvvSQdNVh9d NhwBs1wG+TnsrTqiznXG3iuhTe235JHUYLoclGjN85+sG4uYqL1f0uXNOJ8zGL0wwR0A sVrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=FSOhZ3ryZkqtCoQg5utGGQFoOYf7wfsxoCZco3ZZqSw=; b=eKElqPpTi1wtoyOQ4a/QI/D7IpQIMxKHW6MFCbk1/Vo+ckkHfQub01zLaBXu543ngJ 64Q2ytDH+YW2iJbg/aQgBv6Sf1IGGUviIwRBzywougQLJ0HUvsTIQzbBaJvmeJuPl6lq tepjN8gJY8/4vZN5mSHFyUD5ANSUvyjDHPoo3N/Wi0iQbmj+URhCyV5g8ivN+C6hWIk9 Nsnrs16ig4FAEVqZiouaW87/rDECimGompt5teRjC+uXBMAL5viUZxWOq0Yx5U+uwAmD xkC3xOCYLkn8n4kwK0i6hT7ayJpF//p4nqtxCmN5Ragq1isYy1CvkaiFGGYwNyWRSLlv qc4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=fk7GOstm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14-v6si21917690pge.225.2018.10.30.17.14.50; Tue, 30 Oct 2018 17:15:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=fk7GOstm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728438AbeJaJAH (ORCPT + 99 others); Wed, 31 Oct 2018 05:00:07 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44371 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727948AbeJaJAH (ORCPT ); Wed, 31 Oct 2018 05:00:07 -0400 Received: by mail-pl1-f194.google.com with SMTP id s5-v6so4690841plq.11 for ; Tue, 30 Oct 2018 17:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=FSOhZ3ryZkqtCoQg5utGGQFoOYf7wfsxoCZco3ZZqSw=; b=fk7GOstmST086IhkAIsRudbrBOE+2OSd9s5SZZs9D7MMmXwWaEHpzcIgZDYE76JPt5 5Fo/RKUNGtU1YtpqO+yDzODGi5U/dN/lbHB68MI7Rf2tdmNZsh8xLp770BfgL9qj7T5v Uk7bKBuyVPd/HY80Kwm3IvBWOyhkk/PAthSLzVdtJE9Vq90wf1khjYGgUH9pIECHr5D0 BV9sgEvRrAeG3eq7b76E7Fk5ryaV1m4bH+uo+yZZPv1hiAfKXQFg1TTdKqo+ooNJ/ByR dixyhPJLaWISj+gtwFQq+dtmpn7yrfLEPqSV7y/dVDvoofNbSYMEX7p9yThRwg8tXMo/ lq/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FSOhZ3ryZkqtCoQg5utGGQFoOYf7wfsxoCZco3ZZqSw=; b=epsu5fiKeH7SL0oCzYqgIzd8WgEOjx/L72iXeUPZJ3ThNsMo0PKYPfRUjcKXczDEi/ RipRyS0NIJAbSRYe6uoDGvv299gfmVuEHpytxaDnMj22G+au7sn9yEaxo/KsxPv/oN+v xgRU3lh2PnUYuCf/dvAB4axw5F98KBD/KwXyo+rBr3OFGXf5xUOQtVrNru3bVl0XzT16 TaR6SLo/WbC+Y9j27/hRpm945uzNcw5ExPnlcn5m16MHZfNQrOMF3aHUwpX/t8XX3DRq JDDdYmtDRGtRSaFwj7H6pTt5csPoTopKp9+e3/0PMIkulBic0gTEtgwU4xj66ZMY72vy ZUJA== X-Gm-Message-State: AGRZ1gKkResOdi9n07Yvi/0is+R8GK98SyN6G96CTgxJEqkDLySam+0R 5XGqAK9P9hBaHvQMzc1nhH9kog== X-Received: by 2002:a17:902:14e:: with SMTP id 72-v6mr797127plb.299.1540944267051; Tue, 30 Oct 2018 17:04:27 -0700 (PDT) Received: from localhost.localdomain (99-152-116-91.lightspeed.sntcca.sbcglobal.net. [99.152.116.91]) by smtp.gmail.com with ESMTPSA id o27-v6sm24638235pfk.85.2018.10.30.17.04.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 17:04:24 -0700 (PDT) From: Olof Johansson To: Palmer Dabbelt Cc: Albert Ou , Zong Li , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Olof Johansson Subject: [PATCH] RISC-V: lib: Fix build error for 64-bit Date: Tue, 30 Oct 2018 17:04:13 -0700 Message-Id: <20181031000413.30123-1-olof@lixom.net> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes the following build error from tinyconfig: riscv64-unknown-linux-gnu-ld: kernel/sched/fair.o: in function `.L8': fair.c:(.text+0x70): undefined reference to `__lshrti3' riscv64-unknown-linux-gnu-ld: kernel/time/clocksource.o: in function `.L0 ': clocksource.c:(.text+0x334): undefined reference to `__lshrti3' Fixes: 7f47c73b355f ("RISC-V: Build tishift only on 64-bit") Signed-off-by: Olof Johansson --- arch/riscv/lib/Makefile | 2 +- arch/riscv/lib/tishift.S | 59 +++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile index 5739bd05d289e..4e2e600f7d538 100644 --- a/arch/riscv/lib/Makefile +++ b/arch/riscv/lib/Makefile @@ -3,6 +3,6 @@ lib-y += memcpy.o lib-y += memset.o lib-y += uaccess.o -lib-(CONFIG_64BIT) += tishift.o +lib-$(CONFIG_64BIT) += tishift.o lib-$(CONFIG_32BIT) += udivdi3.o diff --git a/arch/riscv/lib/tishift.S b/arch/riscv/lib/tishift.S index 69abb1277234b..237bc9fd07636 100644 --- a/arch/riscv/lib/tishift.S +++ b/arch/riscv/lib/tishift.S @@ -10,33 +10,36 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ - .globl __lshrti3 -__lshrti3: - beqz a2, .L1 - li a5,64 - sub a5,a5,a2 - addi sp,sp,-16 - sext.w a4,a5 - blez a5, .L2 - sext.w a2,a2 - sll a4,a1,a4 - srl a0,a0,a2 - srl a1,a1,a2 - or a0,a0,a4 - sd a1,8(sp) - sd a0,0(sp) - ld a0,0(sp) - ld a1,8(sp) - addi sp,sp,16 - ret + +#include + +ENTRY(__lshrti3) + beqz a2, .L1 + li a5,64 + sub a5,a5,a2 + addi sp,sp,-16 + sext.w a4,a5 + blez a5, .L2 + sext.w a2,a2 + sll a4,a1,a4 + srl a0,a0,a2 + srl a1,a1,a2 + or a0,a0,a4 + sd a1,8(sp) + sd a0,0(sp) + ld a0,0(sp) + ld a1,8(sp) + addi sp,sp,16 + ret .L1: - ret + ret .L2: - negw a4,a4 - srl a1,a1,a4 - sd a1,0(sp) - sd zero,8(sp) - ld a0,0(sp) - ld a1,8(sp) - addi sp,sp,16 - ret + negw a4,a4 + srl a1,a1,a4 + sd a1,0(sp) + sd zero,8(sp) + ld a0,0(sp) + ld a1,8(sp) + addi sp,sp,16 + ret +ENDPROC(__lshrti3) -- 2.11.0