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
This commit is contained in:
kib 2013-01-31 20:53:31 +00:00
parent 263b3117c7
commit 93846e1f92

View File

@ -849,9 +849,6 @@ bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs,
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 dmat, bus_dma_segment_t *segs,
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;