diff options
author | mux <mux@FreeBSD.org> | 2003-03-13 17:18:48 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2003-03-13 17:18:48 +0000 |
commit | 15b2d31e358554d642da71cfc6c4967e3bea1414 (patch) | |
tree | 89f0117eb121a46688fd90609d58fc94cc105a53 /sys/sparc64 | |
parent | d3ce48cb48061b92b1b7ac962379bf631017e7b1 (diff) | |
download | FreeBSD-src-15b2d31e358554d642da71cfc6c4967e3bea1414.zip FreeBSD-src-15b2d31e358554d642da71cfc6c4967e3bea1414.tar.gz |
Grab Giant around calls to contigmalloc() and contigfree() so
that drivers converted to be MP safe don't have to deal with it.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/bus_machdep.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/bus_machdep.c b/sys/sparc64/sparc64/bus_machdep.c index 71e1d0b..4d825f7 100644 --- a/sys/sparc64/sparc64/bus_machdep.c +++ b/sys/sparc64/sparc64/bus_machdep.c @@ -630,11 +630,13 @@ nexus_dmamem_alloc_size(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void **vaddr, * and handles multi-seg allocations. Nobody is doing multi-seg * allocations yet though. */ + mtx_lock(&Giant); *vaddr = contigmalloc(size, M_DEVBUF, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK, 0ul, ddmat->dt_lowaddr, ddmat->dt_alignment ? ddmat->dt_alignment : 1UL, ddmat->dt_boundary); + mtx_unlock(&Giant); } if (*vaddr == NULL) { free(*mapp, M_DEVBUF); @@ -663,8 +665,11 @@ nexus_dmamem_free_size(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void *vaddr, sparc64_dmamem_free_map(ddmat, map); if ((size <= PAGE_SIZE)) free(vaddr, M_DEVBUF); - else + else { + mtx_lock(&Giant); contigfree(vaddr, size, M_DEVBUF); + mtx_unlock(&Giant); + } } static void |