From: Zhang Xiantao <[EMAIL PROTECTED]> Date: Mon, 3 Dec 2007 13:48:20 +0800 Subject: [PATCH] Add libkvm-ia64.c, required by ia64 arch compile. Signed-off-by: Zhang Xiantao <[EMAIL PROTECTED]> --- libkvm/config-ia64.mak | 5 +++ libkvm/libkvm-ia64.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 libkvm/config-ia64.mak create mode 100644 libkvm/libkvm-ia64.c
diff --git a/libkvm/config-ia64.mak b/libkvm/config-ia64.mak
new file mode 100644
index 0000000..568c397
--- /dev/null
+++ b/libkvm/config-ia64.mak
@@ -0,0 +1,5 @@
+
+LIBDIR := /lib
+CFLAGS += -D__ia64__
+
+libkvm-$(ARCH)-objs := libkvm-ia64.o
diff --git a/libkvm/libkvm-ia64.c b/libkvm/libkvm-ia64.c
new file mode 100644
index 0000000..96922e4
--- /dev/null
+++ b/libkvm/libkvm-ia64.c
@@ -0,0 +1,83 @@
+/*
+ * libkvm-ia64.c :Kernel-based Virtual Machine control library for
ia64.
+ *
+ * This library provides an API to control the kvm hardware
virtualization
+ * module.
+ *
+ * Copyright (C) 2006 Qumranet
+ *
+ * Authors:
+ *
+ * Avi Kivity <[EMAIL PROTECTED]>
+ * Yaniv Kamay <[EMAIL PROTECTED]>
+ *
+ * Copyright (C) 2007 Intel
+ * Added by : Zhang Xiantao <[EMAIL PROTECTED]>
+ *
+ * This work is licensed under the GNU LGPL license, version 2.
+ *
+ */
+
+#include "libkvm.h"
+#include "kvm-ia64.h"
+#include <errno.h>
+#include <sys/ioctl.h>
+#include <string.h>
+#include <unistd.h>
+#include <stropts.h>
+#include <sys/mman.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+
+int kvm_arch_create_default_phys_mem(kvm_context_t kvm,
+ unsigned long phys_mem_bytes,
+ void **vm_mem)
+{
+ int zfd;
+
+ zfd = open("/dev/zero", O_RDONLY);
+ if (zfd == -1) {
+ perror("open /dev/zero");
+ return -1;
+ }
+ mmap(*vm_mem + 0xa8000, 0x8000, PROT_READ|PROT_WRITE,
+ MAP_PRIVATE|MAP_FIXED, zfd, 0);
+ close(zfd);
+
+ return 0;
+}
+
+
+int kvm_arch_create(kvm_context_t kvm, unsigned long phys_mem_bytes,
+ void **vm_mem)
+{
+ return 0;
+}
+
+int kvm_arch_run(struct kvm_run *run,kvm_context_t kvm, int vcpu)
+{
+ int r = 0;
+
+ switch (run->exit_reason) {
+ default:
+ r = 1;
+ break;
+ }
+
+ return r;
+}
+
+void kvm_show_code(kvm_context_t kvm, int vcpu)
+{
+ fprintf(stderr, "kvm_show_code not supported yet!\n");
+}
+
+void kvm_show_regs(kvm_context_t kvm, int vcpu)
+{
+ fprintf(stderr,"kvm_show_regs not supportted today!\n");
+}
+
--
1.5.2
0002-Add-libkvm-ia64.c-required-by-ia64-arch-compile.patch
Description: 0002-Add-libkvm-ia64.c-required-by-ia64-arch-compile.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
