aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-07-04 19:53:24 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-07-04 19:53:24 +0000
commit3a7ef7918c61f68cab51a58f5c957f04e2e5cd44 (patch)
treedbf06341b5e86146c853b243189bc4cd2c8d28ba /sys
parentae3155af28a57bf584fd4565ac060615b05bde59 (diff)
downloadsrc-3a7ef7918c61f68cab51a58f5c957f04e2e5cd44.tar.gz
src-3a7ef7918c61f68cab51a58f5c957f04e2e5cd44.zip
Diff reduction (microoptimization) with another WIP. Move the frame
calculation in get_ptbase() to a little later on.
Notes
Notes: svn path=/head/; revision=99415
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c7
-rw-r--r--sys/i386/i386/pmap.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 5a46bd3c81dd..7b673e68b5c3 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -600,10 +600,13 @@ static pt_entry_t *
get_ptbase(pmap)
pmap_t pmap;
{
- pd_entry_t frame = pmap->pm_pdir[PTDPTDI] & PG_FRAME;
+ pd_entry_t frame;
/* are we current address space or kernel? */
- if (pmap == kernel_pmap || frame == (PTDpde & PG_FRAME))
+ if (pmap == kernel_pmap)
+ return PTmap;
+ frame = pmap->pm_pdir[PTDPTDI] & PG_FRAME;
+ if (frame == (PTDpde & PG_FRAME))
return PTmap;
/* otherwise, we are alternate address space */
if (frame != (APTDpde & PG_FRAME)) {
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 5a46bd3c81dd..7b673e68b5c3 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -600,10 +600,13 @@ static pt_entry_t *
get_ptbase(pmap)
pmap_t pmap;
{
- pd_entry_t frame = pmap->pm_pdir[PTDPTDI] & PG_FRAME;
+ pd_entry_t frame;
/* are we current address space or kernel? */
- if (pmap == kernel_pmap || frame == (PTDpde & PG_FRAME))
+ if (pmap == kernel_pmap)
+ return PTmap;
+ frame = pmap->pm_pdir[PTDPTDI] & PG_FRAME;
+ if (frame == (PTDpde & PG_FRAME))
return PTmap;
/* otherwise, we are alternate address space */
if (frame != (APTDpde & PG_FRAME)) {