aboutsummaryrefslogtreecommitdiff
path: root/sys/alpha
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2003-06-27 08:31:48 +0000
committerScott Long <scottl@FreeBSD.org>2003-06-27 08:31:48 +0000
commit3eaffdf7e0b4d44317a944854e06478511484de2 (patch)
tree9b3a6384a2c468f145f29baaa1896d43b713513e /sys/alpha
parentc8cd8ab0170a6a8afad06e2b3e6acaaeb9710d82 (diff)
downloadsrc-3eaffdf7e0b4d44317a944854e06478511484de2.tar.gz
src-3eaffdf7e0b4d44317a944854e06478511484de2.zip
Do the first and mostly mechanical step of adding mutex support to the
bus_dma async callback scheme. Note that sparc64 does not seem to do async callbacks. Note that ia64 callbacks might not be MPSAFE at the moment. Note that powerpc doesn't seem to do async callbacks due to the implementation being incomplete. Reviewed by: mostly silence on arch@
Notes
Notes: svn path=/head/; revision=116907
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/busdma_machdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/alpha/alpha/busdma_machdep.c b/sys/alpha/alpha/busdma_machdep.c
index 12f57cde724e..7e5011650c64 100644
--- a/sys/alpha/alpha/busdma_machdep.c
+++ b/sys/alpha/alpha/busdma_machdep.c
@@ -94,6 +94,7 @@ struct bus_dmamap {
vm_offset_t busaddress; /* address in bus space */
bus_dmamap_callback_t *callback;
void *callback_arg;
+ struct mtx *callback_mtx;
void *sgmaphandle; /* handle into sgmap */
STAILQ_ENTRY(bus_dmamap) links;
};
@@ -931,8 +932,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);