x86_32: Fix _raw_read_trylock() build on some gcc versions.
authorKeir Fraser <keir@xen.org>
Sun, 27 Mar 2011 08:30:35 +0000 (09:30 +0100)
committerKeir Fraser <keir@xen.org>
Sun, 27 Mar 2011 08:30:35 +0000 (09:30 +0100)
Was broken by 23099:612171ff82ea.

A bool_t is a single byte, and needs a 'q' register constraint. Avoid
the whole issue by changing the variable to an int, and explicitly
specify the operand suffix as 'l' for good measure.

Signed-off-by: Keir Fraser <keir@xen.org>
xen/include/asm-x86/spinlock.h

index 5f9fabd3459c403727479e21390b2a340a8c3e80..a31f8b725b135d9cd8b6f8566c925baa693fec51 100644 (file)
@@ -40,14 +40,14 @@ typedef struct {
 
 static always_inline int _raw_read_trylock(raw_rwlock_t *rw)
 {
-    bool_t acquired;
+    int acquired;
 
     asm volatile (
         "    lock; decl %0         \n"
         "    jns 2f                \n"
         "1:  .subsection 1         \n"
         "2:  lock; incl %0         \n"
-        "    dec %1                \n"
+        "    decl %1               \n"
         "    jmp 1b                \n"
         "    .subsection 0         \n"
         : "=m" (rw->lock), "=r" (acquired) : "1" (1) : "memory" );