diff options
author | peter <peter@FreeBSD.org> | 2002-07-04 19:53:24 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-07-04 19:53:24 +0000 |
commit | 7125e0b545a66938fc2f2366b22ee9bc981e7b93 (patch) | |
tree | dbf06341b5e86146c853b243189bc4cd2c8d28ba | |
parent | e54f08bc494441796590f03e3cc46aa8473fd8b2 (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/amd64/amd64/pmap.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 7 |
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)) { |