Re: [PATCH v3 1/1] tools/power x86_energy_perf_policy: fix cpuid for i686

From: Mike Frysinger
Date: Mon Feb 18 2013 - 00:17:20 EST


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

Attachment: signature.asc
Description: This is a digitally signed message part.