gst/gstcpu.c: Don't clobber ebx in inline assembly. gcc doesn't handle it correctly...
authorDavid Schleef <ds@schleef.org>
Mon, 26 Apr 2004 20:04:22 +0000 (20:04 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 26 Apr 2004 20:04:22 +0000 (20:04 +0000)
Original commit message from CVS:
* gst/gstcpu.c: (gst_cpuid_i386): Don't clobber ebx in inline
assembly.  gcc doesn't handle it correctly. (bug #141083)
* gst/gsttrashstack.h: same

ChangeLog
gst/gstcpu.c
gst/gsttrashstack.h

index 705a6b6..6327337 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-04-26  David Schleef  <ds@schleef.org>
+
+       * gst/gstcpu.c: (gst_cpuid_i386): Don't clobber ebx in inline
+       assembly.  gcc doesn't handle it correctly. (bug #141083)
+       * gst/gsttrashstack.h: same
+
 2004-04-25  Benjamin Otte  <otte@gnome.org>
 
        * gst/gstelement.c: (gst_element_change_state):
index 279fd28..02600b7 100644 (file)
@@ -76,7 +76,7 @@ gst_cpuid_i386 (int x, unsigned long *eax, unsigned long *ebx,
       "=o" (regs[1]),
       "=o" (regs[2]), "=o" (regs[3])
 :    "a" (x)
-:    "ebx", "ecx", "edx");
+:    "ecx", "edx");
 
   *eax = regs[0];
   *ebx = regs[1];
index 8915168..92fcf37 100644 (file)
@@ -101,6 +101,7 @@ gst_trash_stack_pop (GstTrashStack *stack)
    * inlikely that we manage to grab the wrong head->next value.
    */
   __asm__ __volatile__ (
+    "  pushl %%ebx;             \n\t"
     "  testl %%eax, %%eax;      \n\t"  /* if (head == NULL) return */
     "  jz 20f;                  \n\t"
     "10:                        \n\t"
@@ -110,12 +111,13 @@ gst_trash_stack_pop (GstTrashStack *stack)
     SMP_LOCK "cmpxchg8b %1;     \n\t"  /* if eax:edx == *stack, move ebx:ecx to *stack,
                                         * else *stack is moved into eax:edx again... */
     "  jnz 10b;                 \n\t"  /* ... and we retry */
-    "20:                        \n"
+    "20:                        \n\t"
+    "  popl %%ebx               \n"
       : "=a" (head)
       :  "m" (*stack),
          "a" (stack->head),
          "d" (stack->count)
-      :  "ecx", "ebx"
+      :  "ecx"
   );
 
   return head;