summaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2003-06-28 06:07:06 +0000
committerScott Long <scottl@FreeBSD.org>2003-06-28 06:07:06 +0000
commit7f958011881c13d858fcfbc360add48877300b66 (patch)
treeb97566c97c3fda2bc2f234218a41dec5db844385 /sys/amd64
parente493a5d90cb77283ec07a7c063c266beec4398a6 (diff)
Notes
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/busdma_machdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/amd64/amd64/busdma_machdep.c b/sys/amd64/amd64/busdma_machdep.c
index e2cd2d446a00..e46bacca0df4 100644
--- a/sys/amd64/amd64/busdma_machdep.c
+++ b/sys/amd64/amd64/busdma_machdep.c
@@ -90,6 +90,7 @@ struct bus_dmamap {
bus_size_t buflen; /* unmapped buffer length */
bus_dmamap_callback_t *callback;
void *callback_arg;
+ struct mtx *callback_mtx;
STAILQ_ENTRY(bus_dmamap) links;
};
@@ -867,8 +868,12 @@ busdma_swi(void)
while ((map = STAILQ_FIRST(&bounce_map_callbacklist)) != NULL) {
STAILQ_REMOVE_HEAD(&bounce_map_callbacklist, links);
mtx_unlock(&bounce_lock);
+ if (map->callback_mtx != NULL)
+ mtx_lock(map->callback_mtx);
bus_dmamap_load(map->dmat, map, map->buf, map->buflen,
map->callback, map->callback_arg, /*flags*/0);
+ if (map->callback_mtx != NULL)
+ mtx_unlock(map->callback_mtx);
mtx_lock(&bounce_lock);
}
mtx_unlock(&bounce_lock);