SMP - Changed prototype of sys_schedule()

- sys_schedule can change only selected values, -1 means that the
  current value should be kept unchanged. For instance we mostly want
  to change the scheduling quantum and priority but we want to keep
  the process at the current cpu

- RS can hand off its processes to scheduler

- service can read the destination cpu from system.conf

- RS can pass the information farther
This commit is contained in:
Tomas Hruby
2010-09-15 14:10:42 +00:00
parent c554aef0e1
commit 06b6e5624a
19 changed files with 104 additions and 38 deletions

View File

@@ -8,7 +8,7 @@ PUBLIC int do_schedctl(struct proc * caller, message * m_ptr)
{
struct proc *p;
unsigned flags;
unsigned priority, quantum;
int priority, quantum, cpu;
int proc_nr;
int r;
@@ -29,11 +29,12 @@ PUBLIC int do_schedctl(struct proc * caller, message * m_ptr)
/* the kernel becomes the scheduler and starts
* scheduling the process.
*/
priority = (unsigned) m_ptr->SCHEDCTL_PRIORITY;
quantum = (unsigned) m_ptr->SCHEDCTL_QUANTUM;
priority = (int) m_ptr->SCHEDCTL_PRIORITY;
quantum = (int) m_ptr->SCHEDCTL_QUANTUM;
cpu = (int) m_ptr->SCHEDCTL_CPU;
/* Try to schedule the process. */
if((r = sched_proc(p, priority, quantum) != OK))
if((r = sched_proc(p, priority, quantum, cpu) != OK))
return r;
p->p_scheduler = NULL;
} else {

View File

@@ -9,7 +9,7 @@ PUBLIC int do_schedule(struct proc * caller, message * m_ptr)
{
struct proc *p;
int proc_nr;
unsigned priority, quantum;
int priority, quantum, cpu;
if (!isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr))
return EINVAL;
@@ -21,7 +21,9 @@ PUBLIC int do_schedule(struct proc * caller, message * m_ptr)
return(EPERM);
/* Try to schedule the process. */
priority = (unsigned) m_ptr->SCHEDULING_PRIORITY;
quantum = (unsigned) m_ptr->SCHEDULING_QUANTUM;
return sched_proc(p, priority, quantum);
priority = (int) m_ptr->SCHEDULING_PRIORITY;
quantum = (int) m_ptr->SCHEDULING_QUANTUM;
cpu = (int) m_ptr->SCHEDULING_CPU;
return sched_proc(p, priority, quantum, cpu);
}