vfs: check userland buffers before reading them.
[haiku.git] / src / system / kernel / arch / m68k / arch_system_info.cpp
blob003cc32807b52eb60c64b337ee6bd0b5d907cbec
1 /*
2 * Copyright 2007, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * François Revol <revol@free.fr>
8 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
9 * All rights reserved. Distributed under the terms of the MIT License.
12 #include <OS.h>
14 #include <arch_cpu.h>
15 #include <arch_platform.h>
16 #include <arch/system_info.h>
17 #include <boot/kernel_args.h>
20 static uint64 sCPUClockFrequency;
21 static uint64 sBusClockFrequency;
22 static uint16 sCPURevision;
25 void
26 arch_fill_topology_node(cpu_topology_node_info* node, int32 cpu)
28 switch (node->type) {
29 case B_TOPOLOGY_ROOT:
30 node->data.root.platform = B_CPU_M68K;
31 break;
33 case B_TOPOLOGY_PACKAGE:
34 node->data.package.vendor = B_CPU_VENDOR_MOTOROLA;
35 node->data.package.cache_line_size = CACHE_LINE_SIZE;
36 break;
38 case B_TOPOLOGY_CORE:
39 node->data.core.model = sCPURevision;
40 node->data.core.default_frequency = sCPUClockFrequency;
41 break;
43 default:
44 break;
49 status_t
50 arch_system_info_init(struct kernel_args *args)
52 sCPUClockFrequency = args->arch_args.cpu_frequency;
53 sBusClockFrequency = args->arch_args.bus_frequency; // not reported anymore?
55 sCPURevision = args->arch_args.cpu_type; //TODO:is it what we want?
56 #warning M68K: use 060 PCR[15:8]
58 return B_OK;