Built a basic framework for sending ethernet packets from userland. Switched from...
[akaros.git] / kern / src / manager.c
1 /*
2  * Copyright (c) 2009 The Regents of the University of California
3  * See LICENSE for details.
4  */
5
6 #ifdef __DEPUTY__
7 #pragma nodeputy
8 #endif
9
10 #include <arch/types.h>
11 #include <arch/apic.h>
12 #include <arch/smp.h>
13
14 #include <assert.h>
15 #include <manager.h>
16 #include <env.h>
17 #include <workqueue.h>
18 #include <syscall.h>
19 #include <testing.h>
20
21 /*
22  * Currently, if you leave this function by way of env_run (process_workqueue
23  * that env_runs), you will never come back to where you left off, and the
24  * function will start from the top.  Hence the hack 'progress'.
25  */
26 void manager(void)
27 {
28         static uint8_t progress = 0;
29         env_t *env_batch[64];
30     if(progress == 0) {
31             progress++;
32             env_batch[0] = ENV_CREATE(parlib_matrix);
33             env_run(env_batch[0]);
34     }
35
36         switch (progress++) {
37                 case 0:
38                         printk("Beginning Tests\n");
39                         test_run_measurements(progress-1);  // should never return
40                         break;
41                 case 1:
42                 case 2:
43                 case 3:
44                 case 4:
45                 case 5:
46                 case 6:
47                 case 7:
48                 case 8:
49                 case 9:
50                 case 10:
51                 case 11:
52                 case 12:
53                 case 13:
54                 case 14:
55                         test_run_measurements(progress-1);
56                         break;
57                 default:
58                         panic("Don't Panic");
59         }
60         panic("If you see me, then you probably screwed up");
61
62         /*
63         printk("Servicing syscalls from Core 0:\n\n");
64         while (1) {
65                 process_generic_syscalls(&envs[0], 1);
66                 cpu_relax();
67         }
68         */
69         return;
70 }
71