Remove building with NOCRYPTO option
[minix.git] / minix / kernel / system / do_schedule.c
blobc7d37ae1418232a897c00eba33ce776850a690f7
1 #include "kernel/system.h"
2 #include <minix/endpoint.h>
3 #include "kernel/clock.h"
5 /*===========================================================================*
6 * do_schedule *
7 *===========================================================================*/
8 int do_schedule(struct proc * caller, message * m_ptr)
10 struct proc *p;
11 int proc_nr;
12 int priority, quantum, cpu, niced;
14 if (!isokendpt(m_ptr->m_lsys_krn_schedule.endpoint, &proc_nr))
15 return EINVAL;
17 p = proc_addr(proc_nr);
19 /* Only this process' scheduler can schedule it */
20 if (caller != p->p_scheduler)
21 return(EPERM);
23 /* Try to schedule the process. */
24 priority = m_ptr->m_lsys_krn_schedule.priority;
25 quantum = m_ptr->m_lsys_krn_schedule.quantum;
26 cpu = m_ptr->m_lsys_krn_schedule.cpu;
27 niced = !!(m_ptr->m_lsys_krn_schedule.niced);
29 return sched_proc(p, priority, quantum, cpu, niced);