]> xenbits.xensource.com Git - xen.git/commitdiff
x86: don't use .subsection when compiling with clang
authorTim Deegan <tim@xen.org>
Wed, 11 Apr 2012 12:10:33 +0000 (13:10 +0100)
committerTim Deegan <tim@xen.org>
Wed, 11 Apr 2012 12:10:33 +0000 (13:10 +0100)
LLVM's assembler doesn't support the .subsection directive, so put
the out-of-line failure path in .fixup instead.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/include/asm-x86/spinlock.h

index a31f8b725b135d9cd8b6f8566c925baa693fec51..6bc044c7acd7cc0a2cccac539510a594216905fe 100644 (file)
@@ -45,11 +45,19 @@ static always_inline int _raw_read_trylock(raw_rwlock_t *rw)
     asm volatile (
         "    lock; decl %0         \n"
         "    jns 2f                \n"
+#ifdef __clang__ /* clang's builtin assember can't do .subsection */
+        "1:  .pushsection .fixup,\"ax\"\n"
+#else
         "1:  .subsection 1         \n"
+#endif
         "2:  lock; incl %0         \n"
         "    decl %1               \n"
         "    jmp 1b                \n"
+#ifdef __clang__
+        "    .popsection           \n"
+#else
         "    .subsection 0         \n"
+#endif
         : "=m" (rw->lock), "=r" (acquired) : "1" (1) : "memory" );
 
     return acquired;