custom message type for VM_INFO
[minix3.git] / lib / libsys / sched_stop.c
blob889a03bcc3a429cd6b5a5d2e973aa4068002ea09
1 #include "syslib.h"
2 #include <assert.h>
3 #include <string.h>
5 /*===========================================================================*
6 * sched_stop *
7 *===========================================================================*/
8 int sched_stop(endpoint_t scheduler_e, endpoint_t schedulee_e)
10 int rv;
11 message m;
13 /* If the kernel is the scheduler, it will implicitly stop scheduling
14 * once another process takes over or the process terminates */
15 if (scheduler_e == KERNEL || scheduler_e == NONE)
16 return(OK);
18 /* User-scheduled, perform the call */
19 assert(_ENDPOINT_P(scheduler_e) >= 0);
20 assert(_ENDPOINT_P(schedulee_e) >= 0);
22 memset(&m, 0, sizeof(m));
23 m.m_lsys_sched_scheduling_stop.endpoint = schedulee_e;
24 if ((rv = _taskcall(scheduler_e, SCHEDULING_STOP, &m))) {
25 return rv;
28 return (OK);