Module: xenomai-2.6
Branch: master
Commit: f8ce1b8bc91af08c2f40546d06fb804d08d23c96
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=f8ce1b8bc91af08c2f40546d06fb804d08d23c96

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sat Apr 27 23:13:16 2013 +0200

hal/blackfin: move __xn_rdtsc definition to asm/tsc.h

---

 include/asm-blackfin/Makefile.am |    2 +-
 include/asm-blackfin/Makefile.in |    2 +-
 include/asm-blackfin/syscall.h   |   24 +-----------------
 include/asm-blackfin/tsc.h       |   50 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+), 25 deletions(-)

diff --git a/include/asm-blackfin/Makefile.am b/include/asm-blackfin/Makefile.am
index 49c0366..9338757 100644
--- a/include/asm-blackfin/Makefile.am
+++ b/include/asm-blackfin/Makefile.am
@@ -1,6 +1,6 @@
 includesubdir = $(includedir)/asm-blackfin
 
 includesub_HEADERS = arith.h atomic.h atomic_asm.h calibration.h features.h \
-       fptest.h hal.h syscall.h system.h wrappers.h
+       fptest.h hal.h syscall.h system.h tsc.h wrappers.h
 
 SUBDIRS = bits
diff --git a/include/asm-blackfin/Makefile.in b/include/asm-blackfin/Makefile.in
index 03b5bff..88f2b19 100644
--- a/include/asm-blackfin/Makefile.in
+++ b/include/asm-blackfin/Makefile.in
@@ -283,7 +283,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 includesubdir = $(includedir)/asm-blackfin
 includesub_HEADERS = arith.h atomic.h atomic_asm.h calibration.h features.h \
-       fptest.h hal.h syscall.h system.h wrappers.h
+       fptest.h hal.h syscall.h system.h tsc.h wrappers.h
 
 SUBDIRS = bits
 all: all-recursive
diff --git a/include/asm-blackfin/syscall.h b/include/asm-blackfin/syscall.h
index 5aff3e3..9eda8b9 100644
--- a/include/asm-blackfin/syscall.h
+++ b/include/asm-blackfin/syscall.h
@@ -21,6 +21,7 @@
 #define _XENO_ASM_BLACKFIN_SYSCALL_H
 
 #include <asm-generic/xenomai/syscall.h>
+#include <asm/xenomai/tsc.h>
 
 /* The way we mangle Xenomai syscalls with our multiplexer
    marker. Note: watch out for the p0 sign convention used by Linux
@@ -130,29 +131,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #define XENOMAI_SKINCALL4(id,op,a1,a2,a3,a4)    
XENOMAI_DO_SYSCALL(4,id,op,a1,a2,a3,a4)
 #define XENOMAI_SKINCALL5(id,op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,id,op,a1,a2,a3,a4,a5)
 
-static inline unsigned long long __xn_rdtsc (void)
-{
-    union {
-       struct {
-           unsigned long l;
-           unsigned long h;
-       } s;
-       unsigned long long t;
-    } u;
-    unsigned long cy2;
-
-    __asm__ __volatile__ (     "1: %0 = CYCLES2\n"
-                               "%1 = CYCLES\n"
-                               "%2 = CYCLES2\n"
-                               "CC = %2 == %0\n"
-                               "if !cc jump 1b\n"
-                               :"=d" (u.s.h),
-                               "=d" (u.s.l),
-                               "=d" (cy2)
-                               : /*no input*/ : "cc");
-    return u.t;
-}
-
 /* uClibc does not provide pthread_atfork() for this arch; provide it
    here. Note: let the compiler decides whether it wants to actually
    inline this routine, i.e. do not force always_inline. */
diff --git a/include/asm-blackfin/tsc.h b/include/asm-blackfin/tsc.h
new file mode 100644
index 0000000..087b27b
--- /dev/null
+++ b/include/asm-blackfin/tsc.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2005 Philippe Gerum <r...@xenomai.org>.
+ *
+ * Xenomai is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * Xenomai 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 Xenomai; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _XENO_ASM_BLACKFIN_TSC_H
+#define _XENO_ASM_BLACKFIN_TSC_H
+
+#ifndef __KERNEL__
+
+static inline unsigned long long __xn_rdtsc (void)
+{
+    union {
+       struct {
+           unsigned long l;
+           unsigned long h;
+       } s;
+       unsigned long long t;
+    } u;
+    unsigned long cy2;
+
+    __asm__ __volatile__ (     "1: %0 = CYCLES2\n"
+                               "%1 = CYCLES\n"
+                               "%2 = CYCLES2\n"
+                               "CC = %2 == %0\n"
+                               "if !cc jump 1b\n"
+                               :"=d" (u.s.h),
+                               "=d" (u.s.l),
+                               "=d" (cy2)
+                               : /*no input*/ : "cc");
+    return u.t;
+}
+
+#endif
+
+#endif /* _XENO_ASM_BLACKFIN_TSC_H */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to