From 74ef4bcdc4ed9c7d2db760c757508582fe27db75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 11 Jul 2005 15:44:37 +0000 Subject: [PATCH] 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 --- headers/private/shared/cpu_type.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/headers/private/shared/cpu_type.h b/headers/private/shared/cpu_type.h index 5158819f11..d154ad95fc 100644 --- a/headers/private/shared/cpu_type.h +++ b/headers/private/shared/cpu_type.h @@ -7,6 +7,8 @@ * It's used by Pulse, AboutHaiku, and sysinfo. */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -210,13 +212,14 @@ get_rounded_cpu_speed(void) { system_info sys_info; - int target = sys_info.cpu_clock_speed / 1000000; - int frac = target % 100; - int delta = -frac; + int target, frac, delta; int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 }; uint x; 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++) { int ndelta = freqs[x] - frac;