qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@ece.ualberta.ca>
To: qemu-devel@nongnu.org
Cc: Logan Gunthorpe <logang@ece.ualberta.ca>
Subject: [Qemu-devel] [PATCH 1/3] Minor bugfixes/improvements to arm_gic.
Date: Sun, 12 Jul 2009 23:10:19 -0600	[thread overview]
Message-ID: <1247461821-20621-2-git-send-email-logang@ece.ualberta.ca> (raw)
In-Reply-To: <1247461821-20621-1-git-send-email-logang@ece.ualberta.ca>

- Added code to set and clear the Active flags.
- Fixed a bug with the Software Trigger Interrupt register. It was not
  handled correctly in the NVIC version.
---
 hw/arm_gic.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/arm_gic.c b/hw/arm_gic.c
index 563397d..4a082c6 100644
--- a/hw/arm_gic.c
+++ b/hw/arm_gic.c
@@ -197,6 +197,8 @@ static uint32_t gic_acknowledge_irq(gic_state *s, int cpu)
     /* Clear pending flags for both level and edge triggered interrupts.
        Level triggered IRQs will be reasserted once they become inactive.  */
     GIC_CLEAR_PENDING(new_irq, GIC_TEST_MODEL(new_irq) ? ALL_CPU_MASK : cm);
+    GIC_SET_ACTIVE(new_irq, cm);
+
     gic_set_running_irq(s, cpu, new_irq);
     DPRINTF("ACK %d\n", new_irq);
     return new_irq;
@@ -209,6 +211,9 @@ static void gic_complete_irq(gic_state * s, int cpu, int irq)
     DPRINTF("EOI %d\n", irq);
     if (s->running_irq[cpu] == 1023)
         return; /* No active IRQ.  */
+
+    GIC_CLEAR_ACTIVE(irq, cm);
+
     if (irq != 1023) {
         /* Mark level triggered interrupts as pending if they are still
            raised.  */
@@ -535,6 +540,8 @@ static void gic_dist_writel(void *opaque, target_phys_addr_t offset,
 
         cpu = gic_get_current_cpu();
         irq = value & 0x3ff;
+
+#ifndef NVIC
         switch ((value >> 24) & 3) {
         case 0:
             mask = (value >> 16) & ALL_CPU_MASK;
@@ -550,6 +557,11 @@ static void gic_dist_writel(void *opaque, target_phys_addr_t offset,
             mask = ALL_CPU_MASK;
             break;
         }
+#else
+        mask = ALL_CPU_MASK;
+        irq += GIC_BASE_IRQ;
+#endif
+
         GIC_SET_PENDING(irq, mask);
         gic_update(s);
         return;
-- 
1.5.6.5

  reply	other threads:[~2009-07-13  5:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13  5:10 [Qemu-devel] [PATCH 0/3] Small patches related to Stelaris/ARMv7 support Logan Gunthorpe
2009-07-13  5:10 ` Logan Gunthorpe [this message]
2009-07-13  5:10 ` [Qemu-devel] [PATCH 2/3] Fixes two bugs with the Stelaris ADC Logan Gunthorpe
2009-07-13  5:10 ` [Qemu-devel] [PATCH 3/3] Stelaris 16-bit timer mode Logan Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1247461821-20621-2-git-send-email-logang@ece.ualberta.ca \
    --to=logang@ece.ualberta.ca \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).