From nobody Mon Oct 17 20:41:34 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MrpnC0Dk0z4fQcG; Mon, 17 Oct 2022 20:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MrpnB6w7bz45ym; Mon, 17 Oct 2022 20:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666039295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o1+S3IULI+QMG2FocYHpcLF7/4DooCCHvVwuteL1x8w=; b=RM1qu1C/0+CqGiRM8+H6AlF1lUwc/xJvBtDcciFdUBfHVWqIjtCXdY2syJ044cCeioNcku VnCK7zZ5k5IB0J9pmggS9pZMnT9CLSvTlZvqj+YCVnYu6jc0cIciaGYY4wHoB7zjAJHgPB LNIiKlnCs3y0yfP6gCcZYV61qTYxvb7BOipgbM2KgApPigD7hzEDBA2YTiChw9NHLBZtli +qjGksNWZlyIC6al1ZIrtpzUPDeG0D/s/PeKdr7u/LD3p2faie3NUyX4GNV0iObZUv9/9w mrsiN8W7/FFGnOEIJCDkp/OIkYYgSpOH8YNL9/M27E72YhR065AS4LyJ5IRnRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MrpnB61M3zxML; Mon, 17 Oct 2022 20:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29HKfYYg096442; Mon, 17 Oct 2022 20:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29HKfYJM096441; Mon, 17 Oct 2022 20:41:34 GMT (envelope-from git) Date: Mon, 17 Oct 2022 20:41:34 GMT Message-Id: <202210172041.29HKfYJM096441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 97f6fe7f49c7 - stable/13 - LinuxKPI: io.h constify arguments and add more functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 97f6fe7f49c7c41ecd6c9e413b51d55436b93844 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666039295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o1+S3IULI+QMG2FocYHpcLF7/4DooCCHvVwuteL1x8w=; b=qTH/Ql3GlJ3M99+yb85MlQi8yprdq2fBT7B6BapdEuySU09M2m74telN5XQfO08/kPCseS JZ0xARL98+8ASpcIzR/ALE+i4M/c39wARVuI7ngoXpwvGZewz9ujcvhY89sSyfDuPgAMDg 8ylchfgSFzEdC8AfvMb/yAe9feFFNq/XLu4lHqKe/sf0jfaZnYVa98ncHb+6LJ5vK0RcrZ sAl65RX/KH1ZN00q7IxoH6Ux54fccohMQyl8P8Qd4pc5Q7rPCYBDGiKFBwF6/8YKWH38qu 571l2lS1YO9HqyMy1ScjYUXaaA2/X01rDLkRuQqy4SB/LvzbNiJeSNcwDhn/HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666039295; a=rsa-sha256; cv=none; b=V9OxVlvLJGHMvPT+U+Q08AhmBZmkFwzXVUoiFR5Ul50G1ZSux4tEXFKj8EKib4CavG40QT YwaUK6y1WXURYN5FS0yWgyhUBDASCzvexEVafuqlsZCmWJJ9SUrl6aKhcwhDYKo57sra3R av0UaVm7htK2/m40I1yvdmuUy4jHx6RhAn0xej05ZTgT2qJEP9ffNlw/vQG4sxGV2EC9J/ YJtW+TRAhpbYkEyJcEkPOuzWy0fw9z00Ucmio8OK/D1izyXRNfmDPF6pc2TZZmorQjJWkv 1t6L4Orhxb4tzNrwV2Q1hylyuG+KWqKPtl3huklyocfI/74h4wDmT9NmcGU03A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=97f6fe7f49c7c41ecd6c9e413b51d55436b93844 commit 97f6fe7f49c7c41ecd6c9e413b51d55436b93844 Author: Bjoern A. Zeeb AuthorDate: 2022-09-21 19:55:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-10-17 20:37:04 +0000 LinuxKPI: io.h constify arguments and add more functions Constify "*from" arguments and add __ioread32_copy() and __ioread64_copy() based on the already existing implementations. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36657 (cherry picked from commit 046b82842c61c2d5d1648b5024958827e0a85725) --- sys/compat/linuxkpi/common/include/linux/io.h | 34 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 6ee4753a2df5..7041710fe0c2 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -429,9 +429,9 @@ void iounmap(void *addr); #define memcpy_toio(a, b, c) memcpy((a), (b), (c)) static inline void -__iowrite32_copy(void *to, void *from, size_t count) +__iowrite32_copy(void *to, const void *from, size_t count) { - uint32_t *src; + const uint32_t *src; uint32_t *dst; int i; @@ -440,10 +440,10 @@ __iowrite32_copy(void *to, void *from, size_t count) } static inline void -__iowrite64_copy(void *to, void *from, size_t count) +__iowrite64_copy(void *to, const void *from, size_t count) { #ifdef __LP64__ - uint64_t *src; + const uint64_t *src; uint64_t *dst; int i; @@ -454,6 +454,32 @@ __iowrite64_copy(void *to, void *from, size_t count) #endif } +static inline void +__ioread32_copy(void *to, const void *from, size_t count) +{ + const uint32_t *src; + uint32_t *dst; + int i; + + for (i = 0, src = from, dst = to; i < count; i++, src++, dst++) + *dst = __raw_readl(src); +} + +static inline void +__ioread64_copy(void *to, const void *from, size_t count) +{ +#ifdef __LP64__ + const uint64_t *src; + uint64_t *dst; + int i; + + for (i = 0, src = from, dst = to; i < count; i++, src++, dst++) + *dst = __raw_readq(src); +#else + __ioread32_copy(to, from, count * 2); +#endif +} + enum { MEMREMAP_WB = 1 << 0, MEMREMAP_WT = 1 << 1,