on 09/02/2012 17:07 Marc-André Moreau said the following:
> Could we have a patch for this?

It seems that the following straight-forward approach works for me on x86_64.

--- client/X11/xfreerdp.c.orig  2012-02-09 17:07:15.567937920 +0200
+++ client/X11/xfreerdp.c       2012-02-09 17:08:23.740937838 +0200
@@ -581,10 +581,19 @@ void cpuid(unsigned info, unsigned *eax,
 #if defined(__i386__) || defined(__x86_64__)
        *eax = info;
        __asm volatile
+#if defined(__i386__)
                ("mov %%ebx, %%edi;" /* 32bit PIC: don't clobber ebx */
+#else
+               ("mov %%rbx, %%rdi;" /* 32bit PIC: don't clobber ebx */
+#endif
                 "cpuid;"
+#if defined(__i386__)
                 "mov %%ebx, %%esi;"
                 "mov %%edi, %%ebx;"
+#else
+                "mov %%rbx, %%rsi;"
+                "mov %%rdi, %%rbx;"
+#endif
                 :"+a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx)
                 : :"edi");
 #endif

> On Thu, Feb 9, 2012 at 10:00 AM, Andriy Gapon <a...@icyb.net.ua
> <mailto:a...@icyb.net.ua>> wrote:
> 
> 
>     The code in question:
> 
>     void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx,
>     unsigned *edx)
>     {
>     #ifdef __GNUC__
>     #if defined(__i386__) || defined(__x86_64__)
>            *eax = info;
>            __asm volatile
>                    ("mov %%ebx, %%edi;" /* 32bit PIC: don't clobber ebx */
>                     "cpuid;"
>                     "mov %%ebx, %%esi;"
>                     "mov %%edi, %%ebx;"
>                     :"+a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx)
>                     : :"edi");
>     #endif
>     #endif
>     }
> 
>     On 64-bit systems upper half of %rbx gets clobbered, because only %ebx is
>     preserved via %edi.

-- 
Andriy Gapon

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to