From owner-svn-src-all@freebsd.org Fri Oct 23 12:03:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A56CA1C843; Fri, 23 Oct 2015 12:03:27 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 444271D5E; Fri, 23 Oct 2015 12:03:27 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9NC3Q9M056047; Fri, 23 Oct 2015 12:03:26 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9NC3Pge056042; Fri, 23 Oct 2015 12:03:25 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201510231203.t9NC3Pge056042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Fri, 23 Oct 2015 12:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289825 - in head/sys: arm/arm arm64/arm64 vm x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2015 12:03:27 -0000 Author: jah Date: Fri Oct 23 12:03:25 2015 New Revision: 289825 URL: https://svnweb.freebsd.org/changeset/base/289825 Log: Remove unclear comment about address truncation in busdma. Add (hopefully much clearer) comment at declaration of PHYS_TO_VM_PAGE(). Noted by: avg Modified: head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm/arm/busdma_machdep.c head/sys/arm64/arm64/busdma_bounce.c head/sys/vm/vm_page.h head/sys/x86/x86/busdma_bounce.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Fri Oct 23 11:45:38 2015 (r289824) +++ head/sys/arm/arm/busdma_machdep-v6.c Fri Oct 23 12:03:25 2015 (r289825) @@ -1089,10 +1089,6 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat sl++; sl->vaddr = 0; sl->datacount = sgsize; - /* - * PHYS_TO_VM_PAGE() will truncate - * unaligned addresses. - */ sl->pages = PHYS_TO_VM_PAGE(curaddr); sl->dataoffs = curaddr & PAGE_MASK; } else @@ -1214,10 +1210,6 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm sl++; sl->vaddr = kvaddr; sl->datacount = sgsize; - /* - * PHYS_TO_VM_PAGE() will truncate - * unaligned addresses. - */ sl->pages = PHYS_TO_VM_PAGE(curaddr); sl->dataoffs = curaddr & PAGE_MASK; } else @@ -1687,7 +1679,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; - /* PHYS_TO_VM_PAGE() will truncate unaligned addresses. */ bpage->datapage = PHYS_TO_VM_PAGE(addr); bpage->dataoffs = addr & PAGE_MASK; bpage->datacount = size; Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Fri Oct 23 11:45:38 2015 (r289824) +++ head/sys/arm/arm/busdma_machdep.c Fri Oct 23 12:03:25 2015 (r289825) @@ -993,10 +993,6 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat sl++; sl->vaddr = 0; sl->datacount = sgsize; - /* - * PHYS_TO_VM_PAGE() will truncate - * unaligned addresses. - */ sl->pages = PHYS_TO_VM_PAGE(curaddr); sl->dataoffs = curaddr & PAGE_MASK; } else @@ -1108,10 +1104,6 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm sl++; sl->vaddr = kvaddr; sl->datacount = sgsize; - /* - * PHYS_TO_VM_PAGE() will truncate - * unaligned addresses. - */ sl->pages = PHYS_TO_VM_PAGE(curaddr); sl->dataoffs = curaddr & PAGE_MASK; } else @@ -1541,7 +1533,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; - /* PHYS_TO_VM_PAGE() will truncate unaligned addresses. */ bpage->datapage = PHYS_TO_VM_PAGE(addr); bpage->dataoffs = addr & PAGE_MASK; bpage->datacount = size; Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Fri Oct 23 11:45:38 2015 (r289824) +++ head/sys/arm64/arm64/busdma_bounce.c Fri Oct 23 12:03:25 2015 (r289825) @@ -1009,7 +1009,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; - /* PHYS_TO_VM_PAGE() will truncate unaligned addresses. */ bpage->datapage = PHYS_TO_VM_PAGE(addr); bpage->dataoffs = addr & PAGE_MASK; bpage->datacount = size; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri Oct 23 11:45:38 2015 (r289824) +++ head/sys/vm/vm_page.h Fri Oct 23 12:03:25 2015 (r289825) @@ -375,6 +375,11 @@ extern long first_page; /* first physi #define VM_PAGE_TO_PHYS(entry) ((entry)->phys_addr) +/* + * PHYS_TO_VM_PAGE() Returns the vm_page_t object that represents a memory + * page to which the given physical address belongs. The correct vm_page_t + * object is returned for addresses that are not page-aligned. + */ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); /* Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Fri Oct 23 11:45:38 2015 (r289824) +++ head/sys/x86/x86/busdma_bounce.c Fri Oct 23 12:03:25 2015 (r289825) @@ -1006,7 +1006,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; - /* PHYS_TO_VM_PAGE() will truncate unaligned addresses. */ bpage->datapage = PHYS_TO_VM_PAGE(addr); bpage->dataoffs = addr & PAGE_MASK; bpage->datacount = size;