Changes in kernel/arch/ia32/src/smp/smp.c [1b20da0:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/smp/smp.c
r1b20da0 ra35b458 68 68 ops = &madt_config_operations; 69 69 } 70 70 71 71 if (config.cpu_count == 1) { 72 72 mps_init(); 73 73 ops = &mps_config_operations; 74 74 } 75 75 76 76 if (config.cpu_count > 1) { 77 77 l_apic = (uint32_t *) km_map((uintptr_t) l_apic, PAGE_SIZE, … … 86 86 assert(ops != NULL); 87 87 assert(cpus != NULL); 88 88 89 89 for (unsigned int i = 0; i < config.cpu_count; ++i) { 90 90 cpus[i].arch.id = ops->cpu_apic_id(i); … … 102 102 { 103 103 unsigned int i; 104 104 105 105 assert(ops != NULL); 106 106 … … 110 110 */ 111 111 cpu_arch_id_init(); 112 112 113 113 /* 114 114 * We need to access data in frame 0. 115 115 * We boldly make use of kernel address space mapping. 116 116 */ 117 117 118 118 /* 119 119 * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot() … … 122 122 (uint16_t) (((uintptr_t) ap_boot) >> 4); /* segment */ 123 123 *((uint16_t *) (PA2KA(0x467 + 2))) = 0; /* offset */ 124 124 125 125 /* 126 126 * Save 0xa to address 0xf of the CMOS RAM. … … 129 129 pio_write_8((ioport8_t *) 0x70, 0xf); 130 130 pio_write_8((ioport8_t *) 0x71, 0xa); 131 131 132 132 pic_disable_irqs(0xffff); 133 133 apic_init(); 134 134 135 135 for (i = 0; i < config.cpu_count; i++) { 136 136 /* … … 139 139 if (!ops->cpu_enabled(i)) 140 140 continue; 141 141 142 142 /* 143 143 * The bootstrap processor is already up. … … 145 145 if (ops->cpu_bootstrap(i)) 146 146 continue; 147 147 148 148 if (ops->cpu_apic_id(i) == bsp_l_apic) { 149 149 log(LF_ARCH, LVL_ERROR, "kmp: bad processor entry #%u, " … … 151 151 continue; 152 152 } 153 153 154 154 /* 155 155 * Prepare new GDT for CPU in question. 156 156 */ 157 157 158 158 /* XXX Flag FRAME_LOW_4_GiB was removed temporarily, 159 159 * it needs to be replaced by a generic fuctionality of … … 165 165 if (!gdt_new) 166 166 panic("Cannot allocate memory for GDT."); 167 167 168 168 memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(descriptor_t)); 169 169 memsetb(&gdt_new[TSS_DES], sizeof(descriptor_t), 0); … … 171 171 protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new); 172 172 gdtr.base = (uintptr_t) gdt_new; 173 173 174 174 if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) { 175 175 /*
Note:
See TracChangeset
for help on using the changeset viewer.