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 "kernel/proc.h" /* for queue constants */
14 #include "schedproc.h"
16 /*===========================================================================*
18 *===========================================================================*/
19 int no_sys(int who_e
, int call_nr
)
21 /* A system call number not implemented by PM has been requested. */
22 printf("SCHED: in no_sys, call nr %d from %d\n", call_nr
, who_e
);
27 /*===========================================================================*
29 *===========================================================================*/
30 int sched_isokendpt(int endpoint
, int *proc
)
32 *proc
= _ENDPOINT_P(endpoint
);
34 return (EBADEPT
); /* Don't schedule tasks */
37 if(endpoint
!= schedproc
[*proc
].endpoint
)
39 if(!(schedproc
[*proc
].flags
& IN_USE
))
44 /*===========================================================================*
46 *===========================================================================*/
47 int sched_isemtyendpt(int endpoint
, int *proc
)
49 *proc
= _ENDPOINT_P(endpoint
);
51 return (EBADEPT
); /* Don't schedule tasks */
54 if(schedproc
[*proc
].flags
& IN_USE
)
59 /*===========================================================================*
61 *===========================================================================*/
62 int accept_message(message
*m_ptr
)
64 /* accept all messages from PM and RS */
65 switch (m_ptr
->m_source
) {
73 /* no other messages are allowable */