Received: from eggs.gnu.org ([2001:4830:134:3::10]:44521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6cd0-0008Qh-U6 for qemu-devel@nongnu.org; Tue, 06 Aug 2013 04:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6ccs-0003jN-0A for qemu-devel@nongnu.org; Tue, 06 Aug 2013 04:28:26 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:38015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6ccr-0003j2-Mc for qemu-devel@nongnu.org; Tue, 06 Aug 2013 04:28:17 -0400 Received: by mail-pa0-f42.google.com with SMTP id lj1so421161pab.29 for ; Tue, 06 Aug 2013 01:28:17 -0700 (PDT) From: Alexey Kardashevskiy Date: Tue, 6 Aug 2013 18:27:50 +1000 Message-Id: <1375777673-20274-4-git-send-email-aik@ozlabs.ru> In-Reply-To: <1375777673-20274-1-git-send-email-aik@ozlabs.ru> References: <1375777673-20274-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH 3/6] xics: move registration of global state to realize() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Alexey Kardashevskiy , Alexander Graf , qemu-ppc@nongnu.org, Paul Mackerras , =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson Registration of global state belongs into realize so move it there. Signed-off-by: Alexey Kardashevskiy --- hw/intc/xics.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index c5dad2f..436c788 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -692,6 +692,17 @@ static void xics_realize(DeviceState *dev, Error **errp) ICSState *ics = icp->ics; int i; + /* Registration of global state belongs into realize */ + spapr_rtas_register("ibm,set-xive", rtas_set_xive); + spapr_rtas_register("ibm,get-xive", rtas_get_xive); + spapr_rtas_register("ibm,int-off", rtas_int_off); + spapr_rtas_register("ibm,int-on", rtas_int_on); + + spapr_register_hypercall(H_CPPR, h_cppr); + spapr_register_hypercall(H_IPI, h_ipi); + spapr_register_hypercall(H_XIRR, h_xirr); + spapr_register_hypercall(H_EOI, h_eoi); + ics->nr_irqs = icp->nr_irqs; ics->offset = XICS_IRQ_BASE; ics->icp = icp; @@ -730,16 +741,6 @@ static void xics_class_init(ObjectClass *oc, void *data) dc->props = xics_properties; dc->reset = xics_reset; k->cpu_setup = xics_cpu_setup; - - spapr_rtas_register("ibm,set-xive", rtas_set_xive); - spapr_rtas_register("ibm,get-xive", rtas_get_xive); - spapr_rtas_register("ibm,int-off", rtas_int_off); - spapr_rtas_register("ibm,int-on", rtas_int_on); - - spapr_register_hypercall(H_CPPR, h_cppr); - spapr_register_hypercall(H_IPI, h_ipi); - spapr_register_hypercall(H_XIRR, h_xirr); - spapr_register_hypercall(H_EOI, h_eoi); } static const TypeInfo xics_info = { -- 1.8.3.2