Force the "ebx" argument to be mapped to a register (not necessarily EBX).

Fixes crash on x86 under OS X.
Thanks to kiesel for the fix and to shuffle2 for remembering the problem.
This commit is contained in:
Maarten ter Huurne
2011-12-12 00:43:23 +01:00
parent 344ca5d360
commit 7423c74deb

View File

@ -48,7 +48,7 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
"movl %%ebx,%1;" "movl %%ebx,%1;"
"mov %%rdi,%%rbx;" "mov %%rdi,%%rbx;"
: "=a" (*eax), : "=a" (*eax),
"=g" (*ebx), "=r" (*ebx),
"=c" (*ecx), "=c" (*ecx),
"=d" (*edx) "=d" (*edx)
: "a" (*eax) : "a" (*eax)
@ -61,7 +61,7 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
"movl %%ebx,%1;" "movl %%ebx,%1;"
"movl %%edi,%%ebx;" "movl %%edi,%%ebx;"
: "=a" (*eax), : "=a" (*eax),
"=g" (*ebx), "=r" (*ebx),
"=c" (*ecx), "=c" (*ecx),
"=d" (*edx) "=d" (*edx)
: "a" (*eax) : "a" (*eax)