gst/gstcpu.c: Don't clobber ebx in inline assembly. gcc doesn't handle it correctly. (bug #141083)

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
This commit is contained in:
David Schleef 2004-04-26 20:04:22 +00:00
parent a4c2564b60
commit 1234b1126b
3 changed files with 11 additions and 3 deletions

View file

@ -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):

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

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