FreeBSD Bugzilla – Attachment 7513 Details for
Bug 16269
smp dosen't work with >2 cpus on AMI Goliath II
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 5.89 KB, created by
stephen clawson
on 2000-01-21 19:10:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
stephen clawson
Created:
2000-01-21 19:10:02 UTC
Size:
5.89 KB
patch
obsolete
>Index: mp_machdep.c >=================================================================== >RCS file: /n/marker/usr/lsrc/FreeBSD/CVS/src/sys/i386/i386/mp_machdep.c,v >retrieving revision 1.115 >diff -c -r1.115 mp_machdep.c >*** mp_machdep.c 2000/01/13 09:08:59 1.115 >--- mp_machdep.c 2000/01/21 03:10:25 >*************** >*** 729,736 **** > > static int processor_entry __P((proc_entry_ptr entry, int cpu)); > static int bus_entry __P((bus_entry_ptr entry, int bus)); >! static int io_apic_entry __P((io_apic_entry_ptr entry, int apic)); >! static int int_entry __P((int_entry_ptr entry, int intr)); > static int lookup_bus_type __P((char *name)); > > >--- 729,738 ---- > > static int processor_entry __P((proc_entry_ptr entry, int cpu)); > static int bus_entry __P((bus_entry_ptr entry, int bus)); >! static int io_apic_entry __P((io_apic_entry_ptr entry, int apic, >! int io_apic_id_map[])); >! static int int_entry __P((int_entry_ptr entry, int intr, >! int io_apic_id_map[])); > static int lookup_bus_type __P((char *name)); > > >*************** >*** 883,888 **** >--- 885,891 ---- > int count; > int type; > int apic, bus, cpu, intr; >+ int io_apic_id_map[NAPICID]; > > POSTCODE(MPTABLE_PASS2_POST); > >*************** >*** 891,896 **** >--- 894,900 ---- > ID_TO_IO(x) = -1; /* phy APIC ID to log CPU/IO table */ > CPU_TO_ID(x) = -1; /* logical CPU to APIC ID table */ > IO_TO_ID(x) = -1; /* logical IO to APIC ID table */ >+ io_apic_id_map[x] = -1; /* mptable apic id to apic id table */ > } > > /* clear bus data table */ >*************** >*** 934,944 **** > ++bus; > break; > case 2: >! if (io_apic_entry(position, apic)) > ++apic; > break; > case 3: >! if (int_entry(position, intr)) > ++intr; > break; > case 4: >--- 938,948 ---- > ++bus; > break; > case 2: >! if (io_apic_entry(position, apic, io_apic_id_map)) > ++apic; > break; > case 3: >! if (int_entry(position, intr, io_apic_id_map)) > ++intr; > break; > case 4: >*************** >*** 1012,1017 **** >--- 1016,1038 ---- > } > } > >+ #ifdef APIC_IO >+ static void >+ set_io_apic_id(int apic, int io_apic_id) >+ { >+ u_int32_t ux; >+ >+ /* reprogram the io-apic to it's new id. */ >+ ux = io_apic_read(apic, IOAPIC_ID); /* get current contents */ >+ ux &= ~APIC_ID_MASK; /* clear the ID field */ >+ ux |= (io_apic_id << 24); /* set it to io_apic_id */ >+ io_apic_write(apic, IOAPIC_ID, ux); /* write new value */ >+ ux = io_apic_read(apic, IOAPIC_ID); /* re-read && test */ >+ if ((ux & APIC_ID_MASK) != (io_apic_id << 24)) >+ panic("can't control IO APIC ID, reg: 0x%08x", ux); >+ } >+ #endif >+ > /* > * parse an Intel MP specification table > */ >*************** >*** 1202,1214 **** > > > static int >! io_apic_entry(io_apic_entry_ptr entry, int apic) > { > if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) > return 0; > >! IO_TO_ID(apic) = entry->apic_id; >! ID_TO_IO(entry->apic_id) = apic; > > return 1; > } >--- 1223,1262 ---- > > > static int >! io_apic_entry(io_apic_entry_ptr entry, int apic, int io_apic_id_map[]) > { >+ int io_apic_id = entry->apic_id; >+ > if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) > return 0; > >! /* >! * section 3.6.6 of the mp spec v1.4 specifies that the OS >! * must check the uniqueness of the IO APIC id and assign a >! * unique id if there's a conflict. >! */ >! if (ID_TO_CPU(io_apic_id) != -1) { >! /* >! * section 3.6.6 also specifies that we must start >! * with the lowest id possible. >! */ >! io_apic_id = 0; >! while ((io_apic_id < NAPICID) && >! (ID_TO_CPU(io_apic_id) != -1)) >! io_apic_id++; >! >! if (io_apic_id == NAPICID) >! panic("can't remap IOAPIC id: all apic id's used"); >! >! printf("Remapping IO APIC #%d from id %d to id %d\n", >! apic, entry->apic_id, io_apic_id); >! >! set_io_apic_id(apic, io_apic_id); >! } >! >! io_apic_id_map[entry->apic_id] = io_apic_id; >! IO_TO_ID(apic) = io_apic_id; >! ID_TO_IO(io_apic_id) = apic; > > return 1; > } >*************** >*** 1228,1234 **** > > > static int >! int_entry(int_entry_ptr entry, int intr) > { > int apic; > >--- 1276,1282 ---- > > > static int >! int_entry(int_entry_ptr entry, int intr, int io_apic_id_map[]) > { > int apic; > >*************** >*** 1249,1255 **** > else > io_apic_ints[intr].dst_apic_id = entry->dst_apic_id; > } else >! io_apic_ints[intr].dst_apic_id = entry->dst_apic_id; > io_apic_ints[intr].dst_apic_int = entry->dst_apic_int; > > return 1; >--- 1297,1305 ---- > else > io_apic_ints[intr].dst_apic_id = entry->dst_apic_id; > } else >! io_apic_ints[intr].dst_apic_id = >! io_apic_id_map[entry->dst_apic_id]; >! > io_apic_ints[intr].dst_apic_int = entry->dst_apic_int; > > return 1; >*************** >*** 1271,1278 **** > > > /* >! * Given a traditional ISA INT mask, return an APIC mask. >! */ > u_int > isa_apic_mask(u_int isa_mask) > { >--- 1321,1327 ---- > > > /* >! * Given a traditional ISA INT mask, return an APIC mask. */ > u_int > isa_apic_mask(u_int isa_mask) > { >*************** >*** 1601,1607 **** > { > int ap_cpu_id; > #if defined(APIC_IO) >- u_int32_t ux; > int io_apic_id; > int pin; > #endif /* APIC_IO */ >--- 1650,1655 ---- >*************** >*** 1661,1673 **** > #else > if ((io_apic_id == 0) || (io_apic_id == 1) || (io_apic_id == 15)) { > #endif /* REALLY_ANAL_IOAPICID_VALUE */ >! ux = io_apic_read(0, IOAPIC_ID); /* get current contents */ >! ux &= ~APIC_ID_MASK; /* clear the ID field */ >! ux |= 0x02000000; /* set it to '2' */ >! io_apic_write(0, IOAPIC_ID, ux); /* write new value */ >! ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ >! if ((ux & APIC_ID_MASK) != 0x02000000) >! panic("can't control IO APIC ID, reg: 0x%08x", ux); > io_apic_id = 2; > } > IO_TO_ID(0) = io_apic_id; >--- 1709,1715 ---- > #else > if ((io_apic_id == 0) || (io_apic_id == 1) || (io_apic_id == 15)) { > #endif /* REALLY_ANAL_IOAPICID_VALUE */ >! set_io_apic_id(0, 2); > io_apic_id = 2; > } > IO_TO_ID(0) = io_apic_id;
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 16269
: 7513