From nobody Thu Jul 28 22:55:40 2022 X-Original-To: dev-commits-src-main@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 4Lv5bK19Spz4XCgq; Thu, 28 Jul 2022 22:55:41 +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 4Lv5bK0fMcz43Sc; Thu, 28 Jul 2022 22:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659048941; 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=z2o3Oh2JXkl43CaC+m4QUiA+cYvuyxPKlmogQrlZ1Gw=; b=rrjhg3ai894G3DCFCsbyKsyLCDf2Ac24jO+UBY1UUTJFT+mfdieghpJSvRyIL2JKHDdQ9u YwB4AKsUKKN6/Y7ZjC/wfd6CrFiARdYuLAl7/mU0icJbuUuifNQwmu3TQEjP0N4kAmq17L wfLqM4j1fUUBasA+6gtKcUhxmJd/XByIRlvzxHLMoykmGI2mDjtPHcoEu2fiTj4f5o0YkH mtVBZ2yDX3E4MwOtlE+ta4DrEcOI+GKs9jV2bxCHxKsofIBVns1jLnPa7flh8ziPnFRMSS Ev7s/R5ebFZyQEqIGPhITEjoZqM//ioc3+wDjy7ygLS60pStxcCBCHwAXz0aow== 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 4Lv5bJ6Lv8z1CMc; Thu, 28 Jul 2022 22:55:40 +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 26SMtefa009295; Thu, 28 Jul 2022 22:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26SMteOh009294; Thu, 28 Jul 2022 22:55:40 GMT (envelope-from git) Date: Thu, 28 Jul 2022 22:55:40 GMT Message-Id: <202207282255.26SMteOh009294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ea8f128c7c17 - main - pmap_mapdev: Consistently use vm_paddr_t for the first argument. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea8f128c7c17d72fc956ee91e415605cff5cc5c3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659048941; 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=z2o3Oh2JXkl43CaC+m4QUiA+cYvuyxPKlmogQrlZ1Gw=; b=BM/NsyXY42DIrs5odg8qELhBLGMc8GbulQFq3SpveXHk7GIOjP9/2rqrVLABQIbUEU2IoH F/LW4Rnjb60ixVXKpZpe+rK35Y45JSPronOyWaa3Iz2zAefuvEvWekN74Qhu7HrztT/nmh YB+H3K4EOBMXeHIDNPM8O2HuFyM2GNbm4efsbKx8V2jALEJfDWRbY3AZhYEWZ4jC4CS4UT ColEwSpBelTMaBR0xB8JKLmfq8UgQzF9HKbLYqX9tsHMwHVSCro47XGgX3xxn5K58Gv4nr 1fChdXo4leLwu13/fFFQ+FvSjjb+at/QO+K5aVNaJTgmUHzJ+qg7Vyla6p2M6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659048941; a=rsa-sha256; cv=none; b=B2xxcU9LIkUv/z8Aj0RVuMrFwIiU6/M8VEArslPsX55/LqXYm5D0joUaxJf2ylba3XIUDZ WWrV9Ruval9qlqFLJ+y3USOjqX3rjs9ECPKIX0pXamTowdU4RiuRO4eube19cqKkvleAKv gKTr8q+oTOI0vtEbYOEUJoowwtJx4uRR+jNM9AktEs+3SiRomqJX8cg5Qhh/HbcPvdxsEf aXH3coMH6vWj+/FhkBiVJDShTi4hxaPFTCVyZbqHvH+Y9+ioFUxgobiNjbzJC4wEiPvXEQ e8cCjyh4LobnRsFwaCl/t8bPSRkBHgCQ5kWb0m5XxhdSqEjRU/qggkwXUUFPdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ea8f128c7c17d72fc956ee91e415605cff5cc5c3 commit ea8f128c7c17d72fc956ee91e415605cff5cc5c3 Author: John Baldwin AuthorDate: 2022-07-28 22:55:10 +0000 Commit: John Baldwin CommitDate: 2022-07-28 22:55:10 +0000 pmap_mapdev: Consistently use vm_paddr_t for the first argument. The devmap variants used vm_offset_t for some reason, and a few places explicitly cast bus addresses to vm_offset_t. (Probably those casts along with similar casts for vm_size_t should just be removed and instead permit the compiler to DTRT.) Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D35961 --- sys/arm/arm/nexus.c | 2 +- sys/arm/freescale/fsl_ocotp.c | 2 +- sys/arm64/include/pmap.h | 4 ++-- sys/kern/subr_devmap.c | 4 ++-- sys/powerpc/powermac/macio.c | 2 +- sys/powerpc/psim/iobus.c | 2 +- sys/riscv/include/pmap.h | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 958d2cc70587..2e825b5f66a9 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -363,7 +363,7 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, } rman_set_bustag(r, fdtbus_bs_tag); #else - vaddr = (bus_space_handle_t)pmap_mapdev((vm_offset_t)paddr, + vaddr = (bus_space_handle_t)pmap_mapdev((vm_paddr_t)paddr, (vm_size_t)psize); if (vaddr == 0) { rman_deactivate_resource(r); diff --git a/sys/arm/freescale/fsl_ocotp.c b/sys/arm/freescale/fsl_ocotp.c index 606c4b54fe61..e757c262e61c 100644 --- a/sys/arm/freescale/fsl_ocotp.c +++ b/sys/arm/freescale/fsl_ocotp.c @@ -81,7 +81,7 @@ fsl_ocotp_devmap(void) ocotp_size = (vm_size_t)size; - if ((ocotp_regs = pmap_mapdev((vm_offset_t)base, ocotp_size)) == NULL) + if ((ocotp_regs = pmap_mapdev((vm_paddr_t)base, ocotp_size)) == NULL) goto fatal; return; diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index 87527c390f57..6da54a841a28 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -184,13 +184,13 @@ bool pmap_klookup(vm_offset_t va, vm_paddr_t *pa); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); -void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); +void *pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma); bool pmap_page_is_mapped(vm_page_t m); int pmap_pinit_stage(pmap_t, enum pmap_stage, int); bool pmap_ps_enabled(pmap_t pmap); uint64_t pmap_to_ttbr0(pmap_t pmap); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_unmapbios(vm_offset_t, vm_size_t); diff --git a/sys/kern/subr_devmap.c b/sys/kern/subr_devmap.c index f29e6df472b5..2ca765878f38 100644 --- a/sys/kern/subr_devmap.c +++ b/sys/kern/subr_devmap.c @@ -260,7 +260,7 @@ devmap_vtop(void * vpva, vm_size_t size) * pmap_kenter_device(). */ void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) +pmap_mapdev(vm_paddr_t pa, vm_size_t size) { vm_offset_t va, offset; void * rva; @@ -292,7 +292,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t size) #if defined(__aarch64__) || defined(__riscv) void * -pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma) +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) { vm_offset_t va, offset; void * rva; diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c index 23b72edf6e0d..ca515b8ff38c 100644 --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -627,7 +627,7 @@ macio_activate_resource(device_t bus, device_t child, int type, int rid, return (bus_activate_resource(bus, type, rid, res)); if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - p = pmap_mapdev((vm_offset_t)rman_get_start(res) + sc->sc_base, + p = pmap_mapdev((vm_paddr_t)rman_get_start(res) + sc->sc_base, (vm_size_t)rman_get_size(res)); if (p == NULL) return (ENOMEM); diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 3e2c6aa658fc..28d677cd0f39 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -372,7 +372,7 @@ iobus_activate_resource(device_t bus, device_t child, int type, int rid, return (bus_activate_resource(bus, type, rid, res)); if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - p = pmap_mapdev((vm_offset_t)rman_get_start(res) + sc->sc_addr, + p = pmap_mapdev((vm_paddr_t)rman_get_start(res) + sc->sc_addr, (vm_size_t)rman_get_size(res)); if (p == NULL) return (ENOMEM); diff --git a/sys/riscv/include/pmap.h b/sys/riscv/include/pmap.h index 8834c91362ad..8eb5b394fd32 100644 --- a/sys/riscv/include/pmap.h +++ b/sys/riscv/include/pmap.h @@ -162,11 +162,11 @@ void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); -void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); +void *pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma); bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_unmapbios(vm_offset_t, vm_size_t);