From patchwork Wed Jun 24 18:13:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 32221 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5OIEQoj025193 for ; Wed, 24 Jun 2009 18:14:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751708AbZFXSNr (ORCPT ); Wed, 24 Jun 2009 14:13:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753762AbZFXSNr (ORCPT ); Wed, 24 Jun 2009 14:13:47 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:48053 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbZFXSNq (ORCPT ); Wed, 24 Jun 2009 14:13:46 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n5OI91wE024569 for ; Wed, 24 Jun 2009 14:09:01 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n5OIDnW9232922 for ; Wed, 24 Jun 2009 14:13:49 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n5OIDmBB018531 for ; Wed, 24 Jun 2009 14:13:48 -0400 Received: from localhost.localdomain (sig-9-48-84-240.mts.ibm.com [9.48.84.240]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n5OIDlOV018514; Wed, 24 Jun 2009 14:13:47 -0400 From: Anthony Liguori To: kvm@vger.kernel.org Cc: Avi Kivity , Dustin Kirkland , Anthony Liguori Subject: [PATCH] Fix non-KVM build Date: Wed, 24 Jun 2009 13:13:46 -0500 Message-Id: <1245867226-30604-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.2.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This introduces some #ifdefs in pcspk to fix the build when KVM isn't enabled. Signed-off-by: Anthony Liguori --- hw/pcspk.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/pcspk.c b/hw/pcspk.c index 9e1b59a..236995a 100644 --- a/hw/pcspk.c +++ b/hw/pcspk.c @@ -80,11 +80,6 @@ static void kvm_set_pit_ch2(PITState *pit, kvm_set_pit(kvm_context, inkernel_state); } } -#else -static inline void kvm_get_pit_ch2(PITState *pit, - kvm_pit_state *inkernel_state) { } -static inline void kvm_set_pit_ch2(PITState *pit, - kvm_pit_state *inkernel_state) { } #endif static inline void generate_samples(PCSpkState *s) @@ -111,7 +106,9 @@ static void pcspk_callback(void *opaque, int free) PCSpkState *s = opaque; unsigned int n; +#ifdef USE_KVM_PIT kvm_get_pit_ch2(s->pit, NULL); +#endif if (pit_get_mode(s->pit, 2) != 3) return; @@ -158,7 +155,9 @@ static uint32_t pcspk_ioport_read(void *opaque, uint32_t addr) PCSpkState *s = opaque; int out; +#ifdef USE_KVM_PIT kvm_get_pit_ch2(s->pit, NULL); +#endif s->dummy_refresh_clock ^= (1 << 4); out = pit_get_out(s->pit, 2, qemu_get_clock(vm_clock)) << 5; @@ -168,11 +167,13 @@ static uint32_t pcspk_ioport_read(void *opaque, uint32_t addr) static void pcspk_ioport_write(void *opaque, uint32_t addr, uint32_t val) { - struct kvm_pit_state inkernel_state; PCSpkState *s = opaque; const int gate = val & 1; +#ifdef USE_KVM_PIT + struct kvm_pit_state inkernel_state; kvm_get_pit_ch2(s->pit, &inkernel_state); +#endif s->data_on = (val >> 1) & 1; pit_set_gate(s->pit, 2, gate); @@ -182,7 +183,9 @@ static void pcspk_ioport_write(void *opaque, uint32_t addr, uint32_t val) AUD_set_active_out(s->voice, gate & s->data_on); } +#ifdef USE_KVM_PIT kvm_set_pit_ch2(s->pit, &inkernel_state); +#endif } void pcspk_init(PITState *pit)