diff options
-rw-r--r-- | sys/arch/alpha/dev/sgmap_common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/alpha/dev/sgmap_common.c b/sys/arch/alpha/dev/sgmap_common.c index 979096ee45c..0e3015e258d 100644 --- a/sys/arch/alpha/dev/sgmap_common.c +++ b/sys/arch/alpha/dev/sgmap_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sgmap_common.c,v 1.3 2001/11/06 19:53:13 miod Exp $ */ +/* $OpenBSD: sgmap_common.c,v 1.4 2002/03/20 22:48:58 art Exp $ */ /* $NetBSD: sgmap_common.c,v 1.13 2000/06/29 09:02:57 mrg Exp $ */ /*- @@ -155,6 +155,7 @@ alpha_sgmap_alloc(map, origlen, sgmap, flags) { int error; bus_size_t len = origlen, boundary, alignment; + int s; #ifdef DIAGNOSTIC if (map->_dm_flags & DMAMAP_HAS_SGMAP) @@ -190,9 +191,11 @@ alpha_sgmap_alloc(map, origlen, sgmap, flags) origlen, len, map->_dm_sgvalen, map->_dm_boundary, boundary); #endif + s = splvm(); error = extent_alloc(sgmap->aps_ex, map->_dm_sgvalen, alignment, 0, boundary, (flags & BUS_DMA_NOWAIT) ? EX_NOWAIT : EX_WAITOK, &map->_dm_sgva); + splx(s); #if 0 printf("error %d _dm_sgva %x\n", error, map->_dm_sgva); #endif @@ -210,15 +213,18 @@ alpha_sgmap_free(map, sgmap) bus_dmamap_t map; struct alpha_sgmap *sgmap; { + int s; #ifdef DIAGNOSTIC if ((map->_dm_flags & DMAMAP_HAS_SGMAP) == 0) panic("alpha_sgmap_free: no sgva space to free"); #endif + s = splvm(); if (extent_free(sgmap->aps_ex, map->_dm_sgva, map->_dm_sgvalen, EX_NOWAIT)) panic("alpha_sgmap_free"); + splx(s); map->_dm_flags &= ~DMAMAP_HAS_SGMAP; } |