svn commit: r246158 - head/sys/arm/arm
Konstantin Belousov
kib at FreeBSD.org
Thu Jan 31 20:53:32 UTC 2013
Author: kib
Date: Thu Jan 31 20:53:31 2013
New Revision: 246158
URL: http://svnweb.freebsd.org/changeset/base/246158
Log:
Use pmap_kextract() instead of inlining the page table walk.
Remove the comment referencing non-existing code.
Reviewed by: cognet, ian (previous version)
Tested by: ian
Modified:
head/sys/arm/arm/busdma_machdep.c
Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c Thu Jan 31 20:48:56 2013 (r246157)
+++ head/sys/arm/arm/busdma_machdep.c Thu Jan 31 20:53:31 2013 (r246158)
@@ -849,9 +849,6 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
vm_offset_t vaddr = (vm_offset_t)buf;
int seg;
int error = 0;
- pd_entry_t *pde;
- pt_entry_t pte;
- pt_entry_t *ptep;
lastaddr = *lastaddrp;
bmask = ~(dmat->boundary - 1);
@@ -868,34 +865,9 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
for (seg = *segp; buflen > 0 ; ) {
/*
* Get the physical address for this segment.
- *
- * XXX Don't support checking for coherent mappings
- * XXX in user address space.
*/
if (__predict_true(pmap == pmap_kernel())) {
- if (pmap_get_pde_pte(pmap, vaddr, &pde, &ptep) == FALSE)
- return (EFAULT);
-
- if (__predict_false(pmap_pde_section(pde))) {
- if (*pde & L1_S_SUPERSEC)
- curaddr = (*pde & L1_SUP_FRAME) |
- (vaddr & L1_SUP_OFFSET);
- else
- curaddr = (*pde & L1_S_FRAME) |
- (vaddr & L1_S_OFFSET);
- } else {
- pte = *ptep;
- KASSERT((pte & L2_TYPE_MASK) != L2_TYPE_INV,
- ("INV type"));
- if (__predict_false((pte & L2_TYPE_MASK)
- == L2_TYPE_L)) {
- curaddr = (pte & L2_L_FRAME) |
- (vaddr & L2_L_OFFSET);
- } else {
- curaddr = (pte & L2_S_FRAME) |
- (vaddr & L2_S_OFFSET);
- }
- }
+ curaddr = pmap_kextract(vaddr);
} else {
curaddr = pmap_extract(pmap, vaddr);
map->flags &= ~DMAMAP_COHERENT;
More information about the svn-src-head
mailing list