From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP4v5-0001bK-8H for qemu-devel@nongnu.org; Thu, 26 Sep 2013 02:19:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VP4uo-00084i-9J for qemu-devel@nongnu.org; Thu, 26 Sep 2013 02:19:23 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:53081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP4un-00083h-IA for qemu-devel@nongnu.org; Thu, 26 Sep 2013 02:19:06 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Sep 2013 16:19:02 +1000 From: Alexey Kardashevskiy Date: Thu, 26 Sep 2013 16:18:36 +1000 Message-Id: <1380176328-21320-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1380176328-21320-1-git-send-email-aik@ozlabs.ru> References: <1380176328-21320-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v5 02/14] xics: move reset and cpu_setup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , Anthony Liguori , David Gibson This simple change makes following patches nicer. Signed-off-by: Alexey Kardashevskiy --- hw/intc/xics.c | 72 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index bb018d1..a0d71ef 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -30,6 +30,42 @@ #include "hw/ppc/spapr.h" #include "hw/ppc/xics.h" +void xics_cpu_setup(XICSState *icp, PowerPCCPU *cpu) +{ + CPUState *cs = CPU(cpu); + CPUPPCState *env = &cpu->env; + ICPState *ss = &icp->ss[cs->cpu_index]; + + assert(cs->cpu_index < icp->nr_servers); + + switch (PPC_INPUT(env)) { + case PPC_FLAGS_INPUT_POWER7: + ss->output = env->irq_inputs[POWER7_INPUT_INT]; + break; + + case PPC_FLAGS_INPUT_970: + ss->output = env->irq_inputs[PPC970_INPUT_INT]; + break; + + default: + fprintf(stderr, "XICS interrupt controller does not support this CPU " + "bus model\n"); + abort(); + } +} + +static void xics_reset(DeviceState *d) +{ + XICSState *icp = XICS(d); + int i; + + for (i = 0; i < icp->nr_servers; i++) { + device_reset(DEVICE(&icp->ss[i])); + } + + device_reset(DEVICE(icp->ics)); +} + /* * ICP: Presentation layer */ @@ -600,42 +636,6 @@ static void rtas_int_on(PowerPCCPU *cpu, sPAPREnvironment *spapr, * XICS */ -static void xics_reset(DeviceState *d) -{ - XICSState *icp = XICS(d); - int i; - - for (i = 0; i < icp->nr_servers; i++) { - device_reset(DEVICE(&icp->ss[i])); - } - - device_reset(DEVICE(icp->ics)); -} - -void xics_cpu_setup(XICSState *icp, PowerPCCPU *cpu) -{ - CPUState *cs = CPU(cpu); - CPUPPCState *env = &cpu->env; - ICPState *ss = &icp->ss[cs->cpu_index]; - - assert(cs->cpu_index < icp->nr_servers); - - switch (PPC_INPUT(env)) { - case PPC_FLAGS_INPUT_POWER7: - ss->output = env->irq_inputs[POWER7_INPUT_INT]; - break; - - case PPC_FLAGS_INPUT_970: - ss->output = env->irq_inputs[PPC970_INPUT_INT]; - break; - - default: - fprintf(stderr, "XICS interrupt controller does not support this CPU " - "bus model\n"); - abort(); - } -} - static void xics_realize(DeviceState *dev, Error **errp) { XICSState *icp = XICS(dev); -- 1.8.4.rc4