/trunk/kernel/generic/include/smp/smp.h |
---|
35,10 → 35,15 |
#ifndef KERN_SMP_H_ |
#define KERN_SMP_H_ |
#include <synch/waitq.h> |
extern waitq_t ap_completion_wq; |
#ifdef CONFIG_SMP |
extern void smp_init(void); |
extern void kmp(void *arg); |
#else |
#define smp_init() ; |
#define smp_init() |
#endif /* CONFIG_SMP */ |
#endif /* __SMP_H__ */ |
/trunk/kernel/generic/include/arch.h |
---|
75,6 → 75,7 |
extern void arch_pre_main(void); |
extern void arch_pre_mm_init(void); |
extern void arch_post_mm_init(void); |
extern void arch_post_cpu_init(void); |
extern void arch_pre_smp_init(void); |
extern void arch_post_smp_init(void); |
extern void calibrate_delay_loop(void); |
/trunk/kernel/generic/src/main/kinit.c |
---|
63,7 → 63,7 |
#include <security/cap.h> |
#ifdef CONFIG_SMP |
#include <arch/smp/mps.h> |
#include <smp/smp.h> |
#endif /* CONFIG_SMP */ |
#include <synch/waitq.h> |
94,6 → 94,7 |
#ifdef CONFIG_SMP |
if (config.cpu_count > 1) { |
waitq_initialize(&ap_completion_wq); |
/* |
* Create the kmp thread and wait for its completion. |
* cpu1 through cpuN-1 will come up consecutively and |
/trunk/kernel/generic/src/main/main.c |
---|
79,11 → 79,6 |
#include <macros.h> |
#include <adt/btree.h> |
#include <console/klog.h> |
#ifdef CONFIG_SMP |
#include <arch/smp/apic.h> |
#include <arch/smp/mps.h> |
#endif /* CONFIG_SMP */ |
#include <smp/smp.h> |
/** Global configuration structure. */ |
271,7 → 266,7 |
/** Main kernel routine for application CPUs. |
* |
* Executed by application processors, temporary stack |
* is at ctx.sp which was set during BP boot. |
* is at ctx.sp which was set during BSP boot. |
* This function passes control directly to |
* main_ap_separated_stack(). |
* |
282,9 → 277,8 |
{ |
/* |
* Incrementing the active CPU counter will guarantee that the |
* pm_init() will not attempt to build GDT and IDT tables again. |
* Neither frame_init() will do the complete thing. Neither cpu_init() |
* will do. |
* *_init() functions can find out that they need to |
* do initialization for AP only. |
*/ |
config.cpu_active++; |
300,12 → 294,9 |
arch_post_mm_init(); |
cpu_init(); |
calibrate_delay_loop(); |
arch_post_cpu_init(); |
l_apic_init(); |
l_apic_debug(); |
the_copy(THE, (the_t *) CPU->stack); |
/* |
/trunk/kernel/generic/src/smp/smp.c |
---|
0,0 → 1,46 |
/* |
* Copyright (C) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup generic |
* @{ |
*/ |
/** |
* @file |
*/ |
#include <smp/smp.h> |
#ifdef CONFIG_SMP |
waitq_t ap_completion_wq; |
#endif /* CONFIG_SMP */ |
/** @} |
*/ |