Sorted out proc refcounting with ARCs
[akaros.git] / kern / src / smp.c
index c368467..8ccb931 100644 (file)
@@ -62,43 +62,3 @@ void smp_idle(void)
        }
        assert(0);
 }
-
-#ifdef __CONFIG_EXPER_TRADPROC__
-/* For experiments with per-core schedulers (traditional).  This checks the
- * runqueue, and if there is something there, it runs in.  Note this does
- * nothing for whoever was running here.  Consider saving and restoring them,
- * resetting current, etc. */
-void local_schedule(void)
-{
-       struct per_cpu_info *my_info = &per_cpu_info[core_id()];
-       struct proc *next_to_run;
-
-       spin_lock_irqsave(&my_info->runqueue_lock);
-       next_to_run = TAILQ_FIRST(&my_info->runqueue);
-       if (next_to_run)
-               TAILQ_REMOVE(&my_info->runqueue, next_to_run, proc_link);
-       spin_unlock_irqsave(&my_info->runqueue_lock);
-       if (!next_to_run)
-               return;
-       assert(next_to_run->state == PROC_RUNNING_M); // FILTHY HACK
-       printd("Core %d trying to run proc %08p\n", core_id(), next_to_run);
-       void proc_run_hand(struct trapframe *tf, uint32_t src_id, void *p, void *a1,
-                          void *a2)
-       {
-               proc_run((struct proc*)p);
-       }
-       send_kernel_message(core_id(), proc_run_hand, (void*)next_to_run, 0, 0,
-                           KMSG_ROUTINE);
-       return;
-}
-
-void local_schedule_proc(uint32_t core, struct proc *p)
-{
-       assert(core); // for sanity don't put them on core0 or any management core
-       struct per_cpu_info *my_info = &per_cpu_info[core];
-       spin_lock_irqsave(&my_info->runqueue_lock);
-       TAILQ_INSERT_TAIL(&my_info->runqueue, p, proc_link);
-       printd("SCHED: inserting proc %p on core %d\n", p, core);
-       spin_unlock_irqsave(&my_info->runqueue_lock);
-}
-#endif /* __CONFIG_EXPER_TRADPROC__ */