Rev 1894 | Rev 1999 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1894 | Rev 1901 | ||
|---|---|---|---|
| Line 77... | Line 77... | ||
| 77 | #include <typedefs.h> |
77 | #include <typedefs.h> |
| 78 | #include <ipc/ipc.h> |
78 | #include <ipc/ipc.h> |
| 79 | #include <macros.h> |
79 | #include <macros.h> |
| 80 | #include <adt/btree.h> |
80 | #include <adt/btree.h> |
| 81 | #include <console/klog.h> |
81 | #include <console/klog.h> |
| 82 | - | ||
| 83 | #ifdef CONFIG_SMP |
- | |
| 84 | #include <arch/smp/apic.h> |
- | |
| 85 | #include <arch/smp/mps.h> |
- | |
| 86 | #endif /* CONFIG_SMP */ |
- | |
| 87 | #include <smp/smp.h> |
82 | #include <smp/smp.h> |
| 88 | 83 | ||
| 89 | /** Global configuration structure. */ |
84 | /** Global configuration structure. */ |
| 90 | config_t config; |
85 | config_t config; |
| 91 | 86 | ||
| Line 269... | Line 264... | ||
| 269 | 264 | ||
| 270 | #ifdef CONFIG_SMP |
265 | #ifdef CONFIG_SMP |
| 271 | /** Main kernel routine for application CPUs. |
266 | /** Main kernel routine for application CPUs. |
| 272 | * |
267 | * |
| 273 | * Executed by application processors, temporary stack |
268 | * Executed by application processors, temporary stack |
| 274 | * is at ctx.sp which was set during BP boot. |
269 | * is at ctx.sp which was set during BSP boot. |
| 275 | * This function passes control directly to |
270 | * This function passes control directly to |
| 276 | * main_ap_separated_stack(). |
271 | * main_ap_separated_stack(). |
| 277 | * |
272 | * |
| 278 | * Assuming interrupts_disable()'d. |
273 | * Assuming interrupts_disable()'d. |
| 279 | * |
274 | * |
| 280 | */ |
275 | */ |
| 281 | void main_ap(void) |
276 | void main_ap(void) |
| 282 | { |
277 | { |
| 283 | /* |
278 | /* |
| 284 | * Incrementing the active CPU counter will guarantee that the |
279 | * Incrementing the active CPU counter will guarantee that the |
| 285 | * pm_init() will not attempt to build GDT and IDT tables again. |
280 | * *_init() functions can find out that they need to |
| 286 | * Neither frame_init() will do the complete thing. Neither cpu_init() |
281 | * do initialization for AP only. |
| 287 | * will do. |
- | |
| 288 | */ |
282 | */ |
| 289 | config.cpu_active++; |
283 | config.cpu_active++; |
| 290 | 284 | ||
| 291 | /* |
285 | /* |
| 292 | * The THE structure is well defined because ctx.sp is used as stack. |
286 | * The THE structure is well defined because ctx.sp is used as stack. |
| Line 298... | Line 292... | ||
| 298 | page_init(); |
292 | page_init(); |
| 299 | tlb_init(); |
293 | tlb_init(); |
| 300 | arch_post_mm_init(); |
294 | arch_post_mm_init(); |
| 301 | 295 | ||
| 302 | cpu_init(); |
296 | cpu_init(); |
| 303 | - | ||
| 304 | calibrate_delay_loop(); |
297 | calibrate_delay_loop(); |
| 305 | - | ||
| 306 | l_apic_init(); |
298 | arch_post_cpu_init(); |
| 307 | l_apic_debug(); |
- | |
| 308 | 299 | ||
| 309 | the_copy(THE, (the_t *) CPU->stack); |
300 | the_copy(THE, (the_t *) CPU->stack); |
| 310 | 301 | ||
| 311 | /* |
302 | /* |
| 312 | * If we woke kmp up before we left the kernel stack, we could |
303 | * If we woke kmp up before we left the kernel stack, we could |