projects
/
seabios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vgabios: Unify page size calculations; remove page size from vgamode_s.
[seabios.git]
/
src
/
mptable.c
diff --git
a/src/mptable.c
b/src/mptable.c
index bf48a5e33bdaba7d95af438b08ce2ab725622f47..103f46243d8cd3b89afa3fc44f97901f8e265908 100644
(file)
--- a/
src/mptable.c
+++ b/
src/mptable.c
@@
-1,6
+1,6
@@
// MPTable generation (on emulators)
//
// MPTable generation (on emulators)
//
-// Copyright (C) 2008
,2009
Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2008
-2010
Kevin O'Connor <kevin@koconnor.net>
// Copyright (C) 2006 Fabrice Bellard
//
// This file may be distributed under the terms of the GNU LGPLv3 license.
// Copyright (C) 2006 Fabrice Bellard
//
// This file may be distributed under the terms of the GNU LGPLv3 license.
@@
-59,7
+59,7
@@
mptable_init(void)
cpu->apicid = i;
cpu->apicver = apic_version;
/* cpu flags: enabled, bootstrap cpu */
cpu->apicid = i;
cpu->apicver = apic_version;
/* cpu flags: enabled, bootstrap cpu */
- cpu->cpuflag = (
i < CountCPUs) | ((i == 0) << 1
);
+ cpu->cpuflag = (
(i<CountCPUs) ? 0x01 : 0x00) | ((i==0) ? 0x02 : 0x00
);
cpu->cpusignature = cpuid_signature;
cpu->featureflag = cpuid_features;
cpu++;
cpu->cpusignature = cpuid_signature;
cpu->featureflag = cpuid_features;
cpu++;
@@
-68,9
+68,10
@@
mptable_init(void)
// PCI buses
struct mpt_bus *buses = (void*)cpu, *bus = buses;
// PCI buses
struct mpt_bus *buses = (void*)cpu, *bus = buses;
- int bdf, max, lastbus = -1;
- foreachpci(bdf, max) {
- int curbus = pci_bdf_to_bus(bdf);
+ int lastbus = -1;
+ struct pci_device *pci;
+ foreachpci(pci) {
+ int curbus = pci_bdf_to_bus(pci->bdf);
if (curbus == lastbus)
continue;
lastbus = curbus;
if (curbus == lastbus)
continue;
lastbus = curbus;
@@
-106,7
+107,8
@@
mptable_init(void)
int dev = -1;
unsigned short mask = 0, pinmask = 0;
int dev = -1;
unsigned short mask = 0, pinmask = 0;
- foreachpci(bdf, max) {
+ foreachpci(pci) {
+ u16 bdf = pci->bdf;
int pin = pci_config_readb(bdf, PCI_INTERRUPT_PIN);
int irq = pci_config_readb(bdf, PCI_INTERRUPT_LINE);
if (pin == 0)
int pin = pci_config_readb(bdf, PCI_INTERRUPT_PIN);
int irq = pci_config_readb(bdf, PCI_INTERRUPT_LINE);
if (pin == 0)
@@
-167,7
+169,7
@@
mptable_init(void)
intsrc->irqflag = 0; /* PO, EL default */
intsrc->srcbus = isabusid; /* ISA */
intsrc->srcbusirq = 0;
intsrc->irqflag = 0; /* PO, EL default */
intsrc->srcbus = isabusid; /* ISA */
intsrc->srcbusirq = 0;
- intsrc->dstapic = 0
; /* BSP == APIC #0
*/
+ intsrc->dstapic = 0
xff; /* to all local APICs
*/
intsrc->dstirq = 1; /* LINTIN1 */
intsrc++;
entrycount += intsrc - intsrcs;
intsrc->dstirq = 1; /* LINTIN1 */
intsrc++;
entrycount += intsrc - intsrcs;