Consider the folowing function:
 * Super fast pmap_pte routine best used when scanning
 * the pv lists.  This eliminates many coarse-grained
 * invltlb calls.  Note that many of the pv list
 * scans are across different pmaps.  It is very wasteful
 * to do an entire invltlb for checking a single mapping.

static unsigned *
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] &
                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

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