summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2003-03-20 19:45:26 +0000
committermux <mux@FreeBSD.org>2003-03-20 19:45:26 +0000
commit09775368124d25ae2e000d454c2af679bb9e5d15 (patch)
tree676f0b2bbfa34e33239736c7054e35324eaede36 /sys/alpha
parent81351314859e1cd7382f611ad7339acf15e2b591 (diff)
downloadFreeBSD-src-09775368124d25ae2e000d454c2af679bb9e5d15.zip
FreeBSD-src-09775368124d25ae2e000d454c2af679bb9e5d15.tar.gz
Use atomic operations to increment and decrement the refcount
in busdma tags. There are currently no tags shared accross different drivers so this isn't needed at the moment, but it will be required when we'll have a proper newbus method to get the parent busdma tag.
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/busdma_machdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/alpha/alpha/busdma_machdep.c b/sys/alpha/alpha/busdma_machdep.c
index 2075053..0b9ed6d 100644
--- a/sys/alpha/alpha/busdma_machdep.c
+++ b/sys/alpha/alpha/busdma_machdep.c
@@ -42,6 +42,7 @@
#include <vm/vm_page.h>
#include <vm/vm_map.h>
+#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/sgmap.h>
#include <machine/md_var.h>
@@ -179,9 +180,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
newtag->filterarg = parent->filterarg;
newtag->parent = parent->parent;
}
- if (newtag->parent != NULL) {
- parent->ref_count++;
- }
+ if (newtag->parent != NULL)
+ atomic_add_int(&parent->ref_count, 1);
}
if (newtag->lowaddr < ptoa(Maxmem) && (flags & BUS_DMA_ALLOCNOW) != 0) {
@@ -228,7 +228,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
bus_dma_tag_t parent;
parent = dmat->parent;
- dmat->ref_count--;
+ atomic_subtract_int(&dmat->ref_count, 1);
if (dmat->ref_count == 0) {
free(dmat, M_DEVBUF);
}
OpenPOWER on IntegriCloud