Date: Fri, 23 Oct 2015 12:03:25 +0000 (UTC) From: "Jason A. Harmening" <jah@FreeBSD.org> 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 Message-ID: <201510231203.t9NC3Pge056042@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510231203.t9NC3Pge056042>