aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2024-07-13 11:46:15 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2024-07-13 11:46:15 +0200
commitb20b3790b428aab75449995d0866bad15879bc00 (patch)
tree40c06b9c28a29f7f8b475180b25f66368ba01c57
parent23da5c4b716b92524240c6f81c2e2474c1825cfc (diff)
downloadbusybox-w32-b20b3790b428aab75449995d0866bad15879bc00.tar.gz
busybox-w32-b20b3790b428aab75449995d0866bad15879bc00.tar.bz2
busybox-w32-b20b3790b428aab75449995d0866bad15879bc00.zip
powertop: code shrink
function old new delta print_intel_cstates 477 475 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/powertop.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/procps/powertop.c b/procps/powertop.c
index 147b7a3ef..6fe892540 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -498,24 +498,11 @@ static NOINLINE int process_timer_stats(void)
498} 498}
499 499
500#ifdef __i386__ 500#ifdef __i386__
501/* 501static void cpuid_eax_ecx_edx(unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
502 * Get information about CPU using CPUID opcode.
503 */
504static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
505 unsigned int *edx)
506{ 502{
507 /* EAX value specifies what information to return */ 503 asm ("cpuid"
508 asm ( 504 : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
509 " cpuid\n" 505 : "0" (*eax), "2" (*ecx), "3" (*edx)
510 : "=a"(*eax), /* Output */
511 "=b"(*ebx),
512 "=c"(*ecx),
513 "=d"(*edx)
514 : "0"(*eax), /* Input */
515 "1"(*ebx),
516 "2"(*ecx),
517 "3"(*edx)
518 /* No clobbered registers */
519 ); 506 );
520} 507}
521#endif 508#endif
@@ -592,8 +579,8 @@ static NOINLINE void print_intel_cstates(void)
592 return; 579 return;
593 580
594 eax = 5; 581 eax = 5;
595 ebx = ecx = edx = 0; 582 ecx = edx = 0; /* paranoia, should not be needed */
596 cpuid(&eax, &ebx, &ecx, &edx); 583 cpuid_eax_ecx_edx(&eax, /*unused:*/&ebx, &ecx, &edx);
597 if (!edx || !(ecx & 1)) 584 if (!edx || !(ecx & 1))
598 return; 585 return;
599 586