Rev 113 | Rev 125 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 113 | Rev 116 | ||
---|---|---|---|
Line 402... | Line 402... | ||
402 | */ |
402 | */ |
403 | void kmp(void *arg) |
403 | void kmp(void *arg) |
404 | { |
404 | { |
405 | struct __processor_entry *pr; |
405 | struct __processor_entry *pr; |
406 | __address src, dst; |
406 | __address src, dst; |
407 | __address frame; |
- | |
408 | int i; |
407 | int i; |
409 | 408 | ||
410 | waitq_initialize(&ap_completion_wq); |
409 | waitq_initialize(&ap_completion_wq); |
411 | 410 | ||
412 | /* |
411 | /* |
Line 414... | Line 413... | ||
414 | */ |
413 | */ |
415 | pr = processor_entries; |
414 | pr = processor_entries; |
416 | 415 | ||
417 | /* |
416 | /* |
418 | * We need to access data in frame 0. |
417 | * We need to access data in frame 0. |
- | 418 | * We boldly make use of kernel address space mapping. |
|
419 | */ |
419 | */ |
420 | frame = frame_alloc(0); |
- | |
421 | map_page_to_frame(frame,0,PAGE_CACHEABLE,0); |
- | |
422 | 420 | ||
423 | /* |
421 | /* |
424 | * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot() |
422 | * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot() |
425 | */ |
423 | */ |
426 | *((__u16 *) (frame + 0x467+0)) = ((__address) ap_boot) >> 4; /* segment */ |
424 | *((__u16 *) (PA2KA(0x467+0))) = ((__address) ap_boot) >> 4; /* segment */ |
427 | *((__u16 *) (frame + 0x467+2)) = 0; /* offset */ |
425 | *((__u16 *) (PA2KA(0x467+2))) = 0; /* offset */ |
428 | 426 | ||
429 | /* |
427 | /* |
430 | * Give back and unmap the borrowed frame. |
- | |
431 | */ |
- | |
432 | map_page_to_frame(frame,0,PAGE_NOT_PRESENT,0); |
- | |
433 | frame_free(frame); |
- | |
434 | - | ||
435 | /* |
- | |
436 | * Save 0xa to address 0xf of the CMOS RAM. |
428 | * Save 0xa to address 0xf of the CMOS RAM. |
437 | * BIOS will not do the POST after the INIT signal. |
429 | * BIOS will not do the POST after the INIT signal. |
438 | */ |
430 | */ |
439 | outb(0x70,0xf); |
431 | outb(0x70,0xf); |
440 | outb(0x71,0xa); |
432 | outb(0x71,0xa); |
Line 469... | Line 461... | ||
469 | */ |
461 | */ |
470 | if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor)))) |
462 | if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor)))) |
471 | panic("couldn't allocate memory for GDT\n"); |
463 | panic("couldn't allocate memory for GDT\n"); |
472 | 464 | ||
473 | memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor)); |
465 | memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor)); |
- | 466 | memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0); |
|
474 | gdtr.base = KA2PA((__address) gdt_new); |
467 | gdtr.base = KA2PA((__address) gdt_new); |
475 | 468 | ||
476 | if (l_apic_send_init_ipi(pr[i].l_apic_id)) { |
469 | if (l_apic_send_init_ipi(pr[i].l_apic_id)) { |
477 | /* |
470 | /* |
478 | * There may be just one AP being initialized at |
471 | * There may be just one AP being initialized at |