Remove unclear comment about address truncation in busdma. Add (hopefully much clearer) comment at declaration of PHYS_TO_VM_PAGE().

Noted by:	avg
This commit is contained in:
Jason A. Harmening 2015-10-23 12:03:25 +00:00
parent 3f8e071052
commit a50730587b
5 changed files with 5 additions and 20 deletions

View File

@ -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 dmat,
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_dmamap_t map, vm_offset_t vaddr,
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;

View File

@ -993,10 +993,6 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf,
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 dmat, bus_dmamap_t map, void *buf,
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_dmamap_t map, vm_offset_t vaddr,
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;

View File

@ -1009,7 +1009,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
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;

View File

@ -375,6 +375,11 @@ extern long first_page; /* first physical page number */
#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);
/*

View File

@ -1006,7 +1006,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
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;