* [kvm-ppc-devel] [EXAMPLE] [PATCH] Framework for adding Powerpc
@ 2007-11-27 20:42 Jerone Young
0 siblings, 0 replies; only message in thread
From: Jerone Young @ 2007-11-27 20:42 UTC (permalink / raw)
To: kvm-ppc
Figured I would just put this on the list for the curious bunch. This is
a small patch that is basically to show functions that have to be
implemented for powerpc. This is an early patch in my personal repo ..
but it's mainly to give an idea of the functions that are going into the
libkvm-powerpc.c . Now once the kernel pieces get in place upstream this
will be more filed out.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Initial libkvm powerpc support
These patches add initial code for powerpc. No big implimentations
as kernel code is still being worked out. But it can be a good
template for other architectures.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
diff --git a/libkvm/config-powerpc.mak b/libkvm/config-powerpc.mak
new file mode 100644
--- /dev/null
+++ b/libkvm/config-powerpc.mak
@@ -0,0 +1,6 @@
+
+LIBDIR := /lib
+CFLAGS += -m32
+CFLAGS += -D__powerpc__
+
+libkvm-$(ARCH)-objs := libkvm-powerpc.o
diff --git a/libkvm/kvm-powerpc.h b/libkvm/kvm-powerpc.h
new file mode 100644
--- /dev/null
+++ b/libkvm/kvm-powerpc.h
@@ -0,0 +1,23 @@
+/*
+ * This header is for functions & variables that will ONLY be
+ * used inside libkvm for powerpc.
+ * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE
+ * WITHIN LIBKVM.
+ *
+ * Copyright (C) 2007 IBM
+ *
+ * Authors:
+ * Jerone Young <jyoung5@us.ibm.com>
+ *
+ * This work is licensed under the GNU LGPL license, version 2.
+ */
+
+#ifndef KVM_POWERPC_H
+#define KVM_POWERPC_H
+
+#include "kvm-common.h"
+
+#define PAGE_SIZE 4096ul
+#define PAGE_MASK (~(PAGE_SIZE - 1))
+
+#endif
diff --git a/libkvm/libkvm-powerpc.c b/libkvm/libkvm-powerpc.c
new file mode 100644
--- /dev/null
+++ b/libkvm/libkvm-powerpc.c
@@ -0,0 +1,51 @@
+#include "libkvm.h"
+#include "kvm-powerpc.h"
+#include <errno.h>
+#include <stdio.h>
+
+int kvm_run_abi10(kvm_context_t kvm, int vcpu)
+{
+ return -ENOSYS;
+}
+
+void kvm_show_code(kvm_context_t kvm, int vcpu)
+{
+ /* XXX NEED TO IMPLIMENT */
+ return;
+}
+
+void kvm_show_regs(kvm_context_t kvm, int vcpu)
+{
+ struct kvm_regs regs;
+ int i;
+
+ kvm_get_regs(kvm,-1,®s);
+ /*
+ for (i = 0; i < 32; i += 4) {
+ fprintf(stderr,"gpr%02d: %08x %08x %08x %08x\n", i,
+ regs.gpr[i],
+ regs.gpr[i+1],
+ regs.gpr[i+2],
+ regs.gpr[i+3]);
+ }
+ */
+ fflush(stdout);
+}
+
+int kvm_arch_create(kvm_context_t kvm, unsigned long phys_mem_bytes,
+ void **vm_mem)
+{
+ return 0;
+}
+
+int kvm_arch_create_default_phys_mem(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)
+{
+ return 0;
+}
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -39,6 +39,10 @@
#if defined(__x86_64__) || defined(__i386__)
#include "kvm-x86.h"
+#endif
+
+#if defined(__powerpc__)
+#include "kvm-powerpc.h"
#endif
int kvm_abi = EXPECTED_KVM_API_VERSION;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-ppc-devel mailing list
kvm-ppc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-27 20:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-27 20:42 [kvm-ppc-devel] [EXAMPLE] [PATCH] Framework for adding Powerpc Jerone Young
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.