summaryrefslogtreecommitdiff
path: root/libkvm
diff options
context:
space:
mode:
Diffstat (limited to 'libkvm')
-rw-r--r--libkvm/kvm-ia64.h28
-rw-r--r--libkvm/libkvm.c6
2 files changed, 34 insertions, 0 deletions
diff --git a/libkvm/kvm-ia64.h b/libkvm/kvm-ia64.h
new file mode 100644
index 00000000..304496d5
--- /dev/null
+++ b/libkvm/kvm-ia64.h
@@ -0,0 +1,28 @@
+/*
+ * This header is for functions & variables that will ONLY be
+ * used inside libkvm for x86.
+ * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE
+ * WITHIN LIBKVM.
+ *
+ * derived from libkvm.c
+ *
+ * Copyright (C) 2006 Qumranet, Inc.
+ *
+ * Authors:
+ * Avi Kivity <avi@qumranet.com>
+ * Yaniv Kamay <yaniv@qumranet.com>
+ *
+ * This work is licensed under the GNU LGPL license, version 2.
+ */
+
+#ifndef KVM_IA64_H
+#define KVM_IA64_H
+
+#include "kvm-common.h"
+
+extern int kvm_page_size;
+
+#define PAGE_SIZE kvm_page_size
+#define PAGE_MASK (~(kvm_page_size - 1))
+
+#endif
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index cfedaa4b..f24eaec4 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -41,7 +41,12 @@
#include "kvm-x86.h"
#endif
+#if defined(__ia64__)
+#include "kvm-ia64.h"
+#endif
+
int kvm_abi = EXPECTED_KVM_API_VERSION;
+int kvm_page_size;
struct slot_info {
unsigned long phys_addr;
@@ -230,6 +235,7 @@ kvm_context_t kvm_init(struct kvm_callbacks *callbacks,
goto out_close;
}
kvm_abi = r;
+ kvm_page_size = getpagesize();
kvm = malloc(sizeof(*kvm));
kvm->fd = fd;
kvm->vm_fd = -1;