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
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the MIT License.
|
||||||
**
|
*
|
||||||
** calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and
|
* calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and
|
||||||
** licensed under the NewOS license.
|
* licensed under the NewOS license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
#define TRACE_CPU
|
//#define TRACE_CPU
|
||||||
#ifdef TRACE_SMP
|
#ifdef TRACE_SMP
|
||||||
# define TRACE(x) dprintf x
|
# define TRACE(x) dprintf x
|
||||||
#else
|
#else
|
||||||
@@ -36,7 +36,7 @@ uint32 gTimeConversionFactor;
|
|||||||
#define TIMER_CLKNUM_HZ (14318180/12)
|
#define TIMER_CLKNUM_HZ (14318180/12)
|
||||||
|
|
||||||
|
|
||||||
static uint32
|
static void
|
||||||
calculate_cpu_conversion_factor()
|
calculate_cpu_conversion_factor()
|
||||||
{
|
{
|
||||||
uint32 s_low, s_high;
|
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);
|
dprintf("CPU at %Ld.%03Ld MHz\n", p3/expired/1000000LL, ((p3/expired)%1000000LL)/1000LL);
|
||||||
#endif
|
#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)
|
if (check_cpu_features() != B_OK)
|
||||||
panic("You need a Pentium or higher in order to boot!\n");
|
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;
|
gKernelArgs.num_cpus = 1;
|
||||||
// this will eventually be corrected later on
|
// this will eventually be corrected later on
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user