iproute.c compiles
[akaros.git] / kern / src / manager.c
index 1e1fece..20111b9 100644 (file)
@@ -31,7 +31,7 @@
 #include <string.h>
 #include <pmap.h>
 #include <arch/console.h>
-#include <ros/time.h>
+#include <time.h>
 #include <ros/arch/membar.h>
 
 /*
@@ -113,18 +113,18 @@ void manager_brho(void)
        struct per_cpu_info *pcpui = &per_cpu_info[core_id()];
 
        if (first) {    
-               printk("*** Hit shift-g to get into the monitor. ***\n");
+               printk("*** IRQs must be enabled for input emergency codes ***\n");
+               #ifdef CONFIG_X86
+               printk("*** Hit ctrl-g or shift-g to enter the monitor. ***\n");
+               printk("*** Hit ctrl-q to force-enter the monitor. ***\n");
+               printk("*** Hit ctrl-b for a backtrace of core 0 ***\n");
+               #else
+               printk("*** Hit shift-g to enter the monitor. ***\n");
+               #endif
                first = FALSE;
        }
-       while (1) {
-               enable_irq();
-               process_routine_kmsg(0);
-               /* would like to idle here, but without reset stacks, people will run
-                * off the kstack.  so just idle if we have an owning proc (which we
-                * should then 'restart'). */
-               if (pcpui->owning_proc)
-                       smp_idle();
-       }
+       /* just idle, and deal with things via interrupts.  or via face. */
+       smp_idle();
        /* whatever we do in the manager, keep in mind that we need to not do
         * anything too soon (like make processes), since we'll drop in here during
         * boot if the boot sequence required any I/O (like EXT2), and we need to
@@ -179,6 +179,7 @@ void manager_brho(void)
                                spin_unlock(&p->proc_lock);
                                udelay(5000000);
                                printk("Killing p\n");
+                               enable_irq();
                                proc_destroy(p);
                                printk("Killed p\n");
                        panic("This is okay");
@@ -203,7 +204,7 @@ void manager_brho(void)
                        printd("Manager Progress: %d\n", progress);
                        // delay if you want to test rescheduling an MCP that yielded
                        //udelay(15000000);
-                       schedule();
+                       run_scheduler();
        }
        panic("If you see me, then you probably screwed up");
        monitor(0);
@@ -232,15 +233,17 @@ void manager_klueska()
                proc_run_s(envs[0]);
                warn("DEPRECATED");
        }
-       schedule();
+       run_scheduler();
 
        panic("DON'T PANIC");
 }
 
 void manager_waterman()
 {
-       schedule();
-       monitor(0);
+       static bool first = true;
+       if (first)
+               mon_bb(0, 0, 0);
+       smp_idle();
        assert(0);
 }
 
@@ -261,54 +264,3 @@ void manager_yuzhu()
        // quick_proc_run("hello", p);
 
 }
-
-#ifdef __sparc_v8__
-
-static char*
-itoa(int num, char* buf0, size_t base)
-{
-       if(base > 16)
-               return NULL;
-
-       char* buf = buf0;
-       int len = 0, i;
-
-       if(num < 0)
-       {
-               *buf++ = '-';
-               num = -num;
-       }
-
-       do {
-               buf[len++] = "0123456789abcdef"[num%base];
-               num /= base;
-       } while(num);
-
-       for(i = 0; i < len/2; i++)
-       {
-               char temp = buf[i];
-               buf[i] = buf[len-i-1];
-               buf[len-i-1] = temp;
-       }
-       buf[len] = 0;
-
-       return buf0;
-}
-
-void gsf_set_frame_cycles(int cycles)
-{
-       store_alternate(26*4,2,cycles);
-}
-
-void gsf_set_partition_credits(int partition, int credits)
-{
-       store_alternate((32+partition)*4,2,credits);
-}
-
-void gsf_set_core_partition(int core, int partition)
-{
-       store_alternate((64+core)*4,2,partition);
-}
-
-#endif
-