|
|
1.1 ! root 1: /* resume.c - resume */ ! 2: ! 3: #include <conf.h> ! 4: #include <kernel.h> ! 5: #include <proc.h> ! 6: ! 7: /*------------------------------------------------------------------------ ! 8: * resume -- unsuspend a process, making it ready; return the priority ! 9: *------------------------------------------------------------------------ ! 10: */ ! 11: SYSCALL resume(pid) ! 12: int pid; ! 13: { ! 14: PStype ps; /* saved processor status */ ! 15: struct pentry *pptr; /* pointer to proc. tab. entry */ ! 16: int prio; /* priority to return */ ! 17: ! 18: disable(ps); ! 19: if (isbadpid(pid) || (pptr = &proctab[pid])->pstate != PRSUSP) { ! 20: restore(ps); ! 21: return(SYSERR); ! 22: } ! 23: prio = pptr->pprio; ! 24: ready(pid, RESCHYES); ! 25: restore(ps); ! 26: return(prio); ! 27: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.