From patchwork Wed May 23 03:08:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 160817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 25243B7015 for ; Wed, 23 May 2012 14:44:05 +1000 (EST) Received: from localhost ([::1]:38177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1yf-0003UL-Py for incoming@patchwork.ozlabs.org; Tue, 22 May 2012 23:11:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1wv-000112-OQ for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SX1wp-0005l4-6Y for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35616 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1wo-0005jf-UM; Tue, 22 May 2012 23:09:15 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id A5FEA97155; Wed, 23 May 2012 05:09:13 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 23 May 2012 05:08:02 +0200 Message-Id: <1337742502-28565-40-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1337742502-28565-1-git-send-email-afaerber@suse.de> References: <1337742502-28565-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: "open list:PowerPC" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Alexander Graf Subject: [Qemu-devel] [PATCH qom-next 39/59] target-ppc: Pass PowerPCCPU to cpu_ppc_hypercall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Adapt emulate_spapr_hypercall() accordingly. Needed for spapr_hypercall(). Signed-off-by: Andreas Färber --- hw/spapr.c | 4 +++- target-ppc/cpu.h | 2 +- target-ppc/helper.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/spapr.c b/hw/spapr.c index d0bddbc..70068b4 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -477,8 +477,10 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR; } -static void emulate_spapr_hypercall(CPUPPCState *env) +static void emulate_spapr_hypercall(PowerPCCPU *cpu) { + CPUPPCState *env = &cpu->env; + env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]); } diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 77a2858..9b38529 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -2182,7 +2182,7 @@ static inline uint32_t booke206_tlbnps(CPUPPCState *env, const int tlbn) #endif -extern void (*cpu_ppc_hypercall)(CPUPPCState *); +extern void (*cpu_ppc_hypercall)(PowerPCCPU *); static inline bool cpu_has_work(CPUPPCState *env) { diff --git a/target-ppc/helper.c b/target-ppc/helper.c index f947684..7747674 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -67,7 +67,7 @@ /*****************************************************************************/ /* PowerPC Hypercall emulation */ -void (*cpu_ppc_hypercall)(CPUPPCState *); +void (*cpu_ppc_hypercall)(PowerPCCPU *); /*****************************************************************************/ /* PowerPC MMU emulation */ @@ -2674,7 +2674,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) dump_syscall(env); lev = env->error_code; if ((lev == 1) && cpu_ppc_hypercall) { - cpu_ppc_hypercall(env); + cpu_ppc_hypercall(cpu); return; } if (lev == 1 || (lpes0 == 0 && lpes1 == 0))