Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7793409rwd; Tue, 20 Jun 2023 06:23:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7P85DJkqmmmVFlRqGtMV1EjWwbdty/SrWsYze0cKhhXpsD7e2A/O1CkbTtqM07IemeQxaG X-Received: by 2002:a17:90a:28a3:b0:255:c829:b638 with SMTP id f32-20020a17090a28a300b00255c829b638mr6701074pjd.9.1687267408685; Tue, 20 Jun 2023 06:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687267408; cv=none; d=google.com; s=arc-20160816; b=QRiAuN/dfHMPIz28aBKyoogtfVvs0Cbt1Lo9ep16QFKcAJIboVxjvmbpIxjWT+YTUu IA4FvK3cAbLxhCFK5Sudz8PTOwHUfr1flYp4PPfFLBKVxCes3aKHtxz5c5RcoMuzbrlY SLWlqsU8yAIxX8Hjq0Ecnp4deqy2psgA0KP+ULUZASys/UU0uw41zOxIh/MZoEDNcBhq QB2idPdBY7qxmXS6/j07TgoZAElqnQUS63UOGkFOPBANrPrT6gZtFsONyI6oDZQ6HabU ptPcRgq7o9o8GD7iNNhh0Krqrt8g9zIBize5qePf4PIFBj3Zhey+cWgVtbFi9YP5aKtB N6bg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf4-20020a17090305c400b001b046acc851si1747199plb.358.2023.06.20.06.23.11; Tue, 20 Jun 2023 06:23:28 -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 S231396AbjFTNSJ (ORCPT + 99 others); Tue, 20 Jun 2023 09:18:09 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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(); -- 2.34.1