From patchwork Tue Jun 20 13:13:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 110486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3666107vqr; Tue, 20 Jun 2023 06:30:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tvfrgrwTWGbPfwXNO0JxuRbPm5kIXto1JertqVmxWHj68ulmINvKpeuvoi3JOauWGNiy7 X-Received: by 2002:a05:6a00:cc4:b0:63d:47ab:65ed with SMTP id b4-20020a056a000cc400b0063d47ab65edmr10065217pfv.7.1687267814207; Tue, 20 Jun 2023 06:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687267814; cv=none; d=google.com; s=arc-20160816; b=LzFEdNS9OG2h7n7Bh1L7JHSeFvBuIqOOLB8wbT9AFIHz3EM2IsBB4zrVskaNR/bkq5 oE3R9xunbXLDeDhzaPeG5p9Qeb6np/HGe5F6vReskYLV2IK/BZ0ITmzTc10AA6s4xqbi kYZkhII3OXmVTwjWa6EUeSgSaFN+b/ya0yakpuY79d7rSPhNGZb2Ep/53sXR1BhF5JRR +EO63TBBdXynNWkxHMfV51DPyXN4TTKE54iNU9zmQ7D9uOE5GvKAI3FhfhheVzdTFZ/g PFu4Eop/twV14GE9p7fqVATiXgxzlcSCL14IH8xJR32ZCgwMD1/J/pKekoKYS+W9uDts Sgqg== 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=VZ/Dh6S9uhSGanp847Ckw34lDf4ceJX1gVAd67nEVDo=; b=07nyl0uEkgDdSKun3e/A/dlNw6VKD7QMHesmSR7JxOV20BbnoOBt7PVbGpIDRPTkPo hFD4Rjhje5Da5HkywZL+cz3FAFz54cDGF8DoQwgcYylYeNY2DLUzBc7KiPU1mz84Hl8A Bb9OYjOv9XpQHKrLVA4uRy57LySqn82WFSv3bMzi92OytMF9+1f6YatUBL22fh7lcKip 1pU0OhSIJPQHJfDzE0oSR03oDebw1o/b+kck+/LLTwvrB8LoMSaIGelIL/7KjAZCCvqa xx8fO9ouJGsZUYA63nZILzaQ7SdVXka8B4fst812atCmz6SWZqjiHc/NRM5orJF1xUuo 7llQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H94uaI8n; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u21-20020a627915000000b00666737b2b8bsi1749797pfc.383.2023.06.20.06.30.01; Tue, 20 Jun 2023 06:30:14 -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=H94uaI8n; 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 S231968AbjFTNSK (ORCPT + 99 others); Tue, 20 Jun 2023 09:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231329AbjFTNR7 (ORCPT ); Tue, 20 Jun 2023 09:17:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EC1995 for ; Tue, 20 Jun 2023 06:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687266993; 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=VZ/Dh6S9uhSGanp847Ckw34lDf4ceJX1gVAd67nEVDo=; b=H94uaI8nuMH8GZr27NRs7i/anKbvX+usH2FXsd65REprpPlJouRMn59g9vOL/r2DU9Sh8N Ipmia6/0gRia8xhum91Ts0lkJO7Q3DUtfLPrztZ1pHu+gVmMeUX5AFjkUw+YEGnQVme4JZ qVtI7/zzemTjGuPXpE7QqbrtSKJUBEs= 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-131-H9U8zhlLOZ68Ze0TdGrliQ-1; Tue, 20 Jun 2023 09:16:31 -0400 X-MC-Unique: H9U8zhlLOZ68Ze0TdGrliQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63255830F28; Tue, 20 Jun 2023 13:15:54 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-166.pek2.redhat.com [10.72.12.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CA5CC1ED96; Tue, 20 Jun 2023 13:15:44 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.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, David.Laight@ACULAB.COM, shorne@gmail.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 v7 11/19] sh: add including Date: Tue, 20 Jun 2023 21:13:48 +0800 Message-Id: <20230620131356.25440-12-bhe@redhat.com> In-Reply-To: <20230620131356.25440-1-bhe@redhat.com> References: <20230620131356.25440-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769228535635885576?= X-GMAIL-MSGID: =?utf-8?q?1769228535635885576?= 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: 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();