Multiple updates on sleeping, vma dropping and thread suspend.

- Updated sleeping paths such that a task is atomically put into
  a runqueue and made RUNNABLE, or removed from a runqueue and made SLEEPING.
- Modified vma dropping sources to handle both copy_on_write() and exit() cases
  in a common function.
- Added the first infrastructure to have a pager to suspend a task and wait for
  suspend completion from the scheduler.
This commit is contained in:
Bahadir Balban
2008-10-13 12:22:10 +03:00
parent f6d0a79298
commit 0db0f7e334
23 changed files with 416 additions and 200 deletions

View File

@@ -158,8 +158,11 @@ int do_open(struct tcb *task, int fd, unsigned long vnum, unsigned long length)
task->files->fd[fd].vmfile = vmfile;
vmfile->openers++;
/* Add to global list */
list_add(&vmfile->vm_obj.list, &vm_file_list);
/* Add to file list */
list_add(&vmfile->list, &vm_file_list);
/* Add to object list */
list_add(&vmfile->vm_obj.list, &vm_object_list);
return 0;
}
@@ -399,7 +402,8 @@ int do_close(struct tcb *task, int fd)
return err;
/* Reduce file's opener count */
task->files->fd[fd].vmfile->openers--;
if (!(--task->files->fd[fd].vmfile->openers))
vm_file_delete(task->files->fd[fd].vmfile);
task->files->fd[fd].vnum = 0;
task->files->fd[fd].cursor = 0;