From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 354EFC38A2D for ; Thu, 16 Apr 2020 22:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04367221F7 for ; Thu, 16 Apr 2020 22:01:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="YTKh5bQq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728791AbgDPWBl (ORCPT ); Thu, 16 Apr 2020 18:01:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728726AbgDPWBe (ORCPT ); Thu, 16 Apr 2020 18:01:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CDFFC061A0C for ; Thu, 16 Apr 2020 15:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=7eAIqFXSDQFiyBAhlUDSnkB/PjfNj7n3kLMRm+bVFLI=; b=YTKh5bQqHDJkaWHFXj2EopFsaO 00Zz8mDEFBwZV0RJdcdGBpvUunhjirVXi7SQSCL+bqP2VXWpf6x6wY+z6Dxw4jlKhot1SS9USBqMm BRibAHDz80J2e4ouxR9ZiaxQfQXG4wRoin92PPTyedUntBGKybYjT9g1bepA4kl/7C0foEnXPMkrF xWjO+ur1enYHMP+k6IYtZEqclxIX+PggNsGorNMVGx4/lJOrulUan4DoAE5L+1UYxQZqo+hzrPZhG HJv2YXsEMtORSxUSXNig4M0pJgfAVGMqOGoqaWT15K1BV1M5y83dafcNVVKGVhO6N/uk4soFYIB8T o4fbx7UQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPCZg-0003UR-Hw; Thu, 16 Apr 2020 22:01:32 +0000 From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Subject: [PATCH v3 05/11] riscv: Add clear_bit_unlock_is_negative_byte implementation Date: Thu, 16 Apr 2020 15:01:24 -0700 Message-Id: <20200416220130.13343-6-willy@infradead.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200416220130.13343-1-willy@infradead.org> References: <20200416220130.13343-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: "Matthew Wilcox (Oracle)" This is the generic implementation. I can't figure out an optimised implementation for riscv. Signed-off-by: Matthew Wilcox (Oracle) Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org --- arch/riscv/include/asm/bitops.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/include/asm/bitops.h b/arch/riscv/include/asm/bitops.h index 396a3303c537..f2060c126a34 100644 --- a/arch/riscv/include/asm/bitops.h +++ b/arch/riscv/include/asm/bitops.h @@ -171,6 +171,13 @@ static inline void clear_bit_unlock( __op_bit_ord(and, __NOT, nr, addr, .rl); } +static inline bool clear_bit_unlock_is_negative_byte(unsigned int nr, + volatile unsigned long *p) +{ + clear_bit_unlock(nr, p); + return test_bit(7, p); +} + /** * __clear_bit_unlock - Clear a bit in memory, for unlock * @nr: the bit to set -- 2.25.1