mips malta: Fix fdc regression and use qdev for i8042 setup
[qemu.git] / pc-bios / bios-pq / 0013_fix-non-acpi-timer-interrupt-routing.patch
blob80e7716c6b461db9f6d672999917ba1207479790
1 From c09142004a409bf27070939f470c5e0b37595a5a Mon Sep 17 00:00:00 2001
2 From: Beth Kon <eak@us.ibm.com>
3 Date: Fri, 19 Jun 2009 14:22:00 -0400
4 Subject: [PATCH] Fix non-ACPI Timer Interrupt Routing - v3
6 Replicate ACPI irq0->inti2 override in mp table for non-acpi case.
8 v1 -> v2 adds comment suggested by Ryan.
9 v2 -> v3 clarifies comment and corrects entry count
11 Signed-off-by: Beth Kon <eak@us.ibm.com>
12 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 ---
14 bios/rombios32.c | 14 ++++++++++++++
15 1 files changed, 14 insertions(+), 0 deletions(-)
17 diff --git a/bios/rombios32.c b/bios/rombios32.c
18 index 1a1ed64..d789e20 100644
19 --- a/bios/rombios32.c
20 +++ b/bios/rombios32.c
21 @@ -1124,7 +1124,11 @@ static void mptable_init(void)
22 putstr(&q, "0.1 "); /* vendor id */
23 putle32(&q, 0); /* OEM table ptr */
24 putle16(&q, 0); /* OEM table size */
25 +#ifdef BX_QEMU
26 + putle16(&q, smp_cpus + 17); /* entry count */
27 +#else
28 putle16(&q, smp_cpus + 18); /* entry count */
29 +#endif
30 putle32(&q, 0xfee00000); /* local APIC addr */
31 putle16(&q, 0); /* ext table length */
32 putb(&q, 0); /* ext table checksum */
33 @@ -1166,6 +1170,12 @@ static void mptable_init(void)
35 /* irqs */
36 for(i = 0; i < 16; i++) {
37 +#ifdef BX_QEMU
38 + /* One entry per ioapic interrupt destination. Destination 2 is covered
39 + by irq0->inti2 override (i == 0). Source IRQ 2 is unused */
40 + if (i == 2)
41 + continue;
42 +#endif
43 putb(&q, 3); /* entry type = I/O interrupt */
44 putb(&q, 0); /* interrupt type = vectored interrupt */
45 putb(&q, 0); /* flags: po=0, el=0 */
46 @@ -1173,7 +1183,11 @@ static void mptable_init(void)
47 putb(&q, 0); /* source bus ID = ISA */
48 putb(&q, i); /* source bus IRQ */
49 putb(&q, ioapic_id); /* dest I/O APIC ID */
50 +#ifdef BX_QEMU
51 + putb(&q, i == 0 ? 2 : i); /* dest I/O APIC interrupt in */
52 +#else
53 putb(&q, i); /* dest I/O APIC interrupt in */
54 +#endif
56 /* patch length */
57 len = q - mp_config_table;
58 --
59 1.6.2.5