forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsched_stop.c
More file actions
29 lines (24 loc) · 833 Bytes
/
Copy pathsched_stop.c
File metadata and controls
29 lines (24 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "syslib.h"
#include <assert.h>
#include <string.h>
/*===========================================================================*
* sched_stop *
*===========================================================================*/
int sched_stop(endpoint_t scheduler_e, endpoint_t schedulee_e)
{
int rv;
message m;
/* If the kernel is the scheduler, it will implicitly stop scheduling
* once another process takes over or the process terminates */
if (scheduler_e == KERNEL || scheduler_e == NONE)
return(OK);
/* User-scheduled, perform the call */
assert(_ENDPOINT_P(scheduler_e) >= 0);
assert(_ENDPOINT_P(schedulee_e) >= 0);
memset(&m, 0, sizeof(m));
m.m_lsys_sched_scheduling_stop.endpoint = schedulee_e;
if ((rv = _taskcall(scheduler_e, SCHEDULING_STOP, &m))) {
return rv;
}
return (OK);
}