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

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

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

---

 include/asm-sh/Makefile.am |    2 +-
 include/asm-sh/Makefile.in |    2 +-
 include/asm-sh/syscall.h   |   33 +-----------------------
 include/asm-sh/tsc.h       |   60 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 63 insertions(+), 34 deletions(-)

diff --git a/include/asm-sh/Makefile.am b/include/asm-sh/Makefile.am
index efb084b..519ce00 100644
--- a/include/asm-sh/Makefile.am
+++ b/include/asm-sh/Makefile.am
@@ -1,6 +1,6 @@
 includesubdir = $(includedir)/asm-sh
 
 includesub_HEADERS = arith.h atomic.h calibration.h features.h fptest.h \
-               hal.h syscall.h switch.h system.h wrappers.h
+               hal.h syscall.h switch.h system.h tsc.h wrappers.h
 
 SUBDIRS = bits
diff --git a/include/asm-sh/Makefile.in b/include/asm-sh/Makefile.in
index 7da9fa9..4539ffa 100644
--- a/include/asm-sh/Makefile.in
+++ b/include/asm-sh/Makefile.in
@@ -283,7 +283,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 includesubdir = $(includedir)/asm-sh
 includesub_HEADERS = arith.h atomic.h calibration.h features.h fptest.h \
-               hal.h syscall.h switch.h system.h wrappers.h
+               hal.h syscall.h switch.h system.h tsc.h wrappers.h
 
 SUBDIRS = bits
 all: all-recursive
diff --git a/include/asm-sh/syscall.h b/include/asm-sh/syscall.h
index 8c1c5d5..8b187c1 100644
--- a/include/asm-sh/syscall.h
+++ b/include/asm-sh/syscall.h
@@ -21,6 +21,7 @@
 #define _XENO_ASM_SH_SYSCALL_H
 
 #include <asm-generic/xenomai/syscall.h>
+#include <asm/xenomai/tsc.h>
 
 #define __xn_mux_shifted_id(id)             (id << 24)
 #define __xn_mux_code(shifted_id,op) (shifted_id|((op << 16) & 
0xff0000)|(__xn_sys_mux & 0xffff))
@@ -73,7 +74,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #else /* !__KERNEL__ */
 
 #include <errno.h>
-#include <endian.h>
 #include <asm/xenomai/atomic.h>
 
 /*
@@ -180,37 +180,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)
 
-struct xnarch_tsc_area {
-       struct {
-#if __BYTE_ORDER == __BIG_ENDIAN
-               unsigned long high;
-               unsigned long low;
-#else /* __LITTLE_ENDIAN */
-               unsigned long low;
-               unsigned long high;
-#endif /* __LITTLE_ENDIAN */
-       } tsc;
-       unsigned long counter_pa;
-};
-
-extern volatile struct xnarch_tsc_area *xeno_sh_tsc;
-
-extern volatile unsigned long *xeno_sh_tcnt;
-
-static inline unsigned long long __xn_rdtsc(void)
-{
-       unsigned long long tsc;
-       unsigned long low;
-
-       tsc = xeno_sh_tsc->tsc.high;
-       low = *xeno_sh_tcnt ^ 0xffffffffUL;
-       if (low < xeno_sh_tsc->tsc.low)
-               tsc++;
-       tsc = (tsc << 32)|low;
-
-       return tsc;
-}
-
 #endif /* __KERNEL__ */
 
 #endif /* !_XENO_ASM_SH_SYSCALL_H */
diff --git a/include/asm-sh/tsc.h b/include/asm-sh/tsc.h
new file mode 100644
index 0000000..37a63a8
--- /dev/null
+++ b/include/asm-sh/tsc.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011 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_SH_TSC_H
+#define _XENO_ASM_SH_TSC_H
+
+#ifndef __KERNEL__
+
+#include <endian.h>
+
+struct xnarch_tsc_area {
+       struct {
+#if __BYTE_ORDER == __BIG_ENDIAN
+               unsigned long high;
+               unsigned long low;
+#else /* __LITTLE_ENDIAN */
+               unsigned long low;
+               unsigned long high;
+#endif /* __LITTLE_ENDIAN */
+       } tsc;
+       unsigned long counter_pa;
+};
+
+extern volatile struct xnarch_tsc_area *xeno_sh_tsc;
+
+extern volatile unsigned long *xeno_sh_tcnt;
+
+static inline unsigned long long __xn_rdtsc(void)
+{
+       unsigned long long tsc;
+       unsigned long low;
+
+       tsc = xeno_sh_tsc->tsc.high;
+       low = *xeno_sh_tcnt ^ 0xffffffffUL;
+       if (low < xeno_sh_tsc->tsc.low)
+               tsc++;
+       tsc = (tsc << 32)|low;
+
+       return tsc;
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _XENO_ASM_SH_TSC_H */


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

Reply via email to