public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 2 of 2] Initial skeleton for libkvm powerpc support
Date: Thu, 29 Nov 2007 14:16:43 -0600	[thread overview]
Message-ID: <edbd1102ce114df80ea0.1196367403@thinkpad> (raw)
In-Reply-To: <patchbomb.1196367401@thinkpad>

# HG changeset patch
# User Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1196367361 21600
# Node ID edbd1102ce114df80ea0f17bffb5bb98129c37f8
# Parent  6f34b3cd608868c4cc8280ab333aac78a7ba9a6d
Initial skeleton for libkvm powerpc support

This patch is to add initial skelton code for powerpc.
No big implimentations as kernel code is still being worked out.
But it can be a good template for other architectures. Once kernel
code makes it upstream (and is for the most part finalized) then
implimentaions will follow.


Signed-off-by: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

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-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>	
+ *
+ * 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,34 @@
+#include "libkvm.h"
+#include "kvm-powerpc.h"
+#include <errno.h>
+
+int kvm_run_abi10(kvm_context_t kvm, int vcpu)
+{
+	return -ENOSYS;
+}
+
+void kvm_show_code(kvm_context_t kvm, int vcpu)
+{
+}
+
+void kvm_show_regs(kvm_context_t kvm, int vcpu)
+{
+}
+
+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;

-------------------------------------------------------------------------
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

  parent reply	other threads:[~2007-11-29 20:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 20:16 [PATCH 0 of 2] Add small pieces for userspace powerpc support Jerone Young
2007-11-29 20:16 ` [PATCH 1 of 2] Add powerpc tests Jerone Young
2007-11-29 20:16 ` Jerone Young [this message]
2007-11-30  8:17 ` [PATCH 0 of 2] Add small pieces for userspace powerpc support Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=edbd1102ce114df80ea0.1196367403@thinkpad \
    --to=jyoung5-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox