]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/l4util/lib/src/ARCH-ppc32/rdtsc.c
Update
[l4.git] / l4 / pkg / l4re-core / l4util / lib / src / ARCH-ppc32 / rdtsc.c
1 /*
2  * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  * This file is part of TUD:OS and distributed under the terms of the
5  * GNU Lesser General Public License 2.1.
6  * Please see the COPYING-LGPL-2.1 file for details.
7  */
8 #include <l4/sys/types.h>
9 #include <l4/util/rdtsc.h>
10
11 l4_uint32_t l4_scaler_tsc_to_us;
12 l4_uint32_t l4_scaler_timer_to_tsc;
13
14 l4_uint32_t
15 l4_tsc_init (int constraint, l4_kernel_info_t *kip)
16 {
17   (void)constraint;
18   l4_scaler_timer_to_tsc = (kip->frequency_cpu * 1000)
19                            / (kip->frequency_bus / 4);
20   l4_scaler_tsc_to_us = (kip->frequency_cpu) / 1000;
21
22   return 1;
23 }
24
25