Lines 431-437
dflt_lock(void *arg, bus_dma_lock_op_t op)
Link Here
|
431 |
|
431 |
|
432 |
panic("driver error: busdma dflt_lock called"); |
432 |
panic("driver error: busdma dflt_lock called"); |
433 |
} |
433 |
} |
434 |
|
434 |
int busdma_debug = 0; |
435 |
/* |
435 |
/* |
436 |
* Allocate a device specific dma_tag. |
436 |
* Allocate a device specific dma_tag. |
437 |
*/ |
437 |
*/ |
Lines 536-542
bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
Link Here
|
536 |
return (error); |
536 |
return (error); |
537 |
} |
537 |
} |
538 |
bz = newtag->bounce_zone; |
538 |
bz = newtag->bounce_zone; |
539 |
|
539 |
if (busdma_debug) { |
|
|
540 |
printf("%s: bz->total_bpages: %d, maxsize: %lu\n", __func__, bz->total_bpages, maxsize); |
541 |
} |
540 |
if (ptoa(bz->total_bpages) < maxsize) { |
542 |
if (ptoa(bz->total_bpages) < maxsize) { |
541 |
int pages; |
543 |
int pages; |
542 |
|
544 |
|
Lines 1110-1115
_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
Link Here
|
1110 |
struct sync_list *sl; |
1112 |
struct sync_list *sl; |
1111 |
int error; |
1113 |
int error; |
1112 |
|
1114 |
|
|
|
1115 |
if (busdma_debug) |
1116 |
printf("%s: Enter\n", __func__); |
1113 |
counter_u64_add(maploads_total, 1); |
1117 |
counter_u64_add(maploads_total, 1); |
1114 |
if (map->flags & DMAMAP_COHERENT) |
1118 |
if (map->flags & DMAMAP_COHERENT) |
1115 |
counter_u64_add(maploads_coherent, 1); |
1119 |
counter_u64_add(maploads_coherent, 1); |
Lines 1123-1128
_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
Link Here
|
1123 |
counter_u64_add(maploads_mbuf, 1); |
1127 |
counter_u64_add(maploads_mbuf, 1); |
1124 |
map->flags |= DMAMAP_MBUF; |
1128 |
map->flags |= DMAMAP_MBUF; |
1125 |
} |
1129 |
} |
|
|
1130 |
if (busdma_debug) { |
1131 |
printf("%s: buf: 0x%08lX, buflen: %lu\n", |
1132 |
__func__, (bus_addr_t)buf, buflen); |
1133 |
printf("%s: might_bounce: %d\n", |
1134 |
__func__, might_bounce(dmat, map, (bus_addr_t)buf, buflen)); |
1135 |
} |
1126 |
|
1136 |
|
1127 |
if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { |
1137 |
if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { |
1128 |
_bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, flags); |
1138 |
_bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, flags); |
Lines 1157-1165
_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
Link Here
|
1157 |
sgsize = dmat->maxsegsz; |
1167 |
sgsize = dmat->maxsegsz; |
1158 |
if (buflen < sgsize) |
1168 |
if (buflen < sgsize) |
1159 |
sgsize = buflen; |
1169 |
sgsize = buflen; |
1160 |
|
1170 |
if (busdma_debug) { |
|
|
1171 |
printf("%s: curaddr: 0x%08lX, sgsize: %lu, buflen: %lu, map->pagesneeded: %d\n", |
1172 |
__func__, curaddr, sgsize, buflen, map->pagesneeded); |
1173 |
} |
1161 |
if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr, |
1174 |
if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr, |
1162 |
sgsize)) { |
1175 |
sgsize)) { |
|
|
1176 |
if (busdma_debug) { |
1177 |
printf("%s: add_bounce_page\n", __func__); |
1178 |
} |
1163 |
curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, |
1179 |
curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, |
1164 |
sgsize); |
1180 |
sgsize); |
1165 |
} else if ((dmat->flags & BUS_DMA_COHERENT) == 0) { |
1181 |
} else if ((dmat->flags & BUS_DMA_COHERENT) == 0) { |