qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: jcmvbkbc@gmail.com
Subject: [Qemu-devel] [PATCH 3/7] target-xtensa: implement external interrupt mapping
Date: Mon, 10 Oct 2011 06:26:01 +0400	[thread overview]
Message-ID: <1318213565-3268-4-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1318213565-3268-1-git-send-email-jcmvbkbc@gmail.com>

Xtensa cores may have different mapping of external interrupt pins to
internal IRQ numers. Implement API to acquire core IRQ by its external
interrupt number.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 hw/xtensa_pic.c     |   12 ++++++++++++
 target-xtensa/cpu.h |    3 +++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/hw/xtensa_pic.c b/hw/xtensa_pic.c
index e5085ea..93e28fd 100644
--- a/hw/xtensa_pic.c
+++ b/hw/xtensa_pic.c
@@ -157,3 +157,15 @@ void xtensa_irq_init(CPUState *env)
             qemu_new_timer_ns(vm_clock, &xtensa_ccompare_cb, env);
     }
 }
+
+void *xtensa_get_extint(CPUState *env, unsigned extint)
+{
+    if (extint < env->config->nextint) {
+        unsigned irq = env->config->extint[extint];
+        return env->irq_inputs[irq];
+    } else {
+        qemu_log("%s: trying to acquire invalid external interrupt %d\n",
+                __func__, extint);
+        return NULL;
+    }
+}
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index df168d5..9d36c1b 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -277,6 +277,8 @@ typedef struct XtensaConfig {
     } interrupt[MAX_NINTERRUPT];
     unsigned nccompare;
     uint32_t timerint[MAX_NCCOMPARE];
+    unsigned nextint;
+    unsigned extint[MAX_NINTERRUPT];
     uint32_t clock_freq_khz;
 
     xtensa_tlb itlb;
@@ -318,6 +320,7 @@ int cpu_xtensa_exec(CPUXtensaState *s);
 void do_interrupt(CPUXtensaState *s);
 void check_interrupts(CPUXtensaState *s);
 void xtensa_irq_init(CPUState *env);
+void *xtensa_get_extint(CPUState *env, unsigned extint);
 void xtensa_advance_ccount(CPUState *env, uint32_t d);
 void xtensa_timer_irq(CPUState *env, uint32_t id, uint32_t active);
 void xtensa_rearm_ccompare_timer(CPUState *env);
-- 
1.7.6.4

  parent reply	other threads:[~2011-10-10  2:26 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10  2:25 [Qemu-devel] [PATCH 0/7] target-xtensa: add overlay parsing header and convert hand-written core definitions to use overlays Max Filippov
2011-10-10  2:25 ` [Qemu-devel] [PATCH 1/7] target-xtensa: increase xtensa options accuracy Max Filippov
2011-10-10  2:26 ` [Qemu-devel] [PATCH 2/7] target-xtensa: remove hand-written xtensa cores implementations Max Filippov
2011-10-10  2:26 ` Max Filippov [this message]
2011-10-10  2:26 ` [Qemu-devel] [PATCH 4/7] target-xtensa: extract core configuration from overlay Max Filippov
2011-10-10  2:26 ` [Qemu-devel] [PATCH 5/7] target-xtensa: add dc232b core Max Filippov
2011-10-10  2:26 ` [Qemu-devel] [PATCH 6/7] target-xtensa: add fsf core Max Filippov
2011-10-15  9:02   ` Blue Swirl
2011-10-15 13:15     ` Max Filippov
2011-10-15 13:44       ` Max Filippov
2011-10-15 13:50         ` Blue Swirl
2011-10-15 14:08           ` [Qemu-devel] [PATCH v2] " Max Filippov
2011-10-17 10:45     ` [Qemu-devel] GPLv3 troubles (was: [PATCH 6/7] target-xtensa: add fsf core) Andreas Färber
2011-10-17 10:47       ` [Qemu-devel] GPLv3 troubles Paolo Bonzini
2011-10-17 11:07         ` Andreas Färber
2011-10-17 11:10           ` Paolo Bonzini
2011-10-17 16:39             ` Andreas Färber
2011-10-17 16:47               ` Peter Maydell
2011-10-17 16:51                 ` Anthony Liguori
2011-10-17 17:58                   ` Andreas Färber
2011-10-17 18:16                     ` Anthony Liguori
2011-10-17 18:18                       ` Peter Maydell
2011-10-17 18:20                       ` Stefan Weil
2011-10-17 18:29                         ` Anthony Liguori
2011-10-17 18:34                           ` Peter Maydell
2011-10-17 18:37                             ` Anthony Liguori
2011-10-17 19:33                           ` Blue Swirl
2011-10-17 19:43                   ` Blue Swirl
2011-10-17 17:01                 ` Andreas Färber
2011-10-17 12:38       ` Anthony Liguori
2011-10-17 12:50         ` Paolo Bonzini
2011-10-17 14:17           ` Anthony Liguori
2011-10-17 14:27             ` Paolo Bonzini
2011-10-17 16:30             ` Andreas Färber
2011-10-17 16:47               ` Anthony Liguori
2011-10-17 17:46                 ` Stefan Weil
2011-10-17 19:29                   ` Blue Swirl
2011-10-17 20:44                   ` Avi Kivity
2011-10-18  8:01                     ` Markus Armbruster
2011-10-18 13:03                       ` Anthony Liguori
2011-10-18 14:33                         ` Andreas Färber
2011-10-18 14:36                           ` Anthony Liguori
2011-10-18 14:44                             ` nicolas.sauzede
2011-10-18 15:00                         ` andrzej zaborowski
2011-10-18 15:19                         ` Peter Maydell
2011-10-18 15:31                           ` Paolo Bonzini
2011-10-18 16:01                             ` Anthony Liguori
2011-10-18 16:15                               ` Peter Maydell
2011-10-18 16:20                                 ` Avi Kivity
2011-10-18 16:30                                 ` Anthony Liguori
2011-10-18 16:32                                   ` Peter Maydell
2011-10-18 16:37                               ` Paolo Bonzini
2011-10-18 18:44                                 ` Blue Swirl
2011-10-18 15:56                           ` Anthony Liguori
2011-10-18 16:14                             ` Peter Maydell
2011-10-25 14:34                         ` Dor Laor
2012-01-25 21:16                           ` Stefan Weil
2012-01-26 18:05                   ` Michael Walle
2011-10-17 17:52                 ` Andreas Färber
2011-10-10  2:26 ` [Qemu-devel] [PATCH 7/7] target-xtensa: rename dc232b board to sim Max Filippov
2011-10-15 21:29 ` [Qemu-devel] [PATCH 0/7] target-xtensa: add overlay parsing header and convert hand-written core definitions to use overlays Blue Swirl
2011-10-15 21:52   ` Max Filippov
2011-10-16  6:15     ` Stefan Weil

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=1318213565-3268-4-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --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).