Skip to contentSkip to conversation

piix_pci: fix piix3_set_irq_pic()

PATCH Applied TeLeMan 5 participants 5 messages May 16, 2011 – May 23, 2011

lore
Share & tools
lore

TeLeMan

author
#0 lore raw

PATCH 1/1 piix_pci: fix piix3_set_irq_pic()

If pic_irq is greater than 7, the irq level is always 0 on 32bits.

---
 hw/piix_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/piix_pci.c +0 -0
index 7f1c4cc..85a320e 100644
@@ -312,7 +312,7 @@ static void piix3_set_irq_pic(PIIX3State *piix3,

int pic_irq)

 {
     qemu_set_irq(piix3->pic[pic_irq],
                  !!(piix3->pic_levels &
-                    (((1UL << PIIX_NUM_PIRQS) - 1) <<
+                    (((1ULL << PIIX_NUM_PIRQS) - 1) <<
                      (pic_irq * PIIX_NUM_PIRQS))));

}

Signature · 3 lines
1.7.3.1.msysgit.0
--
SUN OF A BEACH
#1 lore raw
Quoted 6 lines · TeLeMan

If pic_irq is greater than 7, the irq level is always 0 on 32bits.

---
 hw/piix_pci.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied to the trivial-patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Your patch is line-wrapped. I have manually applied it, please make sure future submissions are not line-wrapped. GMail's web interface always line wraps, you must use their SMTP server directly (e.g. with git-send-email(1)).

Stefan

Acked-by on v1 1/1
#2 lore raw
In reply to TeLeMan
Quoted 3 lines · TeLeMan

If pic_irq is greater than 7, the irq level is always 0 on 32bits.

Good catch

Quoted 22 lines
---
 hw/piix_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/piix_pci.c +1 -1
index 7f1c4cc..85a320e 100644
@@ -312,7 +312,7 @@ static void piix3_set_irq_pic(PIIX3State *piix3,
 int pic_irq)
 {
     qemu_set_irq(piix3->pic[pic_irq],
                  !!(piix3->pic_levels &
-                    (((1UL << PIIX_NUM_PIRQS) - 1) <<
+                    (((1ULL << PIIX_NUM_PIRQS) - 1) <<
                      (pic_irq * PIIX_NUM_PIRQS))));
 }
Signature · 4 lines
-- 
1.7.3.1.msysgit.0
--
SUN OF A BEACH
Acked-by on v1 1/1
#4 lore raw
In reply to TeLeMan

Thank you.

Quoted 26 lines · TeLeMan

If pic_irq is greater than 7, the irq level is always 0 on 32bits.

---
 hw/piix_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/piix_pci.c +1 -1
index 7f1c4cc..85a320e 100644
@@ -312,7 +312,7 @@ static void piix3_set_irq_pic(PIIX3State *piix3,
 int pic_irq)
 {
     qemu_set_irq(piix3->pic[pic_irq],
                  !!(piix3->pic_levels &
-                    (((1UL << PIIX_NUM_PIRQS) - 1) <<
+                    (((1ULL << PIIX_NUM_PIRQS) - 1) <<
                      (pic_irq * PIIX_NUM_PIRQS))));
 }
Signature · 4 lines
-- 
1.7.3.1.msysgit.0
--
SUN OF A BEACH
Signature · 1 line
yamahata