Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/include Support thumb1 indirectly and thumb2 di...



details:   https://anonhg.NetBSD.org/src/rev/f9cb1ee593a3
branches:  trunk
changeset: 789386:f9cb1ee593a3
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Aug 18 04:31:08 2013 +0000

description:
Support thumb1 indirectly and thumb2 directly

diffstat:

 sys/arch/arm/include/lock.h |  29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diffs (88 lines):

diff -r 64dae95dc328 -r f9cb1ee593a3 sys/arch/arm/include/lock.h
--- a/sys/arch/arm/include/lock.h       Sat Aug 17 22:21:02 2013 +0000
+++ b/sys/arch/arm/include/lock.h       Sun Aug 18 04:31:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.24 2013/01/28 06:17:05 matt Exp $   */
+/*     $NetBSD: lock.h,v 1.25 2013/08/18 04:31:08 matt Exp $   */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -84,6 +84,9 @@
                        "1:\t"
                        "ldrexb\t%[__rv], [%[__ptr]]"                   "\n\t"
                        "cmp\t%[__rv],%[__val]"                         "\n\t"
+#ifdef __thumb__
+                       "itt\tne"                                       "\n\t"
+#endif
                        "strexbne\t%[__tmp], %[__val], [%[__ptr]]"      "\n\t"
                        "cmpne\t%[__tmp], #0"                           "\n\t"
                        "bne\t1b"                                       "\n\t"
@@ -99,6 +102,9 @@
                        "1:\t"
                        "ldrex\t%[__rv], [%[__ptr]]"                    "\n\t"
                        "cmp\t%[__rv],%[__val]"                         "\n\t"
+#ifdef __thumb__
+                       "itt\tne"                                       "\n\t"
+#endif
                        "strexne\t%[__tmp], %[__val], [%[__ptr]]"       "\n\t"
                        "cmpne\t%[__tmp], #0"                           "\n\t"
                        "bne\t1b"                                       "\n\t"
@@ -136,11 +142,14 @@
 #ifdef _ARM_ARCH_6
                "ldrex\t%[__rv], [%[__ptr]]"                    "\n\t"
                "cmp\t%[__rv],%[__val]"                         "\n\t"
+#ifdef __thumb__
+               "it\tne"                                        "\n\t"
+#endif
                "strexne\t%[__tmp], %[__val], [%[__ptr]]"       "\n\t"
 #else
                "swp\t%[__rv], %[__val], [%[__ptr]]"            "\n\t"
+               "mov\t%[__tmp], #0"                             "\n\t"
                "cmp\t%[__rv],%[__val]"                         "\n\t"
-               "movs\t%[__tmp], #0"                            "\n\t"
 #endif
                "cmpne\t%[__tmp], #0"                           "\n\t"
                "bne\t1b"                                       "\n\t"
@@ -157,7 +166,7 @@
 }
 #endif /* _KERNEL */
 
-static __inline void __attribute__((__unused__))
+static __inline void __unused
 __cpu_simple_lock_init(__cpu_simple_lock_t *alp)
 {
 
@@ -167,22 +176,30 @@
 #endif
 }
 
-static __inline void __attribute__((__unused__))
+#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
+static __inline void __unused
 __cpu_simple_lock(__cpu_simple_lock_t *alp)
 {
 
        while (__swp(__SIMPLELOCK_LOCKED, alp) != __SIMPLELOCK_UNLOCKED)
                continue;
 }
+#else
+void __cpu_simple_lock(__cpu_simple_lock_t *);
+#endif
 
-static __inline int __attribute__((__unused__))
+#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
+static __inline int __unused
 __cpu_simple_lock_try(__cpu_simple_lock_t *alp)
 {
 
        return (__swp(__SIMPLELOCK_LOCKED, alp) == __SIMPLELOCK_UNLOCKED);
 }
+#else
+int __cpu_simple_lock_try(__cpu_simple_lock_t *);
+#endif
 
-static __inline void __attribute__((__unused__))
+static __inline void __unused
 __cpu_simple_unlock(__cpu_simple_lock_t *alp)
 {
 



Home | Main Index | Thread Index | Old Index