Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/smp/smp.c

    r1b20da0 ra35b458  
    6868                ops = &madt_config_operations;
    6969        }
    70        
     70
    7171        if (config.cpu_count == 1) {
    7272                mps_init();
    7373                ops = &mps_config_operations;
    7474        }
    75        
     75
    7676        if (config.cpu_count > 1) {
    7777                l_apic = (uint32_t *) km_map((uintptr_t) l_apic, PAGE_SIZE,
     
    8686        assert(ops != NULL);
    8787        assert(cpus != NULL);
    88        
     88
    8989        for (unsigned int i = 0; i < config.cpu_count; ++i) {
    9090                cpus[i].arch.id = ops->cpu_apic_id(i);
     
    102102{
    103103        unsigned int i;
    104        
     104
    105105        assert(ops != NULL);
    106106
     
    110110         */
    111111        cpu_arch_id_init();
    112        
     112
    113113        /*
    114114         * We need to access data in frame 0.
    115115         * We boldly make use of kernel address space mapping.
    116116         */
    117        
     117
    118118        /*
    119119         * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot()
     
    122122            (uint16_t) (((uintptr_t) ap_boot) >> 4);  /* segment */
    123123        *((uint16_t *) (PA2KA(0x467 + 2))) = 0;       /* offset */
    124        
     124
    125125        /*
    126126         * Save 0xa to address 0xf of the CMOS RAM.
     
    129129        pio_write_8((ioport8_t *) 0x70, 0xf);
    130130        pio_write_8((ioport8_t *) 0x71, 0xa);
    131        
     131
    132132        pic_disable_irqs(0xffff);
    133133        apic_init();
    134        
     134
    135135        for (i = 0; i < config.cpu_count; i++) {
    136136                /*
     
    139139                if (!ops->cpu_enabled(i))
    140140                        continue;
    141                
     141
    142142                /*
    143143                 * The bootstrap processor is already up.
     
    145145                if (ops->cpu_bootstrap(i))
    146146                        continue;
    147                
     147
    148148                if (ops->cpu_apic_id(i) == bsp_l_apic) {
    149149                        log(LF_ARCH, LVL_ERROR, "kmp: bad processor entry #%u, "
     
    151151                        continue;
    152152                }
    153                
     153
    154154                /*
    155155                 * Prepare new GDT for CPU in question.
    156156                 */
    157                
     157
    158158                /* XXX Flag FRAME_LOW_4_GiB was removed temporarily,
    159159                 * it needs to be replaced by a generic fuctionality of
     
    165165                if (!gdt_new)
    166166                        panic("Cannot allocate memory for GDT.");
    167                
     167
    168168                memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(descriptor_t));
    169169                memsetb(&gdt_new[TSS_DES], sizeof(descriptor_t), 0);
     
    171171                protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new);
    172172                gdtr.base = (uintptr_t) gdt_new;
    173                
     173
    174174                if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) {
    175175                        /*
Note: See TracChangeset for help on using the changeset viewer.