|
Lines 392-398
Link Here
|
| 392 |
|
392 |
|
| 393 |
found: |
393 |
found: |
| 394 |
/* calculate needed resources */ |
394 |
/* calculate needed resources */ |
| 395 |
mpfps = (mpfps_t)x; |
395 |
mpfps = (mpfps_t)(x + KERNBASE); |
| 396 |
if (mptable_pass1()) |
396 |
if (mptable_pass1()) |
| 397 |
panic("you must reconfigure your kernel"); |
397 |
panic("you must reconfigure your kernel"); |
| 398 |
|
398 |
|
|
Lines 691-702
Link Here
|
| 691 |
{UNKNOWN_BUSTYPE, "---"}, |
691 |
{UNKNOWN_BUSTYPE, "---"}, |
| 692 |
{UNKNOWN_BUSTYPE, "---"}, |
692 |
{UNKNOWN_BUSTYPE, "---"}, |
| 693 |
{ISA, "ISA"}, |
693 |
{ISA, "ISA"}, |
|
|
694 |
{ISA, "NEC98"}, |
| 694 |
{UNKNOWN_BUSTYPE, "---"}, |
695 |
{UNKNOWN_BUSTYPE, "---"}, |
| 695 |
{UNKNOWN_BUSTYPE, "---"}, |
696 |
{UNKNOWN_BUSTYPE, "---"}, |
| 696 |
{UNKNOWN_BUSTYPE, "---"}, |
697 |
{UNKNOWN_BUSTYPE, "---"}, |
| 697 |
{UNKNOWN_BUSTYPE, "---"}, |
698 |
{UNKNOWN_BUSTYPE, "---"}, |
| 698 |
{UNKNOWN_BUSTYPE, "---"}, |
699 |
{UNKNOWN_BUSTYPE, "---"}, |
| 699 |
{UNKNOWN_BUSTYPE, "---"}, |
|
|
| 700 |
{PCI, "PCI"}, |
700 |
{PCI, "PCI"}, |
| 701 |
{UNKNOWN_BUSTYPE, "---"}, |
701 |
{UNKNOWN_BUSTYPE, "---"}, |
| 702 |
{UNKNOWN_BUSTYPE, "---"}, |
702 |
{UNKNOWN_BUSTYPE, "---"}, |
|
Lines 758-763
Link Here
|
| 758 |
int count; |
758 |
int count; |
| 759 |
int type; |
759 |
int type; |
| 760 |
int mustpanic; |
760 |
int mustpanic; |
|
|
761 |
int i, j; |
| 762 |
struct globaldata *gd; |
| 761 |
|
763 |
|
| 762 |
POSTCODE(MPTABLE_PASS1_POST); |
764 |
POSTCODE(MPTABLE_PASS1_POST); |
| 763 |
|
765 |
|
|
Lines 792-797
Link Here
|
| 792 |
if ((cth = mpfps->pap) == 0) |
794 |
if ((cth = mpfps->pap) == 0) |
| 793 |
panic("MP Configuration Table Header MISSING!"); |
795 |
panic("MP Configuration Table Header MISSING!"); |
| 794 |
|
796 |
|
|
|
797 |
if (cth >= (mpcth_t)0x100000) { |
| 798 |
pmap_enter(kernel_pmap, (vm_offset_t)CADDR1, |
| 799 |
trunc_page((vm_offset_t)cth), VM_PROT_READ, TRUE); |
| 800 |
/* XXX do not support MPCT across page boundary */ |
| 801 |
cth = (mpcth_t)(CADDR1 + ((int)cth & PAGE_MASK)); |
| 802 |
} else { |
| 803 |
cth = (mpcth_t)((u_int)cth + KERNBASE); |
| 804 |
} |
| 805 |
|
| 795 |
cpu_apic_address = (vm_offset_t) cth->apic_address; |
806 |
cpu_apic_address = (vm_offset_t) cth->apic_address; |
| 796 |
|
807 |
|
| 797 |
/* walk the table, recording info of interest */ |
808 |
/* walk the table, recording info of interest */ |
|
Lines 858-863
Link Here
|
| 858 |
|
869 |
|
| 859 |
--mp_naps; /* subtract the BSP */ |
870 |
--mp_naps; /* subtract the BSP */ |
| 860 |
|
871 |
|
|
|
872 |
if (cpu_apic_address == 0) |
| 873 |
panic("pmap_bootstrap: no local apic!"); |
| 874 |
|
| 875 |
/* local apic is mapped on last page */ |
| 876 |
SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N | /*pgeflag |*/ |
| 877 |
(cpu_apic_address & PG_FRAME)); |
| 878 |
|
| 879 |
for (i = 0; i < mp_napics; i++) { |
| 880 |
for (j = 0; j < mp_napics; j++) { |
| 881 |
/* same page frame as a previous IO apic? */ |
| 882 |
if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == |
| 883 |
(io_apic_address[0] & PG_FRAME)) { |
| 884 |
ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace |
| 885 |
+ (NPTEPG-2-j)*PAGE_SIZE); |
| 886 |
break; |
| 887 |
} |
| 888 |
/* use this slot if available */ |
| 889 |
if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == 0) { |
| 890 |
SMPpt[NPTEPG-2-j] = (pt_entry_t)(PG_V | PG_RW | |
| 891 |
/*pgeflag|*/ (io_apic_address[i] & PG_FRAME)); |
| 892 |
ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace |
| 893 |
+ (NPTEPG-2-j)*PAGE_SIZE); |
| 894 |
break; |
| 895 |
} |
| 896 |
} |
| 897 |
} |
| 898 |
|
| 899 |
/* BSP does this itself, AP's get it pre-set */ |
| 900 |
gd = &SMP_prvspace[0].globaldata; |
| 901 |
gd->gd_prv_CMAP1 = &SMPpt[1]; |
| 902 |
gd->gd_prv_CMAP2 = &SMPpt[2]; |
| 903 |
gd->gd_prv_CMAP3 = &SMPpt[3]; |
| 904 |
gd->gd_prv_PMAP1 = &SMPpt[4]; |
| 905 |
gd->gd_prv_CADDR1 = SMP_prvspace[0].CPAGE1; |
| 906 |
gd->gd_prv_CADDR2 = SMP_prvspace[0].CPAGE2; |
| 907 |
gd->gd_prv_CADDR3 = SMP_prvspace[0].CPAGE3; |
| 908 |
gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[0].PPAGE1; |
| 909 |
|
| 910 |
invltlb(); |
| 911 |
|
| 861 |
return mustpanic; |
912 |
return mustpanic; |
| 862 |
} |
913 |
} |
| 863 |
|
914 |
|
|
Lines 915-920
Link Here
|
| 915 |
|
966 |
|
| 916 |
if ((cth = mpfps->pap) == 0) |
967 |
if ((cth = mpfps->pap) == 0) |
| 917 |
panic("MP Configuration Table Header MISSING!"); |
968 |
panic("MP Configuration Table Header MISSING!"); |
|
|
969 |
|
| 970 |
if (cth >= (mpcth_t)0x100000) { |
| 971 |
pmap_enter(kernel_pmap, (vm_offset_t)CADDR1, |
| 972 |
trunc_page((vm_offset_t)cth), VM_PROT_READ, TRUE); |
| 973 |
/* XXX do not support MPCT across page boundary */ |
| 974 |
cth = (mpcth_t)(CADDR1 + ((int)cth & PAGE_MASK)); |
| 975 |
} else { |
| 976 |
cth = (mpcth_t)((u_int)cth + KERNBASE); |
| 977 |
} |
| 918 |
|
978 |
|
| 919 |
/* walk the table, recording info of interest */ |
979 |
/* walk the table, recording info of interest */ |
| 920 |
totalSize = cth->base_table_length - sizeof(struct MPCTH); |
980 |
totalSize = cth->base_table_length - sizeof(struct MPCTH); |