aboutsummaryrefslogtreecommitdiff
path: root/hw/xtensa_pic.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2011-10-16 02:56:03 +0400
committerBlue Swirl <blauwirbel@gmail.com>2011-10-16 10:39:41 +0000
commitb8929a549f3e97b6cc2dfd22ba83612a1bb625ec (patch)
tree63c0141c6ea2f2f1f9ff3eb160591bb27fd763e7 /hw/xtensa_pic.c
parent63f95e4c652fd35df7e048574dcb468b404a6f4e (diff)
downloadqemu-b8929a549f3e97b6cc2dfd22ba83612a1bb625ec.zip
qemu-b8929a549f3e97b6cc2dfd22ba83612a1bb625ec.tar.gz
qemu-b8929a549f3e97b6cc2dfd22ba83612a1bb625ec.tar.bz2
target-xtensa: implement external interrupt mapping
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/xtensa_pic.c')
-rw-r--r--hw/xtensa_pic.c12
1 files changed, 12 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;
+ }
+}