public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Move kvm_get_pit to libkvm.c common code
@ 2008-03-11 20:17 Jerone Young
  2008-03-12  6:36 ` Yang, Sheng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jerone Young @ 2008-03-11 20:17 UTC (permalink / raw)
  To: kvm-devel; +Cc: kvm-ppc-devel

# HG changeset patch
# User Jerone Young <jyoung5@us.ibm.com>
# Date 1205266548 18000
# Branch merge
# Node ID b136c0450c0f7c6ff2262437b1beb9896b1585e3
# Parent  c14fbbaee36241aa0fab0d6391e47cf9f4ac8012
Move kvm_get_pit to libkvm.c common code

This fixes compilation issues for PowerPC and other non x86 archs that do not
have in kernel pit. The pit code is added into the kvm_context in kvm-common.h &the error causing the issue is coming from a definition in qemu. This seems to be the proper fix as there is also a common function:
kvm_irqchip_in_kernel
for in kernel irq that handles this the same way.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -660,12 +660,3 @@ int kvm_disable_tpr_access_reporting(kvm
 }
 
 #endif
-
-int kvm_pit_in_kernel(kvm_context_t kvm)
-{
-#ifdef KVM_CAP_PIT
-	return kvm->pit_in_kernel;
-#else
-	return 0;
-#endif
-}
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -962,3 +962,8 @@ int kvm_irqchip_in_kernel(kvm_context_t 
 {
     return kvm->irqchip_in_kernel;
 }
+
+int kvm_pit_in_kernel(kvm_context_t kvm)
+{
+	return kvm->pit_in_kernel;
+}
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -530,6 +530,13 @@ int kvm_set_lapic(kvm_context_t kvm, int
 
 #endif
 
+/*!
+ * \brief Query wheather in kernel pit is used
+ *
+ *  \param kvm Pointer to the current kvm_context
+ */
+int kvm_pit_in_kernel(kvm_context_t kvm);
+
 #ifdef KVM_CAP_PIT
 
 /*!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-24  1:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-11 20:17 [PATCH] Move kvm_get_pit to libkvm.c common code Jerone Young
2008-03-12  6:36 ` Yang, Sheng
2008-03-16 11:35 ` Avi Kivity
2008-03-21 20:26 ` Hollis Blanchard
2008-03-23  8:44   ` Avi Kivity
2008-03-24  1:51     ` [kvm-ppc-devel] [PATCH] Move kvm_get_pit tolibkvm.c " Zhang, Xiantao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox