vm.c
//This must use userVaddress+pgdir addresses!
//(The proc has identical vAddresses on different page directories until exec finish executing)
This must use userVaddress+pgdir addresses.
(The proc has identical vAddresses on different page directories until exec finish executing)
This must use userVaddress + pgdir addresses . ( The proc has identical vAddresses on different page directories until exec finish executing )
void removeFromRamCtrlr(uint userPageVAddr, pde_t *pgdir){
  if (proc == 0)
    return;
  int i;
  for (i = 0; i < MAX_PYSC_PAGES; i++) {
    if (proc->ramCtrlr[i].state == USED 
        && proc->ramCtrlr[i].userPageVAddr == userPageVAddr
        && proc->ramCtrlr[i].pgdir == pgdir){
      proc->ramCtrlr[i].state = NOTUSED;
      return;
    }
  }
}
void removeFromRamCtrlr ( uint userPageVAddr , pde_t * pgdir ) { if ( proc == 0 ) return ; int i ; for ( i = 0 ; i < MAX_PYSC_PAGES ; i ++ ) { if ( proc -> ramCtrlr [ i ] . state == USED && proc -> ramCtrlr [ i ] . userPageVAddr == userPageVAddr && proc -> ramCtrlr [ i ] . pgdir == pgdir ) { proc -> ramCtrlr [ i ] . state = NOTUSED ; return ; } } }
This must use userVaddress+pgdir addresses!
This must use userVaddress + pgdir addresses!