summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-07-06 12:27:42 -0700
committerDavid Schleef <ds@schleef.org>2010-07-09 18:22:11 -0700
commit3c66562a3447fa2224a09bdca9f60d98dff18a4d (patch)
treef2eb709ce87f19eeeb92373d13b085537bcf77c1
parentc32ded6d60f1b3162db3a7c67d51e6256a24661b (diff)
downloadorc-neon.tar.gz
arm/neon: timestamp counter (not for master)neon
Add timestamp counter for Cortex-A8. Requires a kernel patch to use.
-rw-r--r--orc-test/orcprofile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/orc-test/orcprofile.c b/orc-test/orcprofile.c
index 48e0c3e..5d97a0b 100644
--- a/orc-test/orcprofile.c
+++ b/orc-test/orcprofile.c
@@ -56,6 +56,19 @@
void
orc_profile_init (OrcProfile *prof)
{
+#if defined(__GNUC__) && (defined(HAVE_ARM))
+ unsigned int flags;
+ unsigned int count;
+
+ __asm__ volatile ("mrc p15, 0, %0, c9, c12, 0" : "=r" (flags));
+ flags |= 1;
+ __asm__ volatile ("mcr p15, 0, %0, c9, c12, 0" :: "r" (flags));
+
+ __asm__ volatile ("mcr p15, 0, %0, c9, c12, 2" :: "r"(1<<31));
+ __asm__ __volatile__(" mcr p15, 0, %0, c9, c13, 0" :: "r" (0));
+
+ __asm__ volatile ("mcr p15, 0, %0, c9, c12, 1" :: "r"(1<<31));
+#endif
memset(prof, 0, sizeof(OrcProfile));
prof->min = -1;
@@ -156,6 +169,11 @@ oil_profile_stamp_default (void)
unsigned long ts;
__asm__ __volatile__("rdtsc\n" : "=a" (ts) : : "edx");
return ts;
+#elif defined(__GNUC__) && defined(HAVE_ARM)
+ unsigned int ts;
+ //__asm__ __volatile__(" mrc p14, 0, %0, c1, c0, 0 \n" : "=r" (ts));
+ __asm__ __volatile__(" mrc p15, 0, %0, c9, c13, 0 \n" : "=r" (ts));
+ return ts;
#elif defined(_MSC_VER) && defined(HAVE_I386)
unsigned long ts;
__asm push edx