[BACK]Return to pmap.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / sparc / sparc

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/sparc/sparc/pmap.c between version 1.13 and 1.13.2.2

version 1.13, 1994/06/10 14:33:11 version 1.13.2.2, 1994/10/24 04:22:06
Line 773  mmu_pagein(pm, va, bits)
Line 773  mmu_pagein(pm, va, bits)
         return (1);          return (1);
 }  }
   
 PMPID(pm)  
 struct pmap *pm;  
 {  
         struct proc *p;  
   
         for (p = allproc; p; p = p->p_next)  
                 if (&p->p_vmspace->vm_pmap == pm)  
                         return p->p_pid;  
         return -1;  
 }  
 /*  /*
  * Allocate a context.  If necessary, steal one from someone else.   * Allocate a context.  If necessary, steal one from someone else.
  * Changes hardware context number and loads segment map.   * Changes hardware context number and loads segment map.
Line 813  ctx_alloc(pm)
Line 803  ctx_alloc(pm)
                 ctx_freelist = c->c_nextfree;                  ctx_freelist = c->c_nextfree;
                 cnum = c - ctxinfo;                  cnum = c - ctxinfo;
                 setcontext(cnum);                  setcontext(cnum);
 #if 0  
                 for (va = 0, i = NUSEG; --i >= 0; va += NBPSG)  
                         if (getsegmap(va) != seginval)  
                          printf("free ctx %d: segmap(%x) = %x\n", cnum, va, getsegmap(va));  
 #endif  
         } else {          } else {
                 if ((ctx_kick += ctx_kickdir) >= ncontext) {                  if ((ctx_kick += ctx_kickdir) >= ncontext) {
                         ctx_kick = ncontext - 1;                          ctx_kick = ncontext - 1;
Line 849  ctx_alloc(pm)
Line 834  ctx_alloc(pm)
         pm->pm_ctx = c;          pm->pm_ctx = c;
         pm->pm_ctxnum = cnum;          pm->pm_ctxnum = cnum;
   
 #if 0  
         /*  
          * XXX  loop below makes 3584 iterations ... could reduce  
          *      by remembering valid ranges per context: two ranges  
          *      should suffice (for text/data/bss and for stack).  
          */  
         segp = pm->pm_segmap;  
         for (va = 0, i = NUSEG; --i >= 0; va += NBPSG)  
                 setsegmap(va, *segp++);  
 #else  
         /*          /*
          * Write pmap's segment table into the MMU.           * Write pmap's segment table into the MMU.
          *           *
Line 888  ctx_alloc(pm)
Line 863  ctx_alloc(pm)
                 }                  }
                 setsegmap(va, *segp++);                  setsegmap(va, *segp++);
         }          }
 #endif  
 }  }
   
 /*  /*
Line 1845  pmap_rmu(pm, va, endva, vseg, nleft, pme
Line 1819  pmap_rmu(pm, va, endva, vseg, nleft, pme
                         }                          }
                         if ((tpte & PG_TYPE) == PG_OBMEM) {                          if ((tpte & PG_TYPE) == PG_OBMEM) {
                                 i = ptoa(HWTOSW(tpte & PG_PFNUM));                                  i = ptoa(HWTOSW(tpte & PG_PFNUM));
                                 if (managed(i))                                  if (managed(i)) {
                                           if (tpte & PG_W)
                                                   pm->pm_stats.wired_count--;
                                           pm->pm_stats.resident_count--;
                                         pv_unlink(pvhead(i), pm, va);                                          pv_unlink(pvhead(i), pm, va);
                                   }
                         }                          }
                         nleft--;                          nleft--;
                         *pte = 0;                          *pte = 0;
Line 1899  pmap_rmu(pm, va, endva, vseg, nleft, pme
Line 1877  pmap_rmu(pm, va, endva, vseg, nleft, pme
                         continue;                          continue;
                 pv = NULL;                  pv = NULL;
                 /* if cacheable, flush page as needed */                  /* if cacheable, flush page as needed */
                 if (doflush && (tpte & PG_NC) == 0) {                  if ((tpte & PG_NC) == 0) {
 #ifdef perftest  #ifdef perftest
                         nvalid++;                          if (doflush)
                                   nvalid++;
 #endif  #endif
                         if (perpage)                          if (perpage)
                                 cache_flush_page(va);                                  cache_flush_page(va);
Line 2217  pmap_changeprot(pm, va, prot, wired)
Line 2196  pmap_changeprot(pm, va, prot, wired)
                                 goto useless;                                  goto useless;
                         }                          }
                         if (vactype == VAC_WRITEBACK &&                          if (vactype == VAC_WRITEBACK &&
                             (newprot & PG_W) == 0 &&                              (tpte & (PG_U | PG_NC)) == PG_U)
                             (tpte & (PG_W | PG_NC)) == PG_W)  
                                 cache_flush_page((int)va);                                  cache_flush_page((int)va);
                 } else {                  } else {
                         setcontext(0);                          setcontext(0);
Line 2477  printf("pmap_enter: pte filled during sl
Line 2455  printf("pmap_enter: pte filled during sl
                                 splx(s);                                  splx(s);
                                 /* caller should call this directly: */                                  /* caller should call this directly: */
                                 pmap_changeprot(pm, va, prot, wired);                                  pmap_changeprot(pm, va, prot, wired);
                                   if (wired)
                                           pm->pm_stats.wired_count++;
                                   else
                                           pm->pm_stats.wired_count--;
                                 return;                                  return;
                         }                          }
                         /*                          /*
Line 2498  curproc->p_comm, curproc->p_pid, va);*/
Line 2480  curproc->p_comm, curproc->p_pid, va);*/
                 } else {                  } else {
                         /* adding new entry */                          /* adding new entry */
                         pm->pm_npte[vseg]++;                          pm->pm_npte[vseg]++;
   
                           /*
                            * Increment counters
                            */
                           pm->pm_stats.resident_count++;
                           if (wired)
                                   pm->pm_stats.wired_count++;
                 }                  }
         }          }
   

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.13.2.2

CVSweb <webmaster@jp.NetBSD.org>