From f79889e75bd46801447e379ed9d940262d19397b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 30 Nov 2004 20:59:55 +0000 Subject: [PATCH] Now also sets the cpu_clock_speed field. Disabled debug output. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10312 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/platform/bios_ia32/cpu.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/kernel/boot/platform/bios_ia32/cpu.cpp b/src/kernel/boot/platform/bios_ia32/cpu.cpp index 4c484e31e0..96901d07a6 100644 --- a/src/kernel/boot/platform/bios_ia32/cpu.cpp +++ b/src/kernel/boot/platform/bios_ia32/cpu.cpp @@ -1,10 +1,10 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -** -** calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and -** licensed under the NewOS license. -*/ + * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + * + * calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and + * licensed under the NewOS license. + */ #include "cpu.h" @@ -20,7 +20,7 @@ #include -#define TRACE_CPU +//#define TRACE_CPU #ifdef TRACE_SMP # define TRACE(x) dprintf x #else @@ -36,7 +36,7 @@ uint32 gTimeConversionFactor; #define TIMER_CLKNUM_HZ (14318180/12) -static uint32 +static void calculate_cpu_conversion_factor() { uint32 s_low, s_high; @@ -206,7 +206,8 @@ not_so_quick_sample: dprintf("CPU at %Ld.%03Ld MHz\n", p3/expired/1000000LL, ((p3/expired)%1000000LL)/1000LL); #endif - return gTimeConversionFactor; + gKernelArgs.arch_args.system_time_cv_factor = gTimeConversionFactor; + gKernelArgs.arch_args.cpu_clock_speed = p3/expired; } @@ -244,7 +245,8 @@ cpu_init() if (check_cpu_features() != B_OK) panic("You need a Pentium or higher in order to boot!\n"); - gKernelArgs.arch_args.system_time_cv_factor = calculate_cpu_conversion_factor(); + calculate_cpu_conversion_factor(); + gKernelArgs.num_cpus = 1; // this will eventually be corrected later on }