1 /* This file contains some utility routines for SCHED.
3 * The entry points are:
4 * no_sys: called for invalid system call numbers
5 * sched_isokendpt: check the validity of an endpoint
6 * sched_isemtyendpt check for validity and availability of endpoint slot
7 * accept_message check whether message is allowed
11 #include <machine/archtypes.h>
12 #include <sys/resource.h> /* for PRIO_MAX & PRIO_MIN */
13 #include "schedproc.h"
15 /*===========================================================================*
17 *===========================================================================*/
18 int no_sys(int who_e
, int call_nr
)
20 /* A system call number not implemented by PM has been requested. */
21 printf("SCHED: in no_sys, call nr %d from %d\n", call_nr
, who_e
);
26 /*===========================================================================*
28 *===========================================================================*/
29 int sched_isokendpt(int endpoint
, int *proc
)
31 *proc
= _ENDPOINT_P(endpoint
);
33 return (EBADEPT
); /* Don't schedule tasks */
36 if(endpoint
!= schedproc
[*proc
].endpoint
)
38 if(!(schedproc
[*proc
].flags
& IN_USE
))
43 /*===========================================================================*
45 *===========================================================================*/
46 int sched_isemtyendpt(int endpoint
, int *proc
)
48 *proc
= _ENDPOINT_P(endpoint
);
50 return (EBADEPT
); /* Don't schedule tasks */
53 if(schedproc
[*proc
].flags
& IN_USE
)
58 /*===========================================================================*
60 *===========================================================================*/
61 int accept_message(message
*m_ptr
)
63 /* accept all messages from PM and RS */
64 switch (m_ptr
->m_source
) {
72 /* no other messages are allowable */