From 9f5109e6ad7609011c7534537f5ab5a16c2e250d Mon Sep 17 00:00:00 2001 From: Jordan Gordeev Date: Wed, 27 May 2009 14:23:24 +0300 Subject: [PATCH] amd64: pmap: Improve comments. --- sys/platform/pc64/amd64/pmap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/platform/pc64/amd64/pmap.c b/sys/platform/pc64/amd64/pmap.c index 0e3f72144c..d3fe4fc846 100644 --- a/sys/platform/pc64/amd64/pmap.c +++ b/sys/platform/pc64/amd64/pmap.c @@ -1695,7 +1695,7 @@ READY1 pml4 = &pmap->pm_pml4[pml4index]; if ((*pml4 & PG_V) == 0) { - /* Have to allocate a new pdp, recurse */ + /* Have to allocate a new PDP page, recurse */ if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index) == NULL) { --m->wire_count; @@ -1703,7 +1703,7 @@ READY1 return (NULL); } } else { - /* Add reference to pdp page */ + /* Add reference to the PDP page */ pdppg = PHYS_TO_VM_PAGE(*pml4 & PG_FRAME); pdppg->wire_count++; } @@ -1727,7 +1727,12 @@ READY1 /* First, find the pdp and check that its valid. */ pml4 = &pmap->pm_pml4[pml4index]; if ((*pml4 & PG_V) == 0) { - /* Have to allocate a new pd, recurse */ + /* We miss a PDP page. We ultimately need a PD page. + * Recursively allocating a PD page will allocate + * the missing PDP page and will also allocate + * the PD page we need. + */ + /* Have to allocate a new PD page, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex) == NULL) { --m->wire_count; @@ -1740,7 +1745,7 @@ READY1 pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); pdp = &pdp[pdpindex & ((1ul << NPDPEPGSHIFT) - 1)]; if ((*pdp & PG_V) == 0) { - /* Have to allocate a new pd, recurse */ + /* Have to allocate a new PD page, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex) == NULL) { --m->wire_count; @@ -1748,7 +1753,7 @@ READY1 return (NULL); } } else { - /* Add reference to the pd page */ + /* Add reference to the PD page */ pdpg = PHYS_TO_VM_PAGE(*pdp & PG_FRAME); pdpg->wire_count++; } -- 2.41.0