mirror of https://github.com/mirror/busybox.git
powertop: code shrink
function old new delta print_intel_cstates 477 475 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>master
parent
23da5c4b71
commit
b20b3790b4
|
@ -498,24 +498,11 @@ static NOINLINE int process_timer_stats(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
/*
|
static void cpuid_eax_ecx_edx(unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
|
||||||
* Get information about CPU using CPUID opcode.
|
|
||||||
*/
|
|
||||||
static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
|
|
||||||
unsigned int *edx)
|
|
||||||
{
|
{
|
||||||
/* EAX value specifies what information to return */
|
asm ("cpuid"
|
||||||
asm (
|
: "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
|
||||||
" cpuid\n"
|
: "0" (*eax), "2" (*ecx), "3" (*edx)
|
||||||
: "=a"(*eax), /* Output */
|
|
||||||
"=b"(*ebx),
|
|
||||||
"=c"(*ecx),
|
|
||||||
"=d"(*edx)
|
|
||||||
: "0"(*eax), /* Input */
|
|
||||||
"1"(*ebx),
|
|
||||||
"2"(*ecx),
|
|
||||||
"3"(*edx)
|
|
||||||
/* No clobbered registers */
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -592,8 +579,8 @@ static NOINLINE void print_intel_cstates(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
eax = 5;
|
eax = 5;
|
||||||
ebx = ecx = edx = 0;
|
ecx = edx = 0; /* paranoia, should not be needed */
|
||||||
cpuid(&eax, &ebx, &ecx, &edx);
|
cpuid_eax_ecx_edx(&eax, /*unused:*/&ebx, &ecx, &edx);
|
||||||
if (!edx || !(ecx & 1))
|
if (!edx || !(ecx & 1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue