[PATCH 15 of 17] Move cr8 functions to libkvm-x86.c

Jerone Young
2007-11-06T16:48:56Z

# Date 1194367666 21600
# Node ID f610c78e9f363a53b3e9677aa84873b05a692acb
# Parent 7ef9d60771ef7e6d32919ace92d078a482b9d589
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 <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -712,3 +712,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.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -824,22 +824,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;