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.
24 lines
543 B
24 lines
543 B
/* getprio.c - getprio */ |
|
|
|
#include <xinu.h> |
|
|
|
/*------------------------------------------------------------------------ |
|
* getprio - Return the scheduling priority of a process |
|
*------------------------------------------------------------------------ |
|
*/ |
|
syscall getprio( |
|
pid32 pid /* Process ID */ |
|
) |
|
{ |
|
intmask mask; /* Saved interrupt mask */ |
|
uint32 prio; /* Priority to return */ |
|
|
|
mask = disable(); |
|
if (isbadpid(pid)) { |
|
restore(mask); |
|
return SYSERR; |
|
} |
|
prio = proctab[pid].prprio; |
|
restore(mask); |
|
return prio; |
|
}
|
|
|