summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-06-03 11:22:04 -0700
committerRobert Mustacchi <rm@joyent.com>2011-06-03 11:22:04 -0700
commitc2961b13f6ec3e0e0b41ceac918305c08c31784a (patch)
tree39495dd1186676416784baf3239d1085414b36e9
parent1d0aace8845e2ca28d79cfb97d6e104005c8abe6 (diff)
downloadillumos-kvm-c2961b13f6ec3e0e0b41ceac918305c08c31784a.tar.gz
HVM-280 timer should be defined in kvm_timer.h
-rw-r--r--kvm.h25
-rw-r--r--kvm_lapic.h2
-rw-r--r--kvm_timer.h33
3 files changed, 37 insertions, 23 deletions
diff --git a/kvm.h b/kvm.h
index 783b565..90beeb3 100644
--- a/kvm.h
+++ b/kvm.h
@@ -244,28 +244,8 @@ typedef struct fxsave {
#ifdef _KERNEL
-typedef struct kvm_timer {
-#ifdef XXX
- struct hrtimer timer;
-#else
- cyclic_id_t kvm_cyclic_id;
- cyc_handler_t kvm_cyc_handler;
- cyc_time_t kvm_cyc_when;
- int active;
- int intervals;
- hrtime_t start;
-#endif /*XXX*/
- int64_t period; /* unit: ns */
- int pending; /* accumulated triggered timers */
- int reinject;
- struct kvm_timer_ops *t_ops;
- struct kvm *kvm;
- struct kvm_vcpu *vcpu;
-} kvm_timer_t;
-
-typedef struct kvm_timer_ops {
- int (*is_periodic)(struct kvm_timer *);
-} kvm_timer_ops_t;
+/* XXX This shouldn't be necessary */
+#include "kvm_timer.h"
typedef struct kvm_lapic {
unsigned long base_address;
@@ -2076,7 +2056,6 @@ void kvm_arch_sync_events(struct kvm *kvm);
int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
-void kvm_timer_fire(void *);
void kvm_sigprocmask(int how, sigset_t *, sigset_t *);
diff --git a/kvm_lapic.h b/kvm_lapic.h
index 6f356a7..1e2ffec 100644
--- a/kvm_lapic.h
+++ b/kvm_lapic.h
@@ -1,6 +1,8 @@
#ifndef __KVM_X86_LAPIC_H
#define __KVM_X86_LAPIC_H
+#include "kvm_timer.h"
+
struct kvm_vapic_addr;
extern int kvm_create_lapic(struct kvm_vcpu *);
diff --git a/kvm_timer.h b/kvm_timer.h
new file mode 100644
index 0000000..1e535df
--- /dev/null
+++ b/kvm_timer.h
@@ -0,0 +1,33 @@
+/*
+ * Ported from Linux by Joyent.
+ * Copyright 2011 Joyent, Inc.
+ */
+
+#ifndef __KVM_TIMER_H__
+#define __KVM_TIMER_H__
+
+#include <sys/types.h>
+#include <sys/cyclic.h>
+
+typedef struct kvm_timer {
+ cyclic_id_t kvm_cyclic_id;
+ cyc_handler_t kvm_cyc_handler;
+ cyc_time_t kvm_cyc_when;
+ int active;
+ int intervals;
+ hrtime_t start;
+ int64_t period; /* unit: ns */
+ int pending; /* accumulated triggered timers */
+ int reinject;
+ struct kvm_timer_ops *t_ops;
+ struct kvm *kvm;
+ struct kvm_vcpu *vcpu;
+} kvm_timer_t;
+
+typedef struct kvm_timer_ops {
+ int (*is_periodic)(struct kvm_timer *);
+} kvm_timer_ops_t;
+
+extern void kvm_timer_fire(void *);
+
+#endif