Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1659 | giacomo | 1 | #define PI |
2 | |||
3 | #include "kernel/kern.h" |
||
4 | #include "modules/edf.h" |
||
5 | #include "modules/cbs.h" |
||
6 | #include "modules/rr.h" |
||
7 | /* |
||
8 | #ifndef PI |
||
9 | #include "modules/rrsoft.h" |
||
10 | #endif |
||
11 | */ |
||
12 | #include "modules/dummy.h" |
||
13 | |||
14 | #include "modules/sem.h" |
||
15 | #include "modules/hartport.h" |
||
16 | #include "modules/cabs.h" |
||
17 | #include "modules/pi.h" |
||
18 | #include "modules/pc.h" |
||
19 | #include "modules/srp.h" |
||
20 | #include "modules/npp.h" |
||
21 | #include "modules/nop.h" |
||
22 | |||
23 | #include "drivers/keyb.h" |
||
24 | #include "drivers/glib.h" |
||
25 | |||
26 | /*+ system tick in us +*/ |
||
27 | #define TICK 500 |
||
28 | |||
29 | /*+ RR tick in us +*/ |
||
30 | //#define RRTICK 10000 |
||
31 | #define RRTICK 3000 |
||
32 | |||
33 | TIME __kernel_register_levels__(void *arg) |
||
34 | { |
||
35 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
36 | |||
37 | |||
38 | |||
39 | |||
40 | |||
41 | #ifdef PI |
||
42 | EDF_register_level(0); //EDF_ENABLE_ALL); |
||
43 | CBS_register_level(0,0); //CBS_ENABLE_ALL, 0); |
||
44 | #else |
||
45 | RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT); |
||
46 | RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //cbs |
||
47 | #endif |
||
48 | |||
49 | RR_register_level(RRTICK, RR_MAIN_YES, mb); |
||
50 | dummy_register_level(); |
||
51 | |||
52 | |||
53 | SEM_register_module(); |
||
54 | |||
55 | CABS_register_module(); |
||
56 | |||
57 | PI_register_module(); |
||
58 | NOP_register_module(); |
||
59 | |||
60 | return TICK; |
||
61 | } |
||
62 | |||
63 | TASK __init__(void *arg) |
||
64 | { |
||
65 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
66 | |||
67 | HARTPORT_init(); |
||
68 | |||
69 | kern_printf("TIME=%d\n",sys_gettime(NULL)); |
||
70 | KEYB_init(NULL); |
||
71 | kern_printf("TIME=%d\n",sys_gettime(NULL)); |
||
72 | grx_init(); |
||
73 | __call_main__(mb); |
||
74 | |||
75 | return (void *)0; |
||
76 | } |
||
77 | |||
78 | |||
79 | #ifdef PI |
||
80 | void app_mutex_init(mutex_t *m) |
||
81 | { |
||
82 | PI_mutexattr_t attr; |
||
83 | |||
84 | PI_mutexattr_default(attr); |
||
85 | |||
86 | mutex_init(m, &attr); |
||
87 | } |
||
88 | /*#else |
||
89 | void app_mutex_init(mutex_t *m) |
||
90 | { |
||
91 | NOP_mutexattr_t attr; |
||
92 | |||
93 | NOP_mutexattr_default(attr); |
||
94 | |||
95 | mutex_init(m, &attr); |
||
96 | }*/ |
||
97 | #endif |
||
98 |