diff options
author | alc <alc@FreeBSD.org> | 2008-04-02 04:39:47 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2008-04-02 04:39:47 +0000 |
commit | 18c266c7a7d54af5b4616daa7883e9a476a977e4 (patch) | |
tree | f00f8175670dfdf3d6196ab99abeaa644ee2bc0d /sys/amd64 | |
parent | 8d50c29c72f3cdacd868fee77671679d0744ba77 (diff) | |
download | FreeBSD-src-18c266c7a7d54af5b4616daa7883e9a476a977e4.zip FreeBSD-src-18c266c7a7d54af5b4616daa7883e9a476a977e4.tar.gz |
Optimize pmap_pml4e() and pmap_pdpe() based upon two observations: The
given pmap is never NULL, and therefore pmap_pml4e() can never return
NULL. The pervasive use of these inline functions throughout the pmap
makes these simple changes worthwhile.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index dd5c87d..e48f69c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -318,8 +318,6 @@ static __inline pml4_entry_t * pmap_pml4e(pmap_t pmap, vm_offset_t va) { - if (!pmap) - return NULL; return (&pmap->pm_pml4[pmap_pml4e_index(va)]); } @@ -340,7 +338,7 @@ pmap_pdpe(pmap_t pmap, vm_offset_t va) pml4_entry_t *pml4e; pml4e = pmap_pml4e(pmap, va); - if (pml4e == NULL || (*pml4e & PG_V) == 0) + if ((*pml4e & PG_V) == 0) return NULL; return (pmap_pml4e_to_pdpe(pml4e, va)); } |