#include <sys/proc.h>
#include <kern/scheduler.h>
struct proc *current;
struct proc *all_proc[256];
int num_procs = 0;
int run_next = 0;
extern void proc_switch(struct proc *proc);
struct proc *
select_next_proc(void) {
run_next = (run_next + 1) % num_procs;
return all_proc[run_next];
}
void
sched_run_next_proc(void) {
current = select_next_proc();
proc_switch(current);
}
void
sched_add(struct proc *proc) {
all_proc[num_procs++] = proc;
}