Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30688649rwd; Thu, 6 Jul 2023 09:16:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlFeAs9trx+3bt4FX+rgboc67D18FyOKZ+IN4vXQca5k+EBzeghh0IIhrOAFgBsUoVzCoy1F X-Received: by 2002:a17:90b:891:b0:262:ca69:bf9a with SMTP id bj17-20020a17090b089100b00262ca69bf9amr1847122pjb.21.1688660180232; Thu, 06 Jul 2023 09:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688660180; cv=none; d=google.com; s=arc-20160816; b=dnjWaWZRVjRlg7D1MbV4OYsCNtZ+RPnCzKRmxG9zm8Nuwbo4ahlVgHGB6XGwpmYrR+ JiCt80MYnygHtod17AHj/m+ByX1xsb2rGaFciIUDndGHuXSg9pR+Ou7MD3v8yE6xQnPY nkFm0hhCFO77TERHaLoiv52HUjXROcPW5JYBncHc3f7AAT7VIaE6eU7/g9NYSpJ8epE1 DhgCrW3W4IhOG4dahf3bShYl7CKDYF+0gzyG4gukMGp2gH1erDKHOj455Yc1KYhIv6mS IJ2BX3FZbMm01rtyOWCEUSL3ARFD7PjOEY6cQsXiHEppgHNbehyFhx0harkSzeSMbYTq BsMA== 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=tzZiG+lU/mpwC2M6do1wPfvjsF6WIZJJprfTB9qP0II=; fh=ubdy/PBAtYfORAViLUf1QLnHIf5kc6J5VKbwuOo9FZY=; b=QBNdjO2+D9qc2bqw4CAFHfPwj4wuzWyU8vGRgqTT0/Jr8BlDt4DKlJA6OEO7mOSMF0 uQxDPV/S2UdMYg2m6JSHGHNQS5fGmqSb7DsVrLxyV2BM1/Kk3OZrxEoVzNNid2m/Nl+c CzWDfHnGBHtOgGH+2imEM2KUCK732Br1ejaR8e5ACjv0GSTgrBpza2PAGdUXjyOsI/CI FfH0PM2Sw5M21n3yUUN9PfOyGE89aayrtouHyiRcbJyBf+xgiY/3UNll2DOrjgT18sRx 79eb4kFP7PV6rVJ1cK+OmSwUq8N3p7W+6bbaJZ17YnILoAIzf7CB5AXhnLNSZA/ojp3y yD8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XXK4y2mN; 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 8-20020a17090a0f8800b00262ef440ed4si13039pjz.27.2023.07.06.09.16.04; Thu, 06 Jul 2023 09:16:20 -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=XXK4y2mN; 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 S232033AbjGFPs6 (ORCPT + 99 others); Thu, 6 Jul 2023 11:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjGFPsf (ORCPT ); Thu, 6 Jul 2023 11:48:35 -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 B029A212B for ; Thu, 6 Jul 2023 08:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688658445; 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=tzZiG+lU/mpwC2M6do1wPfvjsF6WIZJJprfTB9qP0II=; b=XXK4y2mN82z3Br8kxvhnBDEDS/ASQ3WF7kFSrZnKyFS7VhXuyh2np9aW8EPPZ0Mx8v4UBS 0HnzpM8uWhlX6b7xGBuwa/ahzI1D8BBV8VZyeplJJH73MPyC57/V2d0CSwJNncGaB2jfAX YilBWNbeBn4UDkbI7Beutqh/zzmhu2s= 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-672-0iqGGaRmOUaijaM3Mod1VQ-1; Thu, 06 Jul 2023 11:47:20 -0400 X-MC-Unique: 0iqGGaRmOUaijaM3Mod1VQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E391B800CB3; Thu, 6 Jul 2023 15:47:18 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1BA3F5CF0; Thu, 6 Jul 2023 15:47:09 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, linux-mm@kvack.org, arnd@arndb.de, hch@lst.de, christophe.leroy@csgroup.eu, rppt@kernel.org, willy@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, shorne@gmail.com, David.Laight@ACULAB.COM, deller@gmx.de, nathan@kernel.org, glaubitz@physik.fu-berlin.de, Baoquan He , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH v8 11/19] sh: add including Date: Thu, 6 Jul 2023 23:45:12 +0800 Message-Id: <20230706154520.11257-12-bhe@redhat.com> In-Reply-To: <20230706154520.11257-1-bhe@redhat.com> References: <20230706154520.11257-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 In , it provides a generic implementation of all I/O accessors. For some port|mm io functions, SuperH has its own implementation in arch/sh/kernel/iomap.c and arch/sh/include/asm/io_noioport.h. These will conflict with those in and cause compiling error. Hence add macro definitions to ensure that the SuperH version of them will override the generic version. Signed-off-by: Baoquan He Cc: John Paul Adrian Glaubitz Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- 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