Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>

Index: kvm-userspace.realtip/libkvm/libkvm-x86.c
===================================================================
--- kvm-userspace.realtip.orig/libkvm/libkvm-x86.c
+++ kvm-userspace.realtip/libkvm/libkvm-x86.c
@@ -418,6 +418,37 @@ int kvm_set_pit(kvm_context_t kvm, struc
 
 #endif
 
+#ifdef KVM_CAP_ACPI_TIMER
+
+int kvm_get_acpi_timer(kvm_context_t kvm, struct kvm_acpi_timer_state *s)
+{
+       int r;
+       if (!kvm->acpi_timer_in_kernel)
+               return 0;
+       r = ioctl(kvm->vm_fd, KVM_GET_ACPI_TIMER, s);
+       if (r != 0) {
+               r = -errno;
+               perror("kvm_get_acpi_timer");
+       }
+       return r;
+}
+
+int kvm_set_acpi_timer(kvm_context_t kvm, struct kvm_acpi_timer_state *s)
+{
+       int r;
+       if (!kvm->acpi_timer_in_kernel)
+               return 0;
+       r = ioctl(kvm->vm_fd, KVM_SET_ACPI_TIMER, s);
+       if (r != 0) {
+               r = -errno;
+               perror("kvm_set_acpi_timer");
+       }
+
+       return r;
+}
+
+#endif
+
 void kvm_show_code(kvm_context_t kvm, int vcpu)
 {
 #define SHOW_CODE_LEN 50
Index: kvm-userspace.realtip/libkvm/libkvm.h
===================================================================
--- kvm-userspace.realtip.orig/libkvm/libkvm.h
+++ kvm-userspace.realtip/libkvm/libkvm.h
@@ -616,6 +616,28 @@ int kvm_set_pit(kvm_context_t kvm, struc
  */
 int kvm_acpi_timer_in_kernel(kvm_context_t kvm);
 
+#ifdef KVM_CAP_ACPI_TIMER
+
+#if defined(__i386__) || defined(__x86_64__)
+/*!
+ * \brief Get in kernel ACPI timer of the virtual domain
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s ACPI timer state of the virtual domain
+ */
+int kvm_get_acpi_timer(kvm_context_t kvm, struct kvm_acpi_timer_state *s);
+
+/*!
+ * \brief Set in kernel ACPI timer of the virtual domain
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s ACPI timer state of the virtual domain
+ */
+int kvm_set_acpi_timer(kvm_context_t kvm, struct kvm_acpi_timer_state *s);
+#endif
+
+#endif
+
 #ifdef KVM_CAP_OPEN_IOPORT
 
 /*!

-- 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to