diff options
author | alc <alc@FreeBSD.org> | 2004-06-20 06:11:00 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-06-20 06:11:00 +0000 |
commit | d711478366fb98d9f5712539d1662be350da961e (patch) | |
tree | 12ca948005e6b1a3c5f354639c5e25a423e9abe8 /sys/amd64 | |
parent | da4e7c693b9265024d10655fef30c50246311b0c (diff) | |
download | FreeBSD-src-d711478366fb98d9f5712539d1662be350da961e.zip FreeBSD-src-d711478366fb98d9f5712539d1662be350da961e.tar.gz |
Add pmap locking to pmap_is_prefaultable().
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 62a91a6..d974c88 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2566,14 +2566,17 @@ pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) { pd_entry_t *pde; pt_entry_t *pte; + boolean_t rv; + rv = FALSE; + PMAP_LOCK(pmap); pde = pmap_pde(pmap, addr); - if (pde == NULL || (*pde & PG_V) == 0) - return (FALSE); - pte = vtopte(addr); - if (*pte & PG_V) - return (FALSE); - return (TRUE); + if (pde != NULL && (*pde & PG_V)) { + pte = vtopte(addr); + rv = (*pte & PG_V) == 0; + } + PMAP_UNLOCK(pmap); + return (rv); } /* |