summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2003-01-24 09:58:32 +0000
committerdfr <dfr@FreeBSD.org>2003-01-24 09:58:32 +0000
commite15ccd761313273ab1326f65bf8cd686d39157b3 (patch)
tree7b5af6ead31df9092cd98c4eb64826954eb6849f /sys/ia64
parent1a1ca90d670621c1f8f88609c1723ec82c4874b6 (diff)
downloadFreeBSD-src-e15ccd761313273ab1326f65bf8cd686d39157b3.zip
FreeBSD-src-e15ccd761313273ab1326f65bf8cd686d39157b3.tar.gz
Fix pmap_extract so that it doesn't panic if the user types
'cat /proc/pid/map' Submitted by: Arun Sharma <arun.sharma@intel.com>
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/pmap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index cc522ba4..ac5c4cf 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -1172,13 +1172,20 @@ pmap_extract(pmap, va)
register pmap_t pmap;
vm_offset_t va;
{
+ struct ia64_lpte *pte;
pmap_t oldpmap;
- vm_offset_t pa;
+
+ if (!pmap)
+ return 0;
oldpmap = pmap_install(pmap);
- pa = ia64_tpa(va);
+ pte = pmap_find_vhpt(va);
pmap_install(oldpmap);
- return pa;
+
+ if (!pte)
+ return 0;
+
+ return pmap_pte_pa(pte);
}
/***************************************************
OpenPOWER on IntegriCloud