diff --git a/gst/gstatomic_impl.h b/gst/gstatomic_impl.h index d06cfd1194..3c33cb1ac9 100644 --- a/gst/gstatomic_impl.h +++ b/gst/gstatomic_impl.h @@ -249,32 +249,34 @@ GST_INLINE_FUNC void gst_atomic_int_add (GstAtomicInt *aint, gint val) { volatile int increment, *ptr; - char lock; + int lock = 1; + int ignore = 0; ptr = &(aint->counter); #if __GNUC__ > 3 || (__GNUC__ >=3 && __GNUC_MINOR__ >= 2) __asm__ __volatile__("1: ldstub [%[ptr] + 3], %[lock]\n" - "\torcc %[lock], 0, %%g0\n" + "\torcc %[lock], 0, %[ignore]\n" "\tbne 1b\n" /* go back until we have the lock */ "\tld [%[ptr]], %[inc]\n" "\tsra %[inc], 8, %[inc]\n" "\tadd %[inc], %[val], %[inc]\n" "\tsll %[inc], 8, %[lock]\n" "\tst %[lock],[%[ptr]]\n" /* Release the lock */ - : [inc] "=&r" (increment), [lock] "=r" (lock) + : [inc] "=&r" (increment), [lock] "=r" (lock), + [ignore] "=&r" (ignore) : "0" (increment), [ptr] "r" (ptr), [val] "r" (val) ); #else - __asm__ __volatile__("1: ldstub [%3 + 3], %1\n" - "\torcc %1, 0, %%g0\n" + __asm__ __volatile__("1: ldstub [%4 + 3], %1\n" + "\torcc %1, 0, %2\n" "\tbne 1b\n" /* go back until we have the lock */ - "\tld [%3], %0\n" + "\tld [%4], %0\n" "\tsra %0, 8, %0\n" - "\tadd %0, %4, %0\n" + "\tadd %0, %5, %0\n" "\tsll %0, 8, %1\n" - "\tst %1,[%3]\n" /* Release the lock */ - : "=&r" (increment), "=r" (lock) + "\tst %1,[%4]\n" /* Release the lock */ + : "=&r" (increment), "=r" (lock), "=&r" (ignore) : "0" (increment), "r" (ptr), "r" (val) ); #endif @@ -290,32 +292,34 @@ GST_INLINE_FUNC gboolean gst_atomic_int_dec_and_test (GstAtomicInt *aint) { volatile int increment, *ptr; - char lock; + int lock = 1; + int ignore = 0; ptr = &aint->counter; -#if __GNUC__ > 3 || (__GNUC__ >=3 && __GNUC_MINOR__ >= 2) +#if 0 __GNUC__ > 3 || (__GNUC__ >=3 && __GNUC_MINOR__ >= 2) __asm__ __volatile__("1: ldstub [%[ptr] + 3], %[lock]\n" - "\torcc %[lock], 0, %%g0\n" + "\torcc %[lock], 0, %[ignore]\n" "\tbne 1b\n" /* go back until we have the lock */ "\tld [%[ptr]], %[inc]\n" "\tsra %[inc], 8, %[inc]\n" "\tsub %[inc], 1, %[inc]\n" "\tsll %[inc], 8, %[lock]\n" "\tst %[lock],[%[ptr]]\n" /* Release the lock */ - : [inc] "=&r" (increment), [lock] "=r" (lock) + : [inc] "=&r" (increment), [lock] "=r" (lock), + [ignore] "=&r" (ignore) : "0" (increment), [ptr] "r" (ptr) ); #else - __asm__ __volatile__("1: ldstub [%3 + 3], %1\n" - "\torcc %1, 0, %%g0\n" + __asm__ __volatile__("1: ldstub [%4 + 3], %1\n" + "\torcc %1, 0, %2\n" "\tbne 1b\n" /* go back until we have the lock */ - "\tld [%3], %0\n" + "\tld [%4], %0\n" "\tsra %0, 8, %0\n" "\tsub %0, 1, %0\n" "\tsll %0, 8, %1\n" - "\tst %1,[%3]\n" /* Release the lock */ - : "=&r" (increment), "=r" (lock) + "\tst %1,[%4]\n" /* Release the lock */ + : "=&r" (increment), "=r" (lock), "=&r" (ignore) : "0" (increment), "r" (ptr) ); #endif