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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Apr 15 18:45:55 2012 +0200

hal/arm: support new type of tsc (spear tsc)

---

 include/asm-arm/bits/bind.h   |   23 ++++++++++++-----------
 include/asm-arm/bits/shadow.h |   12 ++++++++++++
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/include/asm-arm/bits/bind.h b/include/asm-arm/bits/bind.h
index 59c4534..bf9671a 100644
--- a/include/asm-arm/bits/bind.h
+++ b/include/asm-arm/bits/bind.h
@@ -45,11 +45,8 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
 
        switch(__xn_tscinfo.kinfo.type) {
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_KUSER
-       case __XN_TSC_TYPE_FREERUNNING:
-       case __XN_TSC_TYPE_FREERUNNING_COUNTDOWN:
-       case __XN_TSC_TYPE_FREERUNNING_FAST_WRAP:
-       case __XN_TSC_TYPE_DECREMENTER:
-               __xn_tscinfo.kuser_tsc_get = 
+       default:
+               __xn_tscinfo.kuser_tsc_get =
                        (rdtsc_t *)(0xffff1004 -
                                    ((*(unsigned *)(0xffff0ffc) + 3) << 5));
                goto domap;
@@ -69,22 +66,26 @@ static inline void xeno_arm_features_check(struct 
xnfeatinfo *finfo)
 #endif /* __XN_TSC_TYPE_FREERUNNING_FAST_WRAP */
                goto domap;
 
+       default:
+               fprintf(stderr,
+                       "Xenomai: kernel/user tsc emulation mismatch.\n");
+               exit(EXIT_FAILURE);
+               break;
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_DECREMENTER
        case __XN_TSC_TYPE_DECREMENTER:
                goto domap;
 
+       default:
+               fprintf(stderr,
+                       "Xenomai: kernel/user tsc emulation mismatch.\n");
+               exit(EXIT_FAILURE);
+               break;
 #endif /* CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_DECREMENTER */
        case __XN_TSC_TYPE_NONE:
          error:
                fprintf(stderr, "Xenomai: Your board/configuration does not"
                        " allow tsc emulation in user-space: %d\n", err);
                exit(EXIT_FAILURE);
-               break;
-
-       default:
-               fprintf(stderr,
-                       "Xenomai: kernel/user tsc emulation mismatch.\n");
-               exit(EXIT_FAILURE);
        }
 
   domap:
diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index 9ea730c..86b6aaa 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -162,6 +162,18 @@ static inline int xnarch_local_syscall(struct pt_regs 
*regs)
                        info.tsc = RTHAL_TSC_INFO(&ipipe_info).u.fr.tsc;
                        break;
 #endif /* IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN */
+#ifdef IPIPE_TSC_TYPE_FREERUNNING_TWICE
+               case IPIPE_TSC_TYPE_FREERUNNING_TWICE:
+                       /*
+                        * Requires kuser, not backward compatible
+                        * with old xenomai versions
+                        */
+                       info.type = __XN_TSC_TYPE_KUSER,
+                       info.counter = RTHAL_TSC_INFO(&ipipe_info).u.fr.counter;
+                       info.mask = RTHAL_TSC_INFO(&ipipe_info).u.fr.mask;
+                       info.tsc = RTHAL_TSC_INFO(&ipipe_info).u.fr.tsc;
+                       break;
+#endif /* IPIPE_TSC_TYPE_FREERUNNING_TWICE */
                case IPIPE_TSC_TYPE_NONE:
                        return -ENOSYS;
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to