Changeset 7f043c0 in mainline for kernel/arch/ia32/src/smp/smp.c
- Timestamp:
- 2007-05-31T21:39:13Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bb0c32
- Parents:
- d8431986
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/smp/smp.c
rd8431986 r7f043c0 99 99 * as an initialization stack for each AP.) 100 100 */ 101 void kmp(void *arg )101 void kmp(void *arg __attribute__((unused))) 102 102 { 103 103 unsigned int i; … … 113 113 * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot() 114 114 */ 115 *((uint16_t *) (PA2KA(0x467 + 0))) = ((uintptr_t) ap_boot) >> 4; /* segment */116 *((uint16_t *) (PA2KA(0x467 + 2))) = 115 *((uint16_t *) (PA2KA(0x467 + 0))) = (uint16_t) (((uintptr_t) ap_boot) >> 4); /* segment */ 116 *((uint16_t *) (PA2KA(0x467 + 2))) = 0; /* offset */ 117 117 118 118 /* … … 125 125 pic_disable_irqs(0xffff); 126 126 apic_init(); 127 128 uint8_t apic = l_apic_id(); 127 129 128 130 for (i = 0; i < ops->cpu_count(); i++) { … … 141 143 continue; 142 144 143 if (ops->cpu_apic_id(i) == l_apic_id()) {144 printf("%s: bad processor entry #% d, will not send IPI to myself\n", __FUNCTION__, i);145 if (ops->cpu_apic_id(i) == apic) { 146 printf("%s: bad processor entry #%u, will not send IPI to myself\n", __FUNCTION__, i); 145 147 continue; 146 148 } … … 149 151 * Prepare new GDT for CPU in question. 150 152 */ 151 if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS *sizeof(struct descriptor), FRAME_ATOMIC)))153 if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS * sizeof(struct descriptor), FRAME_ATOMIC))) 152 154 panic("couldn't allocate memory for GDT\n"); 153 155 … … 164 166 * supposed to wake us up. 165 167 */ 166 if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT) 167 printf("%s: waiting for cpu%d (APIC ID = %d) timed out\n", __FUNCTION__, config.cpu_active > i ? config.cpu_active : i, ops->cpu_apic_id(i)); 168 if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT) { 169 unsigned int cpu = (config.cpu_active > i) ? config.cpu_active : i; 170 printf("%s: waiting for cpu%u (APIC ID = %d) timed out\n", __FUNCTION__, cpu, ops->cpu_apic_id(i)); 171 } 168 172 } else 169 173 printf("INIT IPI for l_apic%d failed\n", ops->cpu_apic_id(i));
Note:
See TracChangeset
for help on using the changeset viewer.