Mailing List Archive

Inline asm fix for padlock support
Hi,

Jakub Jelinek of gcc and glibc fame fixed inline asm in padlock support code.
His patch and explanation is available at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34725#c4 .

I tested the patch and it works.

Regards,
ismail

--
Never learn by your mistakes, if you do you may never dare to try again.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: Inline asm fix for padlock support [ In reply to ]
At Mon, 21 Jan 2008 01:04:00 +0200,
Ismail Dönmez <ismail@pardus.org.tr> wrote:
> Jakub Jelinek of gcc and glibc fame fixed inline asm in padlock support code.
> His patch and explanation is available at
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34725#c4 .
>
> I tested the patch and it works.

Yes, but it leaves a superfluous %0 which is not used. So, I put in a
slightly simpler fix:

asm volatile
("pushl %%ebx\n\t" /* Save GOT register. */
"xorl %%eax, %%eax\n\t" /* 0 -> EAX. */
"cpuid\n\t" /* Get vendor ID. */
"movl %%ebx, (%0)\n\t" /* EBX,EDX,ECX -> VENDOR_ID. */
"movl %%edx, 4(%0)\n\t"
"movl %%ecx, 8(%0)\n\t"
"popl %%ebx\n"
:
: "S" (&vendor_id[0])
: "%eax", "%ecx", "%edx", "cc"
);

Thanks,
Marcus


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel