2010-07-01 10:38:15 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
#include <assert.h>
|
2013-11-03 22:33:44 +01:00
|
|
|
#include <string.h>
|
2010-07-01 10:38:15 +02:00
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* sched_stop *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int sched_stop(endpoint_t scheduler_e, endpoint_t schedulee_e)
|
2010-07-01 10:38:15 +02:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
2013-11-03 22:33:44 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
2014-05-14 18:29:46 +02:00
|
|
|
m.m_lsys_sched_scheduling_stop.endpoint = schedulee_e;
|
2010-07-01 10:38:15 +02:00
|
|
|
if ((rv = _taskcall(scheduler_e, SCHEDULING_STOP, &m))) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (OK);
|
|
|
|
}
|