Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99702
b: refs/heads/master
c: 2fddb6e
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Starikovskiy authored and Thomas Gleixner committed May 25, 2008
1 parent 8c7da37 commit c75dcb7
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 86 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec2cd0a22e2715f776a934e01c4f8ea098324fe1
refs/heads/master: 2fddb6e28e903a3ab1704cc5aac01be5a59dc05b
43 changes: 21 additions & 22 deletions trunk/arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,14 +969,14 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
if ((bus_irq == 0) && (trigger == 3))
trigger = 1;

mp_irqs[mp_irq_entries].mpc_type = MP_INTSRC;
mp_irqs[mp_irq_entries].mpc_irqtype = mp_INT;
mp_irqs[mp_irq_entries].mpc_irqflag = (trigger << 2) | polarity;
mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS;
mp_irqs[mp_irq_entries].mpc_srcbusirq = bus_irq; /* IRQ */
mp_irqs[mp_irq_entries].mpc_dstapic =
mp_irqs[mp_irq_entries].mp_type = MP_INTSRC;
mp_irqs[mp_irq_entries].mp_irqtype = mp_INT;
mp_irqs[mp_irq_entries].mp_irqflag = (trigger << 2) | polarity;
mp_irqs[mp_irq_entries].mp_srcbus = MP_ISA_BUS;
mp_irqs[mp_irq_entries].mp_srcbusirq = bus_irq; /* IRQ */
mp_irqs[mp_irq_entries].mp_dstapic =
mp_ioapics[ioapic].mp_apicid; /* APIC ID */
mp_irqs[mp_irq_entries].mpc_dstirq = pin; /* INTIN# */
mp_irqs[mp_irq_entries].mp_dstirq = pin; /* INTIN# */

if (++mp_irq_entries == MAX_IRQ_SOURCES)
panic("Max # of irq sources exceeded!!\n");
Expand Down Expand Up @@ -1012,12 +1012,11 @@ void __init mp_config_acpi_legacy_irqs(void)
if (ioapic < 0)
return;

mp_irqs[mp_irq_entries].mpc_type = MP_INTSRC;
mp_irqs[mp_irq_entries].mpc_irqflag = 0; /* Conforming */
mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS;
#ifdef CONFIG_X86_IO_APIC
mp_irqs[mp_irq_entries].mpc_dstapic = mp_ioapics[ioapic].mp_apicid;
#endif
mp_irqs[mp_irq_entries].mp_type = MP_INTSRC;
mp_irqs[mp_irq_entries].mp_irqflag = 0; /* Conforming */
mp_irqs[mp_irq_entries].mp_srcbus = MP_ISA_BUS;
mp_irqs[mp_irq_entries].mp_dstapic = mp_ioapics[ioapic].mp_apicid;

/*
* Use the default configuration for the IRQs 0-15. Unless
* overridden by (MADT) interrupt source override entries.
Expand All @@ -1026,17 +1025,17 @@ void __init mp_config_acpi_legacy_irqs(void)
int idx;

for (idx = 0; idx < mp_irq_entries; idx++) {
struct mpc_config_intsrc *irq = mp_irqs + idx;
struct mp_config_intsrc *irq = mp_irqs + idx;

/* Do we already have a mapping for this ISA IRQ? */
if (irq->mpc_srcbus == MP_ISA_BUS
&& irq->mpc_srcbusirq == i)
if (irq->mp_srcbus == MP_ISA_BUS
&& irq->mp_srcbusirq == i)
break;

/* Do we already have a mapping for this IOAPIC pin */
if ((irq->mpc_dstapic ==
mp_irqs[mp_irq_entries].mpc_dstapic) &&
(irq->mpc_dstirq == i))
if ((irq->mp_dstapic ==
mp_irqs[mp_irq_entries].mp_dstapic) &&
(irq->mp_dstirq == i))
break;
}

Expand All @@ -1045,9 +1044,9 @@ void __init mp_config_acpi_legacy_irqs(void)
continue; /* IRQ already used */
}

