Merge branch 'master' into proc-work
[akaros.git] / kern / src / manager.c
index c722a71..be5306e 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2009 The Regents of the University of California
+ * Barret Rhoden <brho@cs.berkeley.edu>
  * See LICENSE for details.
  */
 
 
 #include <assert.h>
 #include <manager.h>
-#include <env.h>
+#include <process.h>
 #include <workqueue.h>
 #include <syscall.h>
 #include <testing.h>
+#include <kfs.h>
 
 /*
  * Currently, if you leave this function by way of env_run (process_workqueue
@@ -28,28 +30,24 @@ void manager(void)
        env_t *envs[256];
 
        switch (progress++) {
-       
-       #ifdef __i386__
-
                case 0:
+                       envs[0] = kfs_proc_create(kfs_lookup_path("roslib_hello"));
+                       proc_set_state(envs[0], PROC_RUNNABLE_S);
+                       env_run(envs[0]);
+                       break;
+       #ifdef __i386__
+               case 1:
+                       panic("Do not panic");
                        envs[0] = ENV_CREATE(parlib_channel_test_client);
                        envs[1] = ENV_CREATE(parlib_channel_test_server);
                        smp_call_function_single(1, run_env_handler, envs[0], 0);
                        smp_call_function_single(2, run_env_handler, envs[1], 0);
-
-       #if 0
-               case 0:
-                       printk("Beginning Tests\n");
-                       test_run_measurements(progress-1);  // should never return
                        break;
-       #endif
-
-               case 1:
                case 2:
                case 3:
-       #else
-
-               case 0:
+       #else // sparc
+               case 1:
+                       panic("Do not panic");
                        envs[0] = ENV_CREATE(roslib_proctests);
                        envs[1] = ENV_CREATE(roslib_proctests);
                        envs[2] = ENV_CREATE(roslib_proctests);
@@ -58,16 +56,43 @@ void manager(void)
                        envs[4] = ENV_CREATE(roslib_fptest);
                        envs[5] = ENV_CREATE(roslib_hello);
                        envs[6] = ENV_CREATE(roslib_null);
-                       //envs[6] = ENV_CREATE(roslib_measurements);
                        env_run(envs[0]);
                        break;
-               case 1:
                case 2:
+                       #if 0
+                       // reminder of how to spawn remotely
+                       for (int i = 0; i < 8; i++) {
+                               envs[i] = kfs_proc_create(kfs_lookup_path("roslib_hello"));
+                               proc_set_state(envs[i], PROC_RUNNABLE_S);
+                               smp_call_function_single(i, run_env_handler, envs[i], 0);
+                       }
+                       process_workqueue();
+                       #endif
                case 3:
-
        #endif
 
+               #if 0
+               case 4:
+                       printk("Beginning Tests\n");
+                       test_run_measurements(progress-1);  // should never return
+                       break;
+               case 5:
+                       envs[0] = ENV_CREATE(parlib_channel_test_client);
+                       envs[1] = ENV_CREATE(parlib_channel_test_server);
+                       smp_call_function_single(1, run_env_handler, envs[0], 0);
+                       smp_call_function_single(2, run_env_handler, envs[1], 0);
+               case 6:
+               #endif
                case 4:
+                       /*
+                       test_smp_call_functions();
+                       test_checklists();
+                       test_barrier();
+                       test_print_info();
+                       test_lapic_status_bit();
+                       test_ipi_sending();
+                       test_pit();
+                       */
                case 5:
                case 6:
                case 7:
@@ -79,7 +104,6 @@ void manager(void)
                case 13:
                case 14:
                        //test_run_measurements(progress-1);
-                       break;
                default:
                        printk("Manager Progress: %d\n", progress);
                        schedule();