xref: /haiku/src/system/kernel/arch/m68k/arch_system_info.cpp (revision 0d452c8f34013b611a54c746a71c05e28796eae2)
1 /*
2  * Copyright 2007, Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  * 		François Revol <revol@free.fr>
7  *
8  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
9  * All rights reserved. Distributed under the terms of the MIT License.
10  */
11 
12 #include <OS.h>
13 
14 #include <arch_cpu.h>
15 #include <arch_platform.h>
16 #include <arch/system_info.h>
17 #include <boot/kernel_args.h>
18 
19 
20 static uint64 sCPUClockFrequency;
21 static uint64 sBusClockFrequency;
22 static enum cpu_types sCPUType;
23 static uint16 sCPURevision;
24 
25 status_t
26 arch_get_system_info(system_info *info, size_t size)
27 {
28 	info->cpu_type = sCPUType;
29 	info->cpu_revision = sCPURevision;
30 
31 	info->cpu_clock_speed = sCPUClockFrequency;
32 	info->bus_clock_speed = sBusClockFrequency;
33 
34 	info->platform_type = M68KPlatform::Default()->PlatformType();
35 
36 	return B_OK;
37 }
38 
39 
40 status_t
41 arch_system_info_init(struct kernel_args *args)
42 {
43 	int i;
44 
45 	sCPUClockFrequency = args->arch_args.cpu_frequency;
46 	sBusClockFrequency = args->arch_args.bus_frequency;
47 
48 	sCPURevision = args->arch_args.cpu_type; //XXX
49 #warning M68K: use 060 PCR[15:8]
50 	sCPUType = B_CPU_M68K;
51 
52 	return B_OK;
53 }
54