lkml.org 
[lkml]   [2013]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 1/1] tools/power x86_energy_perf_policy: fix cpuid for i686
Date
On Thursday 14 February 2013 14:35:58 Benson Leung wrote:
> + asm volatile ("mov %%ebx, %%edi;" /* save ebx (for PIC) */
> + "cpuid;"
> + "mov %%ebx, %%esi;" /* pass to caller */
> + "mov %%edi, %%ebx;" /* restore ebx */
> + :"+a" (_eax), "=S" (_ebx), "=c" (_ecx), "=d" (_edx)
> + : /* inputs: eax is handled above */
> + :"edi" /* clobbers: we hit edi directly */);

i've written a better version since:
https://github.com/linux-test-project/ltp/blob/master/include/ltp_cpuid.h
-mike
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-02-18 07:21    [W:0.075 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site