From: Ehrhardt Christian Subject: [PATCH 05 of 10] [PATCH] libcflat: ppc: add timebase accessor Date: Tue, 28 Oct 2008 16:52:33 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org, ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org To: kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org Return-path: In-Reply-To: Sender: kvm-ppc-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: kvm.vger.kernel.org Provide a timebase accessor for ppc testcases. Signed-off-by: Hollis Blanchard Signed-off-by: Christian Ehrhardt [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 + */ + +/* 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 + */ + +#ifndef __TIMEBASE_H__ +#define __TIMEBASE_H__ + +unsigned long long mftb(void); + +#endif /* __TIMEBASE_H__ */ -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html