From patchwork Thu Oct 6 08:05:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 118017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7FF76B6FD7 for ; Thu, 6 Oct 2011 20:57:27 +1100 (EST) Received: from localhost ([::1]:59265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBiyd-0003ep-3E for incoming@patchwork.ozlabs.org; Thu, 06 Oct 2011 04:06:47 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBixX-0001nc-7i for qemu-devel@nongnu.org; Thu, 06 Oct 2011 04:05:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBixO-0000u5-S7 for qemu-devel@nongnu.org; Thu, 06 Oct 2011 04:05:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34578 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBixO-0000sR-IX; Thu, 06 Oct 2011 04:05:30 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 45B8E90F2E; Thu, 6 Oct 2011 10:05:29 +0200 (CEST) From: Alexander Graf To: qemu-devel@nongnu.org Date: Thu, 6 Oct 2011 10:05:23 +0200 Message-Id: <1317888366-10509-22-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1317888366-10509-1-git-send-email-agraf@suse.de> References: <1317888366-10509-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Blue Swirl , qemu-ppc@nongnu.org Subject: [Qemu-devel] [PATCH 21/64] PPC: KVM: Add stubs for kvm helper functions 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 We have a bunch of helper functions that don't have any stubs for them in case we don't have CONFIG_KVM enabled. That didn't bite us so far, because gcc can optimize them out pretty well, but we should really provide them. Signed-off-by: Alexander Graf --- v1 -> v2: - use uint64_t for clockfreq --- target-ppc/kvm_ppc.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h index 0c659c8..76f98d9 100644 --- a/target-ppc/kvm_ppc.h +++ b/target-ppc/kvm_ppc.h @@ -11,11 +11,37 @@ void kvmppc_init(void); +#ifdef CONFIG_KVM + uint32_t kvmppc_get_tbfreq(void); uint64_t kvmppc_get_clockfreq(void); int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len); int kvmppc_set_interrupt(CPUState *env, int irq, int level); +#else + +static inline uint32_t kvmppc_get_tbfreq(void) +{ + return 0; +} + +static inline uint64_t kvmppc_get_clockfreq(void) +{ + return 0; +} + +static inline int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len) +{ + return -1; +} + +static inline int kvmppc_set_interrupt(CPUState *env, int irq, int level) +{ + return -1; +} + +#endif + #ifndef CONFIG_KVM #define kvmppc_eieio() do { } while (0) #else