Changeset 508 for Whitix/branches/smp
- Timestamp:
- 05/18/08 18:04:29 (4 years ago)
- Files:
-
- 1 modified
-
Whitix/branches/smp/arch/i386/kernel/smp.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/smp/arch/i386/kernel/smp.c
r507 r508 26 26 27 27 int numProcessors=0; 28 DWORD apicAddr; 28 29 29 30 struct MpConfig; … … 158 159 void SmpReadProcessorConfig(struct MpProcessorConfig* config) 159 160 { 160 printf("SMP: CPU%d present\n", numProcessors);161 printf("SMP: CPU%d present\n", config->apicId); 161 162 162 163 numProcessors++; … … 207 208 208 209 printf("SMP: APIC at %#X\n", mpConfig->apicAddress); 210 apicAddr=mpConfig->apicAddress; 209 211 210 212 /* Now process the blocks after the structure. */ 211 213 while (offset < mpConfig->length) 212 214 { 213 printf("(%#X %u %u %u) ", tables, offset, *tables, mpConfig->length);215 // printf("(%#X %u %u %u) ", tables, offset, *tables, mpConfig->length); 214 216 switch (*tables) 215 217 { … … 247 249 } 248 250 251 void ApicMap() 252 { 253 /* Do a one-to-one physical mapping of the APIC. */ 254 VirtMemMapPage(apicAddr, apicAddr, 3); 255 } 256 257 int ApicVerify() 258 { 259 /* TODO */ 260 return 0; 261 } 262 249 263 int SmpInit() 250 264 { … … 257 271 printf("SMP: Intel MultiProcessor Specification V1.%u\n", floatingTable->version); 258 272 259 return SmpReadConfig(floatingTable->config); 260 } 273 if (SmpReadConfig(floatingTable->config)) 274 { 275 printf("SMP: Failed to read configuration.\n"); 276 return 0; 277 } 278 279 ApicMap(); 280 281 /* Verify the local APIC of the boot processor exists. */ 282 ApicVerify(); 283 284 285 286 return 0; 287 }
