mmuptefree()

mmuptefree()

概要

実装

  249: /*
  250:  * A user-space memory segment has been deleted, or the
  251:  * process is exiting.  Clear all the pde entries for user-space
  252:  * memory mappings and device mappings.  Any entries that
  253:  * are needed will be paged back in as necessary.
  254:  */
  255: static void
  256: mmuptefree(Proc* proc)
  257: {
  258:         int s;
  259:         ulong *pdb;
  260:         Page **last, *page;
  261: 
  262:         if(proc->mmupdb == nil || proc->mmuused == nil)
  263:                 return;
  264:         s = splhi();
  265:         pdb = tmpmap(proc->mmupdb);
  266:         last = &proc->mmuused;
  267:         for(page = *last; page; page = page->next){
  268:                 pdb[page->daddr] = 0;
  269:                 last = &page->next;
  270:         }
  271:         tmpunmap(pdb);
  272:         splx(s);
  273:         *last = proc->mmufree;
  274:         proc->mmufree = proc->mmuused;
  275:         proc->mmuused = 0;
  276: }