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

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

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

---

 include/asm-x86/Makefile.am |    1 +
 include/asm-x86/Makefile.in |    1 +
 include/asm-x86/syscall.h   |   17 +----------------
 include/asm-x86/tsc.h       |   43 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 16 deletions(-)

diff --git a/include/asm-x86/Makefile.am b/include/asm-x86/Makefile.am
index dba3b68..2533c81 100644
--- a/include/asm-x86/Makefile.am
+++ b/include/asm-x86/Makefile.am
@@ -20,6 +20,7 @@ includesub_HEADERS =  \
        switch.h        \
        syscall.h       \
        system.h        \
+       tsc.h           \
        wrappers_32.h   \
        wrappers_64.h   \
        wrappers.h
diff --git a/include/asm-x86/Makefile.in b/include/asm-x86/Makefile.in
index 7b8865c..520e476 100644
--- a/include/asm-x86/Makefile.in
+++ b/include/asm-x86/Makefile.in
@@ -302,6 +302,7 @@ includesub_HEADERS = \
        switch.h        \
        syscall.h       \
        system.h        \
+       tsc.h           \
        wrappers_32.h   \
        wrappers_64.h   \
        wrappers.h
diff --git a/include/asm-x86/syscall.h b/include/asm-x86/syscall.h
index 3beb1ca..7fe0d93 100644
--- a/include/asm-x86/syscall.h
+++ b/include/asm-x86/syscall.h
@@ -21,6 +21,7 @@
 #define _XENO_ASM_X86_SYSCALL_H
 
 #include <asm-generic/xenomai/syscall.h>
+#include <asm/xenomai/tsc.h>
 
 #define __xn_mux_code(shifted_id,op) ((op << 24)|shifted_id|(__xn_sys_mux & 
0x7fff))
 #define __xn_mux_shifted_id(id) ((id << 16) & 0xff0000)
@@ -312,22 +313,6 @@ static inline void __xn_get_ebp(void **dest)
 #define XENOMAI_SKINCALL4(id,op,a1,a2,a3,a4)   
XENOMAI_SKIN_MUX(4,id,op,a1,a2,a3,a4)
 #define XENOMAI_SKINCALL5(id,op,a1,a2,a3,a4,a5)        
XENOMAI_SKIN_MUX(5,id,op,a1,a2,a3,a4,a5)
 
-static inline unsigned long long __xn_rdtsc(void)
-{
-#ifdef __i386__
-       unsigned long long t;
-
-       asm volatile ("rdtsc" : "=A" (t));
-       return t;
-
-#else /* x86_64 */
-       unsigned int __a,__d;
-
-       asm volatile ("rdtsc" : "=a" (__a), "=d" (__d));
-       return ((unsigned long)__a) | (((unsigned long)__d) << 32);
-#endif /* x86_64 */
-}
-
 #endif /* !__KERNEL__ */
 
 #endif /* !_XENO_ASM_X86_SYSCALL_H */
diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h
new file mode 100644
index 0000000..74717ad
--- /dev/null
+++ b/include/asm-x86/tsc.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2001,2002,2003,2007 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_X86_TSC_H
+#define _XENO_ASM_X86_TSC_H
+
+#ifndef __KERNEL__
+
+static inline unsigned long long __xn_rdtsc(void)
+{
+#ifdef __i386__
+       unsigned long long t;
+
+       asm volatile ("rdtsc" : "=A" (t));
+       return t;
+
+#else /* x86_64 */
+       unsigned int __a,__d;
+
+       asm volatile ("rdtsc" : "=a" (__a), "=d" (__d));
+       return ((unsigned long)__a) | (((unsigned long)__d) << 32);
+#endif /* x86_64 */
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _XENO_ASM_X86_TSC_H */


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

Reply via email to