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

[Xen-devel] [PATCH 5 of 7 v2] x86: don't use .subsection when compiling with clang


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Tim Deegan <tim@xxxxxxx>
  • Date: Thu, 5 Apr 2012 16:51:54 +0100
  • Delivery-date: Thu, 05 Apr 2012 16:09:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1333640955 -3600
# Node ID 0908535327a5b01e49b69cd96db464be21ff3ee6
# Parent  a93381049790e4f8a02f2322851f78175c254c5b
x86: don't use .subsection when compiling with clang

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@xxxxxxx>

diff -r a93381049790 -r 0908535327a5 xen/include/asm-x86/spinlock.h
--- a/xen/include/asm-x86/spinlock.h    Thu Apr 05 16:49:15 2012 +0100
+++ b/xen/include/asm-x86/spinlock.h    Thu Apr 05 16:49:15 2012 +0100
@@ -45,11 +45,19 @@ static always_inline int _raw_read_trylo
     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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.