diff options
| author | Alfred Perlstein <alfred@FreeBSD.org> | 2001-05-23 22:17:28 +0000 |
|---|---|---|
| committer | Alfred Perlstein <alfred@FreeBSD.org> | 2001-05-23 22:17:28 +0000 |
| commit | 1f50e112b6508770d3aa0fc48645de1b085c7ddf (patch) | |
| tree | be5e1540f16eaec2addcb2c414752c7673de5f85 /sys/amd64 | |
| parent | b99c886a7f4df7ff5942367e5b648affb26acd12 (diff) | |
Notes
Diffstat (limited to 'sys/amd64')
| -rw-r--r-- | sys/amd64/amd64/pmap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index fd4fed321c89..c6db00b45a30 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -3135,10 +3135,15 @@ pmap_mapdev(pa, size) { vm_offset_t va, tmpva, offset; unsigned *pte; + int hadvmlock; offset = pa & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); + hadvmlock = mtx_owned(&vm_mtx); + if (!hadvmlock) + mtx_lock(&vm_mtx); + va = kmem_alloc_pageable(kernel_map, size); if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); @@ -3153,6 +3158,9 @@ pmap_mapdev(pa, size) } invltlb(); + if (!hadvmlock) + mtx_unlock(&vm_mtx); + return ((void *)(va + offset)); } |