mp_irqs[mp_irq_entries].mpc_irqtype = mp_INT;
mp_irqs[mp_irq_entries].mpc_srcbusirq = i; /* Identity mapped */
mp_irqs[mp_irq_entries].mpc_dstirq = i;
mp_irqs[mp_irq_entries].mp_irqtype = mp_INT;
mp_irqs[mp_irq_entries].mp_srcbusirq = i; /* Identity mapped */
mp_irqs[mp_irq_entries].mp_dstirq = i;

if (++mp_irq_entries == MAX_IRQ_SOURCES)
panic("Max # of irq sources exceeded!!\n");
Expand Down
64 changes: 32 additions & 32 deletions trunk/arch/x86/kernel/io_apic_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct mp_config_ioapic mp_ioapics[MAX_IO_APICS];
int nr_ioapics;

/* MP IRQ source entries */
struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
struct mp_config_intsrc mp_irqs[MAX_IRQ_SOURCES];

/* # of MP IRQ source entries */
int mp_irq_entries;
Expand Down Expand Up @@ -801,10 +801,10 @@ static int find_irq_entry(int apic, int pin, int type)
int i;

for (i = 0; i < mp_irq_entries; i++)
if (mp_irqs[i].mpc_irqtype == type &&
(mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mp_apicid ||
mp_irqs[i].mpc_dstapic == MP_APIC_ALL) &&
mp_irqs[i].mpc_dstirq == pin)
if (mp_irqs[i].mp_irqtype == type &&
(mp_irqs[i].mp_dstapic == mp_ioapics[apic].mp_apicid ||
mp_irqs[i].mp_dstapic == MP_APIC_ALL) &&
mp_irqs[i].mp_dstirq == pin)
return i;

return -1;
Expand All @@ -818,13 +818,13 @@ static int __init find_isa_irq_pin(int irq, int type)
int i;

for (i = 0; i < mp_irq_entries; i++) {
int lbus = mp_irqs[i].mpc_srcbus;
int lbus = mp_irqs[i].mp_srcbus;

if (test_bit(lbus, mp_bus_not_pci) &&
(mp_irqs[i].mpc_irqtype == type) &&
(mp_irqs[i].mpc_srcbusirq == irq))
(mp_irqs[i].mp_irqtype == type) &&
(mp_irqs[i].mp_srcbusirq == irq))

return mp_irqs[i].mpc_dstirq;
return mp_irqs[i].mp_dstirq;
}
return -1;
}
Expand All @@ -834,17 +834,17 @@ static int __init find_isa_irq_apic(int irq, int type)
int i;

for (i = 0; i < mp_irq_entries; i++) {
int lbus = mp_irqs[i].mpc_srcbus;
int lbus = mp_irqs[i].mp_srcbus;

if (test_bit(lbus, mp_bus_not_pci) &&
(mp_irqs[i].mpc_irqtype == type) &&
(mp_irqs[i].mpc_srcbusirq == irq))
(mp_irqs[i].mp_irqtype == type) &&
(mp_irqs[i].mp_srcbusirq == irq))
break;
}
if (i < mp_irq_entries) {
int apic;
for(apic = 0; apic < nr_ioapics; apic++) {
if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic)
if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic)
return apic;
}
}
Expand All @@ -869,23 +869,23 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
return -1;
}
for (i = 0; i < mp_irq_entries; i++) {
int lbus = mp_irqs[i].mpc_srcbus;
int lbus = mp_irqs[i].mp_srcbus;

for (apic = 0; apic < nr_ioapics; apic++)
if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic ||
mp_irqs[i].mpc_dstapic == MP_APIC_ALL)
if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic ||
mp_irqs[i].mp_dstapic == MP_APIC_ALL)
break;

