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>
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;