Rev 673 | Rev 684 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 673 | Rev 675 | ||
|---|---|---|---|
| Line 35... | Line 35... | ||
| 35 | #include <time/clock.h> |
35 | #include <time/clock.h> |
| 36 | #include <proc/scheduler.h> |
36 | #include <proc/scheduler.h> |
| 37 | #include <proc/thread.h> |
37 | #include <proc/thread.h> |
| 38 | #include <proc/task.h> |
38 | #include <proc/task.h> |
| 39 | #include <main/kinit.h> |
39 | #include <main/kinit.h> |
| - | 40 | #include <main/version.h> |
|
| 40 | #include <console/kconsole.h> |
41 | #include <console/kconsole.h> |
| 41 | #include <cpu.h> |
42 | #include <cpu.h> |
| 42 | #include <align.h> |
43 | #include <align.h> |
| 43 | #include <interrupt.h> |
44 | #include <interrupt.h> |
| 44 | #include <main/version.h> |
- | |
| 45 | - | ||
| 46 | #ifdef CONFIG_SMP |
- | |
| 47 | #include <arch/smp/apic.h> |
- | |
| 48 | #include <arch/smp/mps.h> |
- | |
| 49 | #endif /* CONFIG_SMP */ |
- | |
| 50 | - | ||
| 51 | #include <smp/smp.h> |
- | |
| 52 | - | ||
| 53 | #include <arch/mm/memory_init.h> |
45 | #include <arch/mm/memory_init.h> |
| 54 | #include <mm/heap.h> |
46 | #include <mm/heap.h> |
| 55 | #include <mm/frame.h> |
47 | #include <mm/frame.h> |
| 56 | #include <mm/page.h> |
48 | #include <mm/page.h> |
| 57 | #include <mm/tlb.h> |
49 | #include <mm/tlb.h> |
| 58 | #include <mm/vm.h> |
50 | #include <mm/vm.h> |
| 59 | - | ||
| 60 | #include <synch/waitq.h> |
51 | #include <synch/waitq.h> |
| 61 | - | ||
| 62 | #include <arch/arch.h> |
52 | #include <arch/arch.h> |
| 63 | #include <arch.h> |
53 | #include <arch.h> |
| 64 | #include <arch/faddr.h> |
54 | #include <arch/faddr.h> |
| 65 | - | ||
| 66 | #include <typedefs.h> |
55 | #include <typedefs.h> |
| 67 | 56 | ||
| - | 57 | #ifdef CONFIG_SMP |
|
| - | 58 | #include <arch/smp/apic.h> |
|
| - | 59 | #include <arch/smp/mps.h> |
|
| - | 60 | #endif /* CONFIG_SMP */ |
|
| 68 | config_t config; |
61 | #include <smp/smp.h> |
| - | 62 | ||
| - | 63 | config_t config; /**< Global configuration structure. */ |
|
| - | 64 | ||
| 69 | context_t ctx; |
65 | context_t ctx; |
| 70 | 66 | ||
| 71 | /** |
67 | /** |
| 72 | * These 'hardcoded' variables will be intialized by |
68 | * These 'hardcoded' variables will be intialized by |
| 73 | * the linker or the low level assembler code with |
69 | * the linker or the low level assembler code with |
| Line 95... | Line 91... | ||
| 95 | #endif |
91 | #endif |
| 96 | 92 | ||
| 97 | /** Bootstrap CPU main kernel routine |
93 | /** Bootstrap CPU main kernel routine |
| 98 | * |
94 | * |
| 99 | * Initializes the kernel by bootstrap CPU. |
95 | * Initializes the kernel by bootstrap CPU. |
| - | 96 | * This function passes control directly to |
|
| - | 97 | * main_bsp_separated_stack(). |
|
| 100 | * |
98 | * |
| 101 | * Assuming interrupts_disable(). |
99 | * Assuming interrupts_disable(). |
| 102 | * |
100 | * |
| 103 | */ |
101 | */ |
| 104 | void main_bsp(void) |
102 | void main_bsp(void) |
| Line 202... | Line 200... | ||
| 202 | */ |
200 | */ |
| 203 | t = thread_create(kinit, NULL, k, 0); |
201 | t = thread_create(kinit, NULL, k, 0); |
| 204 | if (!t) |
202 | if (!t) |
| 205 | panic("can't create kinit thread\n"); |
203 | panic("can't create kinit thread\n"); |
| 206 | thread_ready(t); |
204 | thread_ready(t); |
| - | 205 | ||
| 207 | /* |
206 | /* |
| 208 | * This call to scheduler() will return to kinit, |
207 | * This call to scheduler() will return to kinit, |
| 209 | * starting the thread of kernel threads. |
208 | * starting the thread of kernel threads. |
| 210 | */ |
209 | */ |
| 211 | scheduler(); |
210 | scheduler(); |
| Line 216... | Line 215... | ||
| 216 | #ifdef CONFIG_SMP |
215 | #ifdef CONFIG_SMP |
| 217 | /** Application CPUs main kernel routine |
216 | /** Application CPUs main kernel routine |
| 218 | * |
217 | * |
| 219 | * Executed by application processors, temporary stack |
218 | * Executed by application processors, temporary stack |
| 220 | * is at ctx.sp which was set during BP boot. |
219 | * is at ctx.sp which was set during BP boot. |
| - | 220 | * This function passes control directly to |
|
| - | 221 | * main_ap_separated_stack(). |
|
| 221 | * |
222 | * |
| 222 | * Assuming interrupts_disable()'d. |
223 | * Assuming interrupts_disable()'d. |
| 223 | * |
224 | * |
| 224 | */ |
225 | */ |
| 225 | void main_ap(void) |
226 | void main_ap(void) |