mirror of https://github.com/zrafa/xinu-avr.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
627 B
29 lines
627 B
/* ready.c - ready */ |
|
|
|
#include <xinu.h> |
|
|
|
qid16 readylist; /* Index of ready list */ |
|
|
|
/*------------------------------------------------------------------------ |
|
* ready - Make a process eligible for CPU service |
|
*------------------------------------------------------------------------ |
|
*/ |
|
status ready( |
|
pid32 pid /* ID of process to make ready */ |
|
) |
|
{ |
|
register struct procent *prptr; |
|
|
|
if (isbadpid(pid)) { |
|
return SYSERR; |
|
} |
|
|
|
/* Set process state to indicate ready and add to ready list */ |
|
|
|
prptr = &proctab[pid]; |
|
prptr->prstate = PR_READY; |
|
insert(pid, readylist, prptr->prprio); |
|
resched(); |
|
|
|
return OK; |
|
}
|
|
|