Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1737285rwd; Fri, 9 Jun 2023 01:07:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63zCvQag7tsH3SrsBQsvsoY+uYmzdGnsD6O31gJnhai88ebM7/M/BOJi8fxE5bTX09lndc X-Received: by 2002:a92:c6ce:0:b0:33d:5314:d74b with SMTP id v14-20020a92c6ce000000b0033d5314d74bmr1078483ilm.17.1686298026535; Fri, 09 Jun 2023 01:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298026; cv=none; d=google.com; s=arc-20160816; b=bDXznz8THnCfE2EIOEjLpQg/y2ot127aYV8Z04JhZ3Rvh+tBLUq7A4v6qDLb5bBwHw iZmz8WE34wUuUFr/klbkbbZCKjFF78DW9gzx6pBcQQ98XQT8MOCsMBHTXbx0oGjLYgso sRSKmlQo0G9RSi0CmzEsZgrr6x6Yo6+LU4Nn68xLZ4rN8oSDKzBePGXGPhZu8w7WWJFZ JswbEOqDFftUJoyjLv8AcoYmPkBJHU9gqBNiF9oeKaTGA1EGLDsxF98gJ5g1x07sIuf0 9Q1FclEkwsJ/gagxp1LDmF26HDkamjRAGhxihTL0mWvAChW1mQ2o5xo7r0eutzySyRNT 39nQ== 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=LUIKuTNwx3aGCN/mpc81rLXKw/yQlIAJox5sUw6Md70=; b=Jdb9dprdyKx8Tip3f8OZcB7LbO/4u4d8Ds5rn6/wT1SVClkF74BqPIsP3JlNdsMmjR dvcCogtzAWevQclb3gf1O0UAaQ/mwMPddVGYHNXbsbHmomnJelyYB9Xbnj2L7MWIyJDZ dJ43zHABFe3w1hbqdgS8xUjWsM4mCV6/XDVrC0/oCilwL+BikZbT6zgHWBtgTeie6N4f n7gh0UCvrCaETAK/5u8RNQmT3J2FqJMZTb4CYmAT8QUjJQOQ+kH29YpTTAqcYPFGJyMv Bt9omuO+VMWWWpy2zwxoFiIYxZvx2+njGjIDwAoz/XjSL07giRwnrlq/W1m27BTktYAj SZpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QQaoXk5p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a6552cb000000b00543fd615d2fsi2218895pgp.879.2023.06.09.01.06.52; Fri, 09 Jun 2023 01:07:06 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QQaoXk5p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238780AbjFIIAC (ORCPT + 99 others); Fri, 9 Jun 2023 04:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239993AbjFIH7R (ORCPT ); Fri, 9 Jun 2023 03:59:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C80D4239 for ; Fri, 9 Jun 2023 00:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686297439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LUIKuTNwx3aGCN/mpc81rLXKw/yQlIAJox5sUw6Md70=; b=QQaoXk5pUhx1ca+IAgr6kAim40HfzPW7r8rVtLI8DDfZ+YdqwO9AC1tGzALe6isZGdKe3d tkBJ77LHOHUWxqEfdh6YSRURFriqWEcwRa3shUbCLXfkObWZdSJwCGmVg43GiOAfOrm6lc OhMQxI2x3JhUAANxJ6TRNc+RcQ92lM4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-298-qdGF8u1yOFKOwOjmf_5LtQ-1; Fri, 09 Jun 2023 03:56:57 -0400 X-MC-Unique: qdGF8u1yOFKOwOjmf_5LtQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7360385A5BB; Fri, 9 Jun 2023 07:56:56 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-92.pek2.redhat.com [10.72.12.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id E440120268C6; Fri, 9 Jun 2023 07:56:48 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, hch@lst.de, rppt@kernel.org, willy@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@ACULAB.COM, shorne@gmail.com, deller@gmx.de, Baoquan He , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH v6 11/19] sh: add including Date: Fri, 9 Jun 2023 15:55:20 +0800 Message-Id: <20230609075528.9390-12-bhe@redhat.com> In-Reply-To: <20230609075528.9390-1-bhe@redhat.com> References: <20230609075528.9390-1-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Also add macro definitions for port|mm io functions since SuperH has its own implementation in arch/sh/kernel/iomap.c and arch/sh/include/asm/io_noioport.h. These will conflict with the port|mm io function definitions in include/asm-generic/io.h to cause compiling errors like below: ==== CC arch/sh/kernel/asm-offsets.s In file included from ./arch/sh/include/asm/io.h:294, from ./include/linux/io.h:13, ...... from arch/sh/kernel/asm-offsets.c:16: ./include/asm-generic/io.h:792:17: error: conflicting types for ‘ioread8’ 792 | #define ioread8 ioread8 | ^~~~~~~ ./include/asm-generic/io.h:793:18: note: in expansion of macro ‘ioread8’ 793 | static inline u8 ioread8(const volatile void __iomem *addr) | ^~~~~~~ In file included from ./arch/sh/include/asm/io.h:22, from ./include/linux/io.h:13, ...... from arch/sh/kernel/asm-offsets.c:16: ./include/asm-generic/iomap.h:29:21: note: previous declaration of ‘ioread8’ was here 29 | extern unsigned int ioread8(const void __iomem *); ==== Signed-off-by: Baoquan He Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- v5->v6: split that inclusion of include/asm-generic/io.h and redefining of the helpers from the old patch 11 into this prep patch - Christoph arch/sh/include/asm/io.h | 25 +++++++++++++++++++++++++ arch/sh/include/asm/io_noioport.h | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index fba90e670ed4..270e7952950c 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -119,6 +119,26 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); __BUILD_MEMORY_STRING(__raw_, q, u64) +#define ioread8 ioread8 +#define ioread16 ioread16 +#define ioread16be ioread16be +#define ioread32 ioread32 +#define ioread32be ioread32be + +#define iowrite8 iowrite8 +#define iowrite16 iowrite16 +#define iowrite16be iowrite16be +#define iowrite32 iowrite32 +#define iowrite32be iowrite32be + +#define ioread8_rep ioread8_rep +#define ioread16_rep ioread16_rep +#define ioread32_rep ioread32_rep + +#define iowrite8_rep iowrite8_rep +#define iowrite16_rep iowrite16_rep +#define iowrite32_rep iowrite32_rep + #ifdef CONFIG_HAS_IOPORT_MAP /* @@ -225,6 +245,9 @@ __BUILD_IOPORT_STRING(q, u64) #define IO_SPACE_LIMIT 0xffffffff /* We really want to try and get these to memcpy etc */ +#define memset_io memset_io +#define memcpy_fromio memcpy_fromio +#define memcpy_toio memcpy_toio void memcpy_fromio(void *, const volatile void __iomem *, unsigned long); void memcpy_toio(volatile void __iomem *, const void *, unsigned long); void memset_io(volatile void __iomem *, int, unsigned long); @@ -287,6 +310,8 @@ static inline void iounmap(volatile void __iomem *addr) { } */ #define xlate_dev_mem_ptr(p) __va(p) +#include + #define ARCH_HAS_VALID_PHYS_ADDR_RANGE int valid_phys_addr_range(phys_addr_t addr, size_t size); int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noioport.h index f7938fe0f911..5ba4116b4265 100644 --- a/arch/sh/include/asm/io_noioport.h +++ b/arch/sh/include/asm/io_noioport.h @@ -53,6 +53,13 @@ static inline void ioport_unmap(void __iomem *addr) #define outw_p(x, addr) outw((x), (addr)) #define outl_p(x, addr) outl((x), (addr)) +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl + static inline void insb(unsigned long port, void *dst, unsigned long count) { BUG(); -- 2.34.1