summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-07-04 19:53:24 +0000
committerpeter <peter@FreeBSD.org>2002-07-04 19:53:24 +0000
commit7125e0b545a66938fc2f2366b22ee9bc981e7b93 (patch)
treedbf06341b5e86146c853b243189bc4cd2c8d28ba /sys
parente54f08bc494441796590f03e3cc46aa8473fd8b2 (diff)
downloadFreeBSD-src-7125e0b545a66938fc2f2366b22ee9bc981e7b93.zip
FreeBSD-src-7125e0b545a66938fc2f2366b22ee9bc981e7b93.tar.gz
Diff reduction (microoptimization) with another WIP. Move the frame
calculation in get_ptbase() to a little later on.
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 5a46bd3..7b673e6 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 5a46bd3..7b673e6 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)) {
OpenPOWER on IntegriCloud