Source-Changes-HG archive

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

[src/trunk]: src/lib/libpthread/arch/arm Use the thumb1 versions of sev/wfe f...



details:   https://anonhg.NetBSD.org/src/rev/d7cfad5dab49
branches:  trunk
changeset: 789347:d7cfad5dab49
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Aug 15 22:37:29 2013 +0000

description:
Use the thumb1 versions of sev/wfe for thumb && armv6+.
if using armv5t don't do anything for thumb.

diffstat:

 lib/libpthread/arch/arm/pthread_md.h |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 426576d7afcd -r d7cfad5dab49 lib/libpthread/arch/arm/pthread_md.h
--- a/lib/libpthread/arch/arm/pthread_md.h      Thu Aug 15 22:34:59 2013 +0000
+++ b/lib/libpthread/arch/arm/pthread_md.h      Thu Aug 15 22:37:29 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_md.h,v 1.8 2012/09/19 07:57:14 matt Exp $      */
+/*     $NetBSD: pthread_md.h,v 1.9 2013/08/15 22:37:29 matt Exp $      */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -49,8 +49,16 @@
        return (ret);
 }
 
+#if defined(__thumb__) && defined(_ARM_ARCH_6)
+#define pthread__smt_pause()   __asm __volatile(".inst.n 0xbf20") /* wfe */
+#define pthread__smt_wake()    __asm __volatile(".inst.n 0xbf40") /* sev */
+#elif !defined(__thumb__)
 #define pthread__smt_pause()   __asm __volatile(".inst 0xe320f002") /* wfe */
 #define pthread__smt_wake()    __asm __volatile(".inst 0xe320f004") /* sev */
+#else
+#define pthread__smt_pause()
+#define pthread__smt_wake()
+#endif
 
 #define        pthread__uc_sp(ucp)     ((ucp)->uc_mcontext.__gregs[_REG_SP])
 



Home | Main Index | Thread Index | Old Index