Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

Inline asm fix for padlock support

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


ismail at pardus

Jan 20, 2008, 3:04 PM

Post #1 of 2 (1054 views)
Permalink
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 [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


marcus.brinkmann at ruhr-uni-bochum

Jan 21, 2008, 9:02 AM

Post #2 of 2 (975 views)
Permalink
Re: Inline asm fix for padlock support [In reply to]

At Mon, 21 Jan 2008 01:04:00 +0200,
Ismail Dönmez <ismail [at] pardus> 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 [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.