:pmap_pte_quick(pmap, va)
:        register pmap_t pmap;
:        vm_offset_t va;
:{
:        unsigned pde, newpf;
:        /* 
:         * Check if the appropriate PDE is valid. If not, we're done.
:         */
:**A**   if ((pde = (unsigned) pmap->pm_pdir[va >> PDRSHIFT]) !=
:0) {
:                unsigned frame = (unsigned) pmap->pm_pdir[PTDPTDI] &
:PG_FRAME;
:                unsigned index = i386_btop(va);
:                /* are we current address space or kernel? */
:                /* If so, use the exsiting PTE mappings into KVE space */
:                if ((pmap == kernel_pmap) ||
:                        (frame == (((unsigned) PTDpde) & PG_FRAME))) {
:                        return (unsigned *) PTmap + index;
:                }
:                /*
:                 * IF not, set up a single page to map 
:                 * the approptiate PTEs into
:                 * thos doesn;t make sense since the PDIR test above
:                 * only applies to the current pmap
:                 */
:                newpf = pde & PG_FRAME;
:                if ( ((* (unsigned *) PMAP1) & PG_FRAME) != newpf) {
:                        * (unsigned *) PMAP1 = newpf | PG_RW | PG_V;
:                        invltlb_1pg((vm_offset_t) PADDR1);
:                }
:                return PADDR1 + ((unsigned) index & (NPTEPG - 1));
:        }
:        return (0);
:}
:
:The test marked **A** only applies to the current pmap

    I think it applies to the passed pmap.  pmap->pm_pdir is mapped into KVA
    independant of the fixed page table maps so any pmap's page directory page
    can be examined without having to pull any tricks.

    Then it checks to see if the passed pmap happens to be the current
    pmap.  If it does, then it can use the linear PTmap in VM that
    represents the page tables to access the pte.  If the passed pmap
    is not the current pmap then it maps the page table page via PMAP1
    in order to access the pte.

                                        -Matt

:However inside the test, we check to see if we are talking about the 
:current pmap, or another pmap.
:
:If other pmaps are allowed top be examined, then the foirst test is
:flawed, otherwise, if other maps are not to be examined using this
:function, then the second part of the inside of the clause is
:not needed.. (and should be a panic)
:
:which is correct?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to