From: ehrhardt@linux.vnet.ibm.com
To: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, avi@qumranet.com
Cc: hollisb@us.ibm.com, ehrhardt@linux.vnet.ibm.com
Subject: [PATCH 4/5] libcflat: ppc: add timebase accessor
Date: Tue, 28 Oct 2008 10:08:21 +0100 [thread overview]
Message-ID: <1225184902-25769-5-git-send-email-ehrhardt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1225184902-25769-1-git-send-email-ehrhardt@linux.vnet.ibm.com>
Provide a timebase accessor for ppc testcases.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
[diffstat]
config-powerpc-44x.mak | 3 ++-
test/lib/powerpc/44x/timebase.S | 28 ++++++++++++++++++++++++++++
test/lib/powerpc/44x/timebase.h | 25 +++++++++++++++++++++++++
3 files changed, 55 insertions(+), 1 deletion(-)
[diff]
diff --git a/user/config-powerpc-44x.mak b/user/config-powerpc-44x.mak
--- a/user/config-powerpc-44x.mak
+++ b/user/config-powerpc-44x.mak
@@ -5,7 +5,8 @@
cflatobjs += \
test/lib/powerpc/44x/map.o \
- test/lib/powerpc/44x/tlbwe.o
+ test/lib/powerpc/44x/tlbwe.o \
+ test/lib/powerpc/44x/timebase.o
simpletests += \
test/powerpc/44x/tlbsx.bin \
diff --git a/user/test/lib/powerpc/44x/timebase.S b/user/test/lib/powerpc/44x/timebase.S
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/44x/timebase.S
@@ -0,0 +1,28 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2008
+ *
+ * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ */
+
+/* unsigned long long mftb(void); */
+.global mftb
+mftb:
+ mftbu r5
+ mftbl r4
+ mftbu r3
+ cmpw r3, r5
+ bne mftb
+ blr
diff --git a/user/test/lib/powerpc/44x/timebase.h b/user/test/lib/powerpc/44x/timebase.h
new file mode 100644
--- /dev/null
+++ b/user/test/lib/powerpc/44x/timebase.h
@@ -0,0 +1,25 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2008
+ *
+ * Authors: Hollis Blanchard <hollisb@us.ibm.com>
+ */
+
+#ifndef __TIMEBASE_H__
+#define __TIMEBASE_H__
+
+unsigned long long mftb(void);
+
+#endif /* __TIMEBASE_H__ */
prev parent reply other threads:[~2008-10-28 9:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-28 9:08 [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 1/5] user: ppc: fix threading bugs in main-ppc.c ehrhardt
2008-10-28 9:08 ` [PATCH 2/5] user: ppc: better error reporting in load_file ehrhardt
[not found] ` <1225184902-25769-1-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-10-28 9:08 ` [PATCH 3/5] user: ppc: implement PowerPC 44x libcflat ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:08 ` [PATCH 5/5] user: ppc: add stub nmi handler ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2008-10-28 9:25 ` [PATCH 0/3] kvm-userspace: ppc: userspace fixes for powerpc Christian Ehrhardt
2008-10-28 9:08 ` ehrhardt [this message]
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=1225184902-25769-5-git-send-email-ehrhardt@linux.vnet.ibm.com \
--to=ehrhardt@linux.vnet.ibm.com \
--cc=avi@qumranet.com \
--cc=hollisb@us.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.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