# HG changeset patch
# User Jerone Young <[EMAIL PROTECTED]>
# Date 1193999336 18000
# Node ID ff04bb3d78f2a6163d08448ee15af35fcf8910d4
# Parent 203ba0a9217f489a3ed43f13fffd3bbe128e5635
Move cr8 functions to libkvm-x86.c
This patch moves functions:
kvm_set_cr8
kvm_get_cr8
cr8 is an x86 only register.
Signed-off-by: Jerone Young <[EMAIL PROTECTED]>
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -726,3 +726,19 @@ uint64_t kvm_get_apic_base(kvm_context_t
return run->apic_base;
}
+void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8)
+{
+ struct kvm_run *run = kvm->run[vcpu];
+
+ if (kvm_abi == 10) {
+ ((struct kvm_run_abi10 *)run)->cr8 = cr8;
+ return;
+ }
+ run->cr8 = cr8;
+}
+
+__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu)
+{
+ return kvm->run[vcpu]->cr8;
+}
+
diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h
--- a/libkvm/libkvm-x86.h
+++ b/libkvm/libkvm-x86.h
@@ -81,5 +81,27 @@ void kvm_show_regs(kvm_context_t kvm, in
*/
uint64_t kvm_get_apic_base(kvm_context_t kvm, int vcpu);
+/*!
+ * \brief Set up cr8 for next time the vcpu is executed
+ *
+ * This is a fast setter for cr8, which will be applied when the
+ * vcpu next enters guest mode.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param vcpu Which virtual CPU should get dumped
+ * \param cr8 next cr8 value
+ */
+void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8);
+
+/*!
+ * \brief Get cr8 for sync tpr in qemu apic emulation
+ *
+ * This is a getter for cr8, which used to sync with the tpr in qemu
+ * apic emualtion.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param vcpu Which virtual CPU should get dumped
+ */
+__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu);
#endif
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -768,22 +768,6 @@ int kvm_is_ready_for_interrupt_injection
return run->ready_for_interrupt_injection;
}
-void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8)
-{
- struct kvm_run *run = kvm->run[vcpu];
-
- if (kvm_abi == 10) {
- ((struct kvm_run_abi10 *)run)->cr8 = cr8;
- return;
- }
- run->cr8 = cr8;
-}
-
-__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu)
-{
- return kvm->run[vcpu]->cr8;
-}
-
int kvm_run(kvm_context_t kvm, int vcpu)
{
int r;
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -215,29 +215,6 @@ int kvm_is_ready_for_interrupt_injection
int kvm_is_ready_for_interrupt_injection(kvm_context_t kvm, int vcpu);
/*!
- * \brief Set up cr8 for next time the vcpu is executed
- *
- * This is a fast setter for cr8, which will be applied when the
- * vcpu next enters guest mode.
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu Which virtual CPU should get dumped
- * \param cr8 next cr8 value
- */
-void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8);
-
-/*!
- * \brief Get cr8 for sync tpr in qemu apic emulation
- *
- * This is a getter for cr8, which used to sync with the tpr in qemu
- * apic emualtion.
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu Which virtual CPU should get dumped
- */
-__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu);
-
-/*!
* \brief Read VCPU registers
*
* This gets the GP registers from the VCPU and outputs them
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel