added OS.h for completeness

last commit was wrong as easily noticed by Jack Burton :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13636 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2005-07-11 15:44:37 +00:00
parent 3a19646fe4
commit 74ef4bcdc4

View File

@ -7,6 +7,8 @@
* It's used by Pulse, AboutHaiku, and sysinfo. * It's used by Pulse, AboutHaiku, and sysinfo.
*/ */
#include <OS.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -210,13 +212,14 @@ get_rounded_cpu_speed(void)
{ {
system_info sys_info; system_info sys_info;
int target = sys_info.cpu_clock_speed / 1000000; int target, frac, delta;
int frac = target % 100;
int delta = -frac;
int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 }; int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 };
uint x; uint x;
get_system_info(&sys_info); get_system_info(&sys_info);
target = sys_info.cpu_clock_speed / 1000000;
frac = target % 100;
delta = -frac;
for (x = 0; x < sizeof(freqs) / sizeof(freqs[0]); x++) { for (x = 0; x < sizeof(freqs) / sizeof(freqs[0]); x++) {
int ndelta = freqs[x] - frac; int ndelta = freqs[x] - frac;