public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] fhandler_proc.cc(format_proc_cpuinfo): round cpu MHz
@ 2019-10-07 19:55 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-10-07 19:55 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=70e834ea7c970dd9bf98167e0cf7d4d7c643a225

commit 70e834ea7c970dd9bf98167e0cf7d4d7c643a225
Author: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Date:   Mon Oct 7 10:23:01 2019 -0600

    fhandler_proc.cc(format_proc_cpuinfo): round cpu MHz
    
    Round cpu MHz to correct Windows and match Linux cpuinfo.

Diff:
---
 winsup/cygwin/fhandler_proc.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index c94cde9..86c1f62 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -695,6 +695,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
 
       RtlQueryRegistryValues (RTL_REGISTRY_ABSOLUTE, cpu_key, tab,
 			      NULL, NULL);
+      cpu_mhz = ((cpu_mhz - 1) / 10 + 1) * 10;	/* round up to multiple of 10 */
       bufptr += __small_sprintf (bufptr, "processor\t: %d\n", cpu_number);
       uint32_t maxf, vendor_id[4], unused;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-07 19:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 19:55 [newlib-cygwin] fhandler_proc.cc(format_proc_cpuinfo): round cpu MHz Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).