diff options
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/busdma_machdep.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c index 9b70d6c..3feacca 100644 --- a/sys/ia64/ia64/busdma_machdep.c +++ b/sys/ia64/ia64/busdma_machdep.c @@ -41,6 +41,7 @@ #include <vm/vm_page.h> #include <vm/vm_map.h> +#include <machine/atomic.h> #include <machine/bus.h> #include <machine/md_var.h> @@ -175,9 +176,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) { @@ -224,7 +224,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); } |