diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-09-26 16:18:36 +1000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-10-25 23:25:46 +0200 |
commit | 8ffe04ed2ed44b32f97575bc3cb7c29eefdd70da (patch) | |
tree | e1b0188de6fef855c2f6f2fdd2ec66053af6ef9f /hw/intc/xics.c | |
parent | feaa64c41f56b1b3111c31f652999799b28b9e12 (diff) | |
download | qemu-8ffe04ed2ed44b32f97575bc3cb7c29eefdd70da.tar.gz qemu-8ffe04ed2ed44b32f97575bc3cb7c29eefdd70da.tar.bz2 qemu-8ffe04ed2ed44b32f97575bc3cb7c29eefdd70da.zip |
xics: move reset and cpu_setup
This simple change makes following patches nicer.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/intc/xics.c')
-rw-r--r-- | hw/intc/xics.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/hw/intc/xics.c b/hw/intc/xics.c index bb018d1829..a0d71efd65 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); |