From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFHGo-0000a8-B2 for qemu-devel@nongnu.org; Fri, 30 Aug 2013 01:29:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFHGa-0004rY-1r for qemu-devel@nongnu.org; Fri, 30 Aug 2013 01:29:18 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:40243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFHGZ-0004qt-EG for qemu-devel@nongnu.org; Fri, 30 Aug 2013 01:29:03 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Aug 2013 15:15:09 +1000 From: Alexey Kardashevskiy Date: Fri, 30 Aug 2013 15:28:30 +1000 Message-Id: <1377840513-24882-10-git-send-email-aik@ozlabs.ru> In-Reply-To: <1377840513-24882-1-git-send-email-aik@ozlabs.ru> References: <1377840513-24882-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v4 09/12] xics: add cpu_setup callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Alexander Graf , qemu-ppc@nongnu.org, Paul Mackerras , =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson This adds a cpu_setup callback to the XICS device class (as XICS-KVM will do it different), xics_cpu_setup() will call it if it is set. Signed-off-by: Alexey Kardashevskiy --- hw/intc/xics.c | 5 +++++ include/hw/ppc/xics.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index ab1eaed..2139243 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -37,9 +37,14 @@ void xics_cpu_setup(XICSState *icp, PowerPCCPU *cpu) CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; ICPState *ss = &icp->ss[cs->cpu_index]; + XICSStateClass *info = XICS_COMMON_GET_CLASS(icp); assert(cs->cpu_index < icp->nr_servers); + if (info->cpu_setup) { + info->cpu_setup(icp, cpu); + } + switch (PPC_INPUT(env)) { case PPC_FLAGS_INPUT_POWER7: ss->output = env->irq_inputs[POWER7_INPUT_INT]; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 7e702a0..343bba8 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -64,6 +64,7 @@ typedef struct ICSIRQState ICSIRQState; struct XICSStateClass { DeviceClass parent_class; + void (*cpu_setup)(XICSState *icp, PowerPCCPU *cpu); void (*set_nr_irqs)(XICSState *icp, uint32_t nr_irqs, Error **errp); void (*set_nr_servers)(XICSState *icp, uint32_t nr_servers, Error **errp); }; -- 1.8.4.rc4