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.
 
 
 
 
 
 

28 lines
708 B

/* chprio.c - chprio */
#include <xinu.h>
/*------------------------------------------------------------------------
* chprio - Change the scheduling priority of a process
*------------------------------------------------------------------------
*/
pri16 chprio(
pid32 pid, /* ID of process to change */
pri16 newprio /* New priority */
)
{
intmask mask; /* Saved interrupt mask */
struct procent *prptr; /* Ptr to process's table entry */
pri16 oldprio; /* Priority to return */
mask = disable();
if (isbadpid(pid)) {
restore(mask);
return (pri16) SYSERR;
}
prptr = &proctab[pid];
oldprio = prptr->prprio;
prptr->prprio = newprio;
restore(mask);
return oldprio;
}