From: Zhang Xiantao <[EMAIL PROTECTED]> Date: Mon, 3 Dec 2007 13:57:07 +0800 Subject: [PATCH] Add kvm-ia64.h. This patch adds kvm-ia64.h, and use getpagesize to get host page size, since ia64 can use multiple type of page size in kernel. Signed-off-by: Zhang Xiantao <[EMAIL PROTECTED]> --- libkvm/kvm-ia64.h | 28 ++++++++++++++++++++++++++++ libkvm/libkvm.c | 6 ++++++ 2 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 libkvm/kvm-ia64.h
diff --git a/libkvm/kvm-ia64.h b/libkvm/kvm-ia64.h
new file mode 100644
index 0000000..304496d
--- /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 <[EMAIL PROTECTED]>
+ * Yaniv Kamay <[EMAIL PROTECTED]>
+ *
+ * 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 8131d25..e92266a 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;
--
1.5.2
0003-Add-kvm-ia64.h.patch
Description: 0003-Add-kvm-ia64.h.patch
------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________ kvm-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kvm-devel