if (!test_bit(lbus, mp_bus_not_pci) &&
!mp_irqs[i].mpc_irqtype &&
!mp_irqs[i].mp_irqtype &&
(bus == lbus) &&
(slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) {
int irq = pin_2_irq(i,apic,mp_irqs[i].mpc_dstirq);
(slot == ((mp_irqs[i].mp_srcbusirq >> 2) & 0x1f))) {
int irq = pin_2_irq(i,apic,mp_irqs[i].mp_dstirq);

if (!(apic || IO_APIC_IRQ(irq)))
continue;

if (pin == (mp_irqs[i].mpc_srcbusirq & 3))
if (pin == (mp_irqs[i].mp_srcbusirq & 3))
return irq;
/*
* Use the first all-but-pin matching entry as a
Expand Down Expand Up @@ -952,7 +952,7 @@ static int EISA_ELCR(unsigned int irq)
* EISA conforming in the MP table, that means its trigger type must
* be read in from the ELCR */

#define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mpc_srcbusirq))
#define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mp_srcbusirq))
#define default_EISA_polarity(idx) default_ISA_polarity(idx)

/* PCI interrupts are always polarity one level triggered,
Expand All @@ -969,13 +969,13 @@ static int EISA_ELCR(unsigned int irq)

static int MPBIOS_polarity(int idx)
{
int bus = mp_irqs[idx].mpc_srcbus;
int bus = mp_irqs[idx].mp_srcbus;
int polarity;

/*
* Determine IRQ line polarity (high active or low active):
*/
switch (mp_irqs[idx].mpc_irqflag & 3)
switch (mp_irqs[idx].mp_irqflag & 3)
{
case 0: /* conforms, ie. bus-type dependent polarity */
{
Expand Down Expand Up @@ -1012,13 +1012,13 @@ static int MPBIOS_polarity(int idx)

static int MPBIOS_trigger(int idx)
{
int bus = mp_irqs[idx].mpc_srcbus;
int bus = mp_irqs[idx].mp_srcbus;
int trigger;

/*
* Determine IRQ trigger mode (edge or level sensitive):
*/
switch ((mp_irqs[idx].mpc_irqflag>>2) & 3)
switch ((mp_irqs[idx].mp_irqflag>>2) & 3)
{
case 0: /* conforms, ie. bus-type dependent */
{
Expand Down Expand Up @@ -1097,16 +1097,16 @@ static inline int irq_trigger(int idx)
static int pin_2_irq(int idx, int apic, int pin)
{
int irq, i;
int bus = mp_irqs[idx].mpc_srcbus;
int bus = mp_irqs[idx].mp_srcbus;

/*
* Debugging check, we are in big trouble if this message pops up!
*/
if (mp_irqs[idx].mpc_dstirq != pin)
if (mp_irqs[idx].mp_dstirq != pin)
printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n");

if (test_bit(bus, mp_bus_not_pci))
irq = mp_irqs[idx].mpc_srcbusirq;
irq = mp_irqs[idx].mp_srcbusirq;
else {
/*
* PCI IRQs are mapped in order
Expand Down Expand Up @@ -1793,8 +1793,8 @@ static void __init setup_ioapic_ids_from_mpc(void)
*/
if (old_id != mp_ioapics[apic].mp_apicid)
for (i = 0; i < mp_irq_entries; i++)
if (mp_irqs[i].mpc_dstapic == old_id)
mp_irqs[i].mpc_dstapic
if (mp_irqs[i].mp_dstapic == old_id)
mp_irqs[i].mp_dstapic
= mp_ioapics[apic].mp_apicid;

/*
Expand Down Expand Up @@ -2810,8 +2810,8 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
return -1;

for (i = 0; i < mp_irq_entries; i++)
if (mp_irqs[i].mpc_irqtype == mp_INT &&
mp_irqs[i].mpc_srcbusirq == bus_irq)
if (mp_irqs[i].mp_irqtype == mp_INT &&
mp_irqs[i].mp_srcbusirq == bus_irq)
break;
if (i >= mp_irq_entries)
return -1;
Expand Down
Loading

0 comments on commit c75dcb7

Please sign in to comment.