Received: from eggs.gnu.org ([208.118.235.92]:40707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBGU-0003YK-87 for qemu-devel@nongnu.org; Mon, 23 Jul 2012 01:33:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StBGS-0004CT-8c for qemu-devel@nongnu.org; Mon, 23 Jul 2012 01:33:06 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:36637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StBGS-0004Bt-2h for qemu-devel@nongnu.org; Mon, 23 Jul 2012 01:33:04 -0400 Received: by mail-pb0-f45.google.com with SMTP id ro12so10176751pbb.4 for ; Sun, 22 Jul 2012 22:33:03 -0700 (PDT) From: Alexey Kardashevskiy Date: Mon, 23 Jul 2012 15:32:45 +1000 Message-Id: <1343021567-3701-2-git-send-email-aik@ozlabs.ru> In-Reply-To: <1343021567-3701-1-git-send-email-aik@ozlabs.ru> References: <1342070995.2229.88.camel@bling.home> <1343021567-3701-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH 1/3] xics: added end-of-interrupt (EOI) handlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson The patch adds EOI handler to process h_eoi RTAS call correctly for PCI legacy interrupts. This functionality is going to be used in VFIO later. Signed-off-by: Alexey Kardashevskiy --- hw/xics.c | 13 +++++++++++++ hw/xics.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/hw/xics.c b/hw/xics.c index 668a0d6..d36d62c 100644 --- a/hw/xics.c +++ b/hw/xics.c @@ -170,6 +170,7 @@ struct ics_irq_state { int sent:1; int rejected:1; int masked_pending:1; + NotifierList eoi_notifier; }; struct ics_state { @@ -309,6 +310,8 @@ static void ics_eoi(struct ics_state *ics, int nr) if (irq->type == XICS_LSI) { irq->sent = 0; } + + notifier_list_notify(&irq->eoi_notifier, NULL); } /* @@ -536,6 +539,7 @@ struct icp_state *xics_system_init(int nr_irqs) for (i = 0; i < nr_irqs; i++) { ics->irqs[i].priority = 0xff; ics->irqs[i].saved_priority = 0xff; + notifier_list_init(&ics->irqs[i].eoi_notifier); } ics->qirqs = qemu_allocate_irqs(ics_set_irq, ics, nr_irqs); @@ -552,3 +556,12 @@ struct icp_state *xics_system_init(int nr_irqs) return icp; } + +void xics_add_eoi_notifier(Notifier *notify, uint32_t srcno) +{ + struct ics_state *ics = spapr->icp->ics; + struct ics_irq_state *irq = &ics->irqs[srcno - ics->offset]; + + notifier_list_add(&irq->eoi_notifier, notify); +} + diff --git a/hw/xics.h b/hw/xics.h index 2080159..ca75fac 100644 --- a/hw/xics.h +++ b/hw/xics.h @@ -27,6 +27,8 @@ #if !defined(__XICS_H__) #define __XICS_H__ +#include "notify.h" + #define XICS_IPI 0x2 struct icp_state; @@ -41,4 +43,6 @@ qemu_irq xics_assign_irq(struct icp_state *icp, int irq, struct icp_state *xics_system_init(int nr_irqs); +void xics_add_eoi_notifier(Notifier *notify, uint32_t srcno); + #endif /* __XICS_H__ */ -- 1.7.10.4