Split atomic library
[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         
30         switch (progress++) {
31                 case 0:
32                         printk("Beginning Tests\n");
33                         test_run_measurements(progress-1);  // should never return
34                         break;
35                 case 1:
36                 case 2:
37                 case 3:
38                 case 4:
39                 case 5:
40                 case 6:
41                 case 7:
42                 case 8:
43                 case 9:
44                 case 10:
45                 case 11:
46                 case 12:
47                 case 13:
48                 case 14:
49                         test_run_measurements(progress-1);
50                         break;
51                 default:
52                         panic("Don't Panic");
53         }
54         panic("If you see me, then you probably screwed up");
55
56         /*
57         printk("Servicing syscalls from Core 0:\n\n");
58         while (1) {
59                 process_generic_syscalls(&envs[0], 1);
60                 cpu_relax();
61         }
62         */
63         return;
64 }
65