Guest User

Untitled

a guest
Apr 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. PUBLIC
  2. deallocate(pcb)
  3. PCB *pcb;
  4. {
  5. // Free all pages associated to the pcb.
  6.  
  7. int i;
  8. for(i = 0; i<MAX_PAGE; i++){
  9.  
  10. if ( pcb->page_tbl->page_entry[i].valid == TRUE)
  11. {
  12. Frame_Tbl[ pcb->page_tbl->page_entry[i].frame_id ].dirty = FALSE;
  13. Frame_Tbl[ pcb->page_tbl->page_entry[i].frame_id ].free = TRUE;
  14. Frame_Tbl[ pcb->page_tbl->page_entry[i].frame_id ].pcb = NULL;
  15. Frame_Tbl[ pcb->page_tbl->page_entry[i].frame_id ].page_id = -1;
  16. }
  17.  
  18. pcb->page_tbl->page_entry[i].valid = FALSE;
  19.  
  20. }
  21. }
Add Comment
Please, Sign In to add comment