FreeBSD Bugzilla – Attachment 7358 Details for
Bug 16021
[i386] [patch] To support SMP on NEC PC98, call mp_probe() after pmap_bootstrap()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 5.80 KB, created by
hnokubi
on 2000-01-10 08:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
hnokubi
Created:
2000-01-10 08:30:01 UTC
Size:
5.80 KB
patch
obsolete
>Index: i386/i386/machdep.c >=================================================================== >RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v >retrieving revision 1.382 >diff -u -r1.382 machdep.c >--- machdep.c 1999/12/06 04:53:03 1.382 >+++ machdep.c 2000/01/10 07:07:36 >@@ -1559,9 +1559,6 @@ > #ifdef SMP > /* make hole for AP bootstrap code */ > physmap[1] = mp_bootaddress(physmap[1] / 1024); >- >- /* look for the MP hardware - needed for apic addresses */ >- mp_probe(); > #endif > > /* >@@ -1623,6 +1620,10 @@ > /* call pmap initialization to make new kernel address space */ > pmap_bootstrap(first, 0); > >+#ifdef SMP >+ /* look for the MP hardware - needed for apic addresses */ >+ mp_probe(); >+#endif > /* > * Size up each available chunk of physical memory. > */ >Index: i386/i386/mp_machdep.c >=================================================================== >RCS file: /home/ncvs/src/sys/i386/i386/mp_machdep.c,v >retrieving revision 1.114 >diff -u -r1.114 mp_machdep.c >--- mp_machdep.c 2000/01/07 08:49:23 1.114 >+++ mp_machdep.c 2000/01/10 07:07:36 >@@ -392,7 +392,7 @@ > > found: > /* calculate needed resources */ >- mpfps = (mpfps_t)x; >+ mpfps = (mpfps_t)(x + KERNBASE); > if (mptable_pass1()) > panic("you must reconfigure your kernel"); > >@@ -691,12 +691,12 @@ > {UNKNOWN_BUSTYPE, "---"}, > {UNKNOWN_BUSTYPE, "---"}, > {ISA, "ISA"}, >+ {ISA, "NEC98"}, > {UNKNOWN_BUSTYPE, "---"}, > {UNKNOWN_BUSTYPE, "---"}, > {UNKNOWN_BUSTYPE, "---"}, > {UNKNOWN_BUSTYPE, "---"}, > {UNKNOWN_BUSTYPE, "---"}, >- {UNKNOWN_BUSTYPE, "---"}, > {PCI, "PCI"}, > {UNKNOWN_BUSTYPE, "---"}, > {UNKNOWN_BUSTYPE, "---"}, >@@ -758,6 +758,8 @@ > int count; > int type; > int mustpanic; >+ int i, j; >+ struct globaldata *gd; > > POSTCODE(MPTABLE_PASS1_POST); > >@@ -792,6 +794,15 @@ > if ((cth = mpfps->pap) == 0) > panic("MP Configuration Table Header MISSING!"); > >+ if (cth >= (mpcth_t)0x100000) { >+ pmap_enter(kernel_pmap, (vm_offset_t)CADDR1, >+ trunc_page((vm_offset_t)cth), VM_PROT_READ, TRUE); >+ /* XXX do not support MPCT across page boundary */ >+ cth = (mpcth_t)(CADDR1 + ((int)cth & PAGE_MASK)); >+ } else { >+ cth = (mpcth_t)((u_int)cth + KERNBASE); >+ } >+ > cpu_apic_address = (vm_offset_t) cth->apic_address; > > /* walk the table, recording info of interest */ >@@ -858,6 +869,46 @@ > > --mp_naps; /* subtract the BSP */ > >+ if (cpu_apic_address == 0) >+ panic("pmap_bootstrap: no local apic!"); >+ >+ /* local apic is mapped on last page */ >+ SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N | /*pgeflag |*/ >+ (cpu_apic_address & PG_FRAME)); >+ >+ for (i = 0; i < mp_napics; i++) { >+ for (j = 0; j < mp_napics; j++) { >+ /* same page frame as a previous IO apic? */ >+ if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == >+ (io_apic_address[0] & PG_FRAME)) { >+ ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace >+ + (NPTEPG-2-j)*PAGE_SIZE); >+ break; >+ } >+ /* use this slot if available */ >+ if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == 0) { >+ SMPpt[NPTEPG-2-j] = (pt_entry_t)(PG_V | PG_RW | >+ /*pgeflag|*/ (io_apic_address[i] & PG_FRAME)); >+ ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace >+ + (NPTEPG-2-j)*PAGE_SIZE); >+ break; >+ } >+ } >+ } >+ >+ /* BSP does this itself, AP's get it pre-set */ >+ gd = &SMP_prvspace[0].globaldata; >+ gd->gd_prv_CMAP1 = &SMPpt[1]; >+ gd->gd_prv_CMAP2 = &SMPpt[2]; >+ gd->gd_prv_CMAP3 = &SMPpt[3]; >+ gd->gd_prv_PMAP1 = &SMPpt[4]; >+ gd->gd_prv_CADDR1 = SMP_prvspace[0].CPAGE1; >+ gd->gd_prv_CADDR2 = SMP_prvspace[0].CPAGE2; >+ gd->gd_prv_CADDR3 = SMP_prvspace[0].CPAGE3; >+ gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[0].PPAGE1; >+ >+ invltlb(); >+ > return mustpanic; > } > >@@ -915,6 +966,15 @@ > > if ((cth = mpfps->pap) == 0) > panic("MP Configuration Table Header MISSING!"); >+ >+ if (cth >= (mpcth_t)0x100000) { >+ pmap_enter(kernel_pmap, (vm_offset_t)CADDR1, >+ trunc_page((vm_offset_t)cth), VM_PROT_READ, TRUE); >+ /* XXX do not support MPCT across page boundary */ >+ cth = (mpcth_t)(CADDR1 + ((int)cth & PAGE_MASK)); >+ } else { >+ cth = (mpcth_t)((u_int)cth + KERNBASE); >+ } > > /* walk the table, recording info of interest */ > totalSize = cth->base_table_length - sizeof(struct MPCTH); >Index: i386/i386/pmap.c >=================================================================== >RCS file: /home/ncvs/src/sys/i386/i386/pmap.c,v >retrieving revision 1.250 >diff -u -r1.250 pmap.c >--- pmap.c 1999/11/19 21:34:26 1.250 >+++ pmap.c 2000/01/10 07:07:36 >@@ -283,10 +283,6 @@ > { > vm_offset_t va; > pt_entry_t *pte; >-#ifdef SMP >- int i, j; >- struct globaldata *gd; >-#endif > > avail_start = firstaddr; > >@@ -412,46 +408,6 @@ > invltlb(); > #endif > } >-#endif >- >-#ifdef SMP >- if (cpu_apic_address == 0) >- panic("pmap_bootstrap: no local apic!"); >- >- /* local apic is mapped on last page */ >- SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N | pgeflag | >- (cpu_apic_address & PG_FRAME)); >- >- for (i = 0; i < mp_napics; i++) { >- for (j = 0; j < mp_napics; j++) { >- /* same page frame as a previous IO apic? */ >- if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == >- (io_apic_address[0] & PG_FRAME)) { >- ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace >- + (NPTEPG-2-j)*PAGE_SIZE); >- break; >- } >- /* use this slot if available */ >- if (((vm_offset_t)SMPpt[NPTEPG-2-j] & PG_FRAME) == 0) { >- SMPpt[NPTEPG-2-j] = (pt_entry_t)(PG_V | PG_RW | >- pgeflag | (io_apic_address[i] & PG_FRAME)); >- ioapic[i] = (ioapic_t *)((u_int)SMP_prvspace >- + (NPTEPG-2-j)*PAGE_SIZE); >- break; >- } >- } >- } >- >- /* BSP does this itself, AP's get it pre-set */ >- gd = &SMP_prvspace[0].globaldata; >- gd->gd_prv_CMAP1 = &SMPpt[1]; >- gd->gd_prv_CMAP2 = &SMPpt[2]; >- gd->gd_prv_CMAP3 = &SMPpt[3]; >- gd->gd_prv_PMAP1 = &SMPpt[4]; >- gd->gd_prv_CADDR1 = SMP_prvspace[0].CPAGE1; >- gd->gd_prv_CADDR2 = SMP_prvspace[0].CPAGE2; >- gd->gd_prv_CADDR3 = SMP_prvspace[0].CPAGE3; >- gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[0].PPAGE1; > #endif > > invltlb();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16021
: 7358