POK(kernelpart)
boot.c
Go to the documentation of this file.
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
24 #include <arch.h>
25 #include <bsp.h>
26 
27 #include <core/time.h>
28 #include <core/thread.h>
29 #include <core/sched.h>
30 #include <core/partition.h>
31 #include <middleware/port.h>
32 #include <middleware/queue.h>
33 #include <core/boot.h>
34 
35 #include <core/instrumentation.h>
36 
37 void pok_boot ()
38 {
39  pok_arch_init();
40  pok_bsp_init();
41 
42 #if defined (POK_NEEDS_TIME) || defined (POK_NEEDS_SCHED) || defined (POK_NEEDS_THREADS)
43  pok_time_init();
44 #endif
45 
46 #ifdef POK_NEEDS_PARTITIONS
47  pok_partition_init ();
48 #endif
49 
50 #ifdef POK_NEEDS_THREADS
51  pok_thread_init ();
52 #endif
53 
54 #if defined (POK_NEEDS_SCHED) || defined (POK_NEEDS_THREADS)
55  pok_sched_init ();
56 #endif
57 
58 #if (defined POK_NEEDS_LOCKOBJ) || defined (POK_NEEDS_PORTS_QUEUEING) || defined (POK_NEEDS_PORTS_SAMPLING)
60 #endif
61 #if defined (POK_NEEDS_PORTS_QUEUEING) || defined (POK_NEEDS_PORTS_SAMPLING)
62  pok_port_init ();
63  pok_queue_init ();
64 #endif
65 
66 #if defined (POK_NEEDS_DEBUG) || defined (POK_NEEDS_CONSOLE)
67  pok_cons_write ("POK kernel initialized\n", 23);
68 #endif
69 
70 #ifdef POK_NEEDS_INSTRUMENTATION
71  uint32_t tmp;
72  printf ("[INSTRUMENTATION][CHEDDAR] <event_table>\n");
73  printf ("[INSTRUMENTATION][CHEDDAR] <processor>\n");
74  printf ("[INSTRUMENTATION][CHEDDAR] <name>pok_kernel</name>\n");
75 
76  for (tmp = 0 ; tmp < POK_CONFIG_NB_THREADS ; tmp++)
77  {
78  printf ("[INSTRUMENTATION][CHEDDAR] <task_activation> 0 task %d</task_activation>\n", tmp);
79  }
80 #endif
81 
83 
84 #ifndef POK_NEEDS_PARTITIONS
85 
90  main ();
91 #endif
92 }