From nobody Sun Oct 24 18:54:06 2021 X-Original-To: dev-commits-src-branches@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 982D8182064D; Sun, 24 Oct 2021 18:54:06 +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 4HcnLQ3rm8z3hCn; Sun, 24 Oct 2021 18:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 64EF31AB97; Sun, 24 Oct 2021 18:54:06 +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 19OIs6ih080953; Sun, 24 Oct 2021 18:54:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19OIs6eB080952; Sun, 24 Oct 2021 18:54:06 GMT (envelope-from git) Date: Sun, 24 Oct 2021 18:54:06 GMT Message-Id: <202110241854.19OIs6eB080952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: feb3031f0ae8 - stable/13 - LinuxKPI: Implement _ioremap_attr for riscv List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: feb3031f0ae878b72b48488fe3ba13884ae58b7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=feb3031f0ae878b72b48488fe3ba13884ae58b7f commit feb3031f0ae878b72b48488fe3ba13884ae58b7f Author: Jessica Clarke AuthorDate: 2021-10-17 14:32:20 +0000 Commit: Jessica Clarke CommitDate: 2021-10-24 18:51:12 +0000 LinuxKPI: Implement _ioremap_attr for riscv Now that riscv implements pmap_mapdev_attr we can enable the non-stub implementation for riscv, which is needed for drm-kmod to not fail at run time for drivers that need to map I/O regions. Reviewed by: hselasky, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32446 (cherry picked from commit 60d962e0410340f107d062e8f4389c0d467613a2) --- sys/compat/linuxkpi/common/include/linux/io.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 074417b892f9..e402ebed0665 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -390,7 +390,7 @@ _outb(u_char data, u_int port) } #endif -#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv) void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #else #define _ioremap_attr(...) NULL diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 247c1f54515e..a1462c6a7010 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1822,7 +1822,7 @@ vmmap_remove(void *addr) return (vmmap); } -#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv) void * _ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr) { @@ -1845,7 +1845,7 @@ iounmap(void *addr) vmmap = vmmap_remove(addr); if (vmmap == NULL) return; -#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) || defined(__riscv) pmap_unmapdev((vm_offset_t)addr, vmmap->vm_size); #endif kfree(vmmap);