Changeset 26678e5 in mainline


Ignore:
Timestamp:
2006-09-26T15:10:40Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86b31ba9
Parents:
b44939b
Message:

Make SMP related parts of main.c more generic.
Move initialization of local APIC to architecture specific code.
Add arch_post_cpu_init() to support the above.

Location:
kernel
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    rb44939b r26678e5  
    192192        generic/src/synch/futex.c \
    193193        generic/src/smp/ipi.c \
     194        generic/src/smp/smp.c \
    194195        generic/src/ipc/ipc.c \
    195196        generic/src/ipc/sysipc.c \
  • kernel/arch/amd64/src/amd64.c

    rb44939b r26678e5  
    4545#include <arch/drivers/i8254.h>
    4646#include <arch/drivers/i8259.h>
     47
     48#ifdef CONFIG_SMP
     49#include <arch/smp/apic.h>
     50#endif
    4751
    4852#include <arch/bios/bios.h>
     
    157161}
    158162
     163void arch_post_cpu_init()
     164{
     165#ifdef CONFIG_SMP
     166        if (config.cpu_active > 1) {
     167                l_apic_init();
     168                l_apic_debug();
     169        }
     170#endif
     171}
     172
    159173void arch_pre_smp_init(void)
    160174{
  • kernel/arch/ia32/include/smp/mps.h

    rb44939b r26678e5  
    121121} __attribute__ ((packed));
    122122
    123 
    124 extern waitq_t ap_completion_wq;
    125 
    126123extern struct smp_config_operations mps_config_operations;
    127124
    128125extern void mps_init(void);
    129 extern void kmp(void *arg);
    130126
    131127#endif
  • kernel/arch/ia32/src/ia32.c

    rb44939b r26678e5  
    6363#include <console/console.h>
    6464
     65#ifdef CONFIG_SMP
     66#include <arch/smp/apic.h>
     67#endif
     68
    6569void arch_pre_mm_init(void)
    6670{
     
    98102                zone_merge_all();
    99103        }
     104}
     105
     106void arch_post_cpu_init()
     107{
     108#ifdef CONFIG_SMP
     109        if (config.cpu_active > 1) {
     110                l_apic_init();
     111                l_apic_debug();
     112        }
     113#endif
    100114}
    101115
  • kernel/arch/ia32/src/smp/mps.c

    rb44939b r26678e5  
    8585int l_intr_entry_cnt = 0;
    8686
    87 waitq_t ap_completion_wq;
    88 
    8987/*
    9088 * Implementation of IA-32 SMP configuration interface.
  • kernel/arch/ia32/src/smp/smp.c

    rb44939b r26678e5  
    105105        ASSERT(ops != NULL);
    106106
    107         waitq_initialize(&ap_completion_wq);
    108 
    109107        /*
    110108         * We need to access data in frame 0.
  • kernel/arch/ia64/src/ia64.c

    rb44939b r26678e5  
    9090}
    9191
     92void arch_post_cpu_init(void)
     93{
     94}
     95
    9296void arch_pre_smp_init(void)
    9397{
  • kernel/arch/mips32/src/mips32.c

    rb44939b r26678e5  
    132132}
    133133
     134void arch_post_cpu_init(void)
     135{
     136}
     137
    134138void arch_pre_smp_init(void)
    135139{
  • kernel/arch/ppc32/src/ppc32.c

    rb44939b r26678e5  
    8383}
    8484
     85void arch_post_cpu_init(void)
     86{
     87}
     88
    8589void arch_pre_smp_init(void)
    8690{
  • kernel/arch/ppc64/src/ppc64.c

    rb44939b r26678e5  
    7676}
    7777
     78void arch_post_cpu_init(void)
     79{
     80}
     81
    7882void arch_pre_smp_init(void)
    7983{
  • kernel/arch/sparc64/src/sparc64.c

    rb44939b r26678e5  
    7979}
    8080
     81void arch_post_cpu_init(void)
     82{
     83}
     84
    8185void arch_pre_smp_init(void)
    8286{
  • kernel/arch/xen32/src/xen32.c

    rb44939b r26678e5  
    152152}
    153153
     154void arch_post_cpu_init(void)
     155{
     156}
     157
    154158void arch_pre_smp_init(void)
    155159{
  • kernel/generic/include/arch.h

    rb44939b r26678e5  
    7676extern void arch_pre_mm_init(void);
    7777extern void arch_post_mm_init(void);
     78extern void arch_post_cpu_init(void);
    7879extern void arch_pre_smp_init(void);
    7980extern void arch_post_smp_init(void);
  • kernel/generic/include/smp/smp.h

    rb44939b r26678e5  
    3636#define KERN_SMP_H_
    3737
     38#include <synch/waitq.h>
     39
     40extern waitq_t ap_completion_wq;
     41
    3842#ifdef CONFIG_SMP
    3943extern void smp_init(void);
     44extern void kmp(void *arg);
    4045#else
    41 #define smp_init()      ;
     46#define smp_init()
    4247#endif /* CONFIG_SMP */
    4348
  • kernel/generic/src/main/kinit.c

    rb44939b r26678e5  
    6464
    6565#ifdef CONFIG_SMP
    66 #include <arch/smp/mps.h>
     66#include <smp/smp.h>
    6767#endif /* CONFIG_SMP */
    6868
     
    9595#ifdef CONFIG_SMP                       
    9696        if (config.cpu_count > 1) {
     97                waitq_initialize(&ap_completion_wq);
    9798                /*
    9899                 * Create the kmp thread and wait for its completion.
  • kernel/generic/src/main/main.c

    rb44939b r26678e5  
    8080#include <adt/btree.h>
    8181#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 */
    8782#include <smp/smp.h>
    8883
     
    272267 *
    273268 * 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.
    275270 * This function passes control directly to
    276271 * main_ap_separated_stack().
     
    283278        /*
    284279         * Incrementing the active CPU counter will guarantee that the
    285          * pm_init() will not attempt to build GDT and IDT tables again.
    286          * Neither frame_init() will do the complete thing. Neither cpu_init()
    287          * will do.
     280         * *_init() functions can find out that they need to
     281         * do initialization for AP only.
    288282         */
    289283        config.cpu_active++;
     
    301295       
    302296        cpu_init();
    303        
    304297        calibrate_delay_loop();
    305 
    306         l_apic_init();
    307         l_apic_debug();
     298        arch_post_cpu_init();
    308299
    309300        the_copy(THE, (the_t *) CPU->stack);
Note: See TracChangeset for help on using the changeset viewer.