summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-06-27 08:31:48 +0000
committerscottl <scottl@FreeBSD.org>2003-06-27 08:31:48 +0000
commitd68d16eebbbe84983098fc00d2276d32f26c88da (patch)
tree9b3a6384a2c468f145f29baaa1896d43b713513e /sys/ia64
parent7cbe63ffd640bd17cb4f5aa1dfb37224f0351cac (diff)
downloadFreeBSD-src-d68d16eebbbe84983098fc00d2276d32f26c88da.zip
FreeBSD-src-d68d16eebbbe84983098fc00d2276d32f26c88da.tar.gz
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@
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/busdma_machdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c
index 33cece4..466e995 100644
--- a/sys/ia64/ia64/busdma_machdep.c
+++ b/sys/ia64/ia64/busdma_machdep.c
@@ -90,6 +90,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;
};
@@ -920,8 +921,12 @@ busdma_swi(void)
while ((map = STAILQ_FIRST(&bounce_map_callbacklist)) != NULL) {
STAILQ_REMOVE_HEAD(&bounce_map_callbacklist, links);
splx(s);
+ 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);
s = splhigh();
}
splx(s);
OpenPOWER on IntegriCloud