View | Details | Raw Unified | Return to bug 16021
Collapse All | Expand All

(-)machdep.c (-3 / +4 lines)
Lines 1559-1567 Link Here
1559
#ifdef SMP
1559
#ifdef SMP
1560
	/* make hole for AP bootstrap code */
1560
	/* make hole for AP bootstrap code */
1561
	physmap[1] = mp_bootaddress(physmap[1] / 1024);
1561
	physmap[1] = mp_bootaddress(physmap[1] / 1024);
1562
1563
	/* look for the MP hardware - needed for apic addresses */
1564
	mp_probe();
1565
#endif
1562
#endif
1566
1563
1567
	/*
1564
	/*
Lines 1623-1628 Link Here
1623
	/* call pmap initialization to make new kernel address space */
1620
	/* call pmap initialization to make new kernel address space */
1624
	pmap_bootstrap(first, 0);
1621
	pmap_bootstrap(first, 0);
1625
1622
1623
#ifdef SMP
1624
	/* look for the MP hardware - needed for apic addresses */
1625
	mp_probe();
1626
#endif
1626
	/*
1627
	/*
1627
	 * Size up each available chunk of physical memory.
1628
	 * Size up each available chunk of physical memory.
1628
	 */
1629
	 */
(-)mp_machdep.c (-2 / +62 lines)
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);
(-)pmap.c (-44 lines)
Lines 283-292 Link Here
283
{
283
{
284
	vm_offset_t va;
284
	vm_offset_t va;
285
	pt_entry_t *pte;
285
	pt_entry_t *pte;
286
#ifdef SMP
287
	int i, j;
288
	struct globaldata *gd;
289
#endif
290
286
291
	avail_start = firstaddr;
287
	avail_start = firstaddr;
292
288
Lines 412-457 Link Here
412
		invltlb();
408
		invltlb();
413
#endif
409
#endif
414
	}
410
	}
415
#endif
416
417
#ifdef SMP
418
	if (cpu_apic_address == 0)
419
		panic("pmap_bootstrap: no local apic!");
420
421
	/* local apic is mapped on last page */
422
	SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N | pgeflag |
423
	    (cpu_apic_address & PG_FRAME));
424
425
	for (i = 0; i < mp_napics; i++) {
426
		for (j = 0; j < mp_napics; j++) {
427
			/* same page frame as a previous IO apic? */
428
			if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) ==
429
			    (io_apic_address[0] & PG_FRAME)) {
430
				ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace
431
					+ (NPTEPG-2-j)*PAGE_SIZE);
432
				break;
433
			}
434
			/* use this slot if available */
435
			if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == 0) {
436
				SMPpt[NPTEPG-2-j] = (pt_entry_t)(PG_V | PG_RW |
437
				    pgeflag | (io_apic_address[i] & PG_FRAME));
438
				ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace
439
					+ (NPTEPG-2-j)*PAGE_SIZE);
440
				break;
441
			}
442
		}
443
	}
444
445
	/* BSP does this itself, AP's get it pre-set */
446
	gd = &SMP_prvspace[0].globaldata;
447
	gd->gd_prv_CMAP1 = &SMPpt[1];
448
	gd->gd_prv_CMAP2 = &SMPpt[2];
449
	gd->gd_prv_CMAP3 = &SMPpt[3];
450
	gd->gd_prv_PMAP1 = &SMPpt[4];
451
	gd->gd_prv_CADDR1 = SMP_prvspace[0].CPAGE1;
452
	gd->gd_prv_CADDR2 = SMP_prvspace[0].CPAGE2;
453
	gd->gd_prv_CADDR3 = SMP_prvspace[0].CPAGE3;
454
	gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[0].PPAGE1;
455
#endif
411
#endif
456
412
457
	invltlb();
413
	invltlb();

Return to bug 16021