btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / libroot / os / arch / ppc / system_time.c
blobce8aa1342568a1cd85bc61aadf77ef85fc8dc853
1 /*
2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
6 #include <OS.h>
8 #include <arch_cpu.h>
9 #include <libroot_private.h>
10 #include <real_time_data.h>
13 static vint32 *sConversionFactor;
15 void
16 __ppc_setup_system_time(vint32 *cvFactor)
18 sConversionFactor = cvFactor;
22 bigtime_t
23 system_time(void)
25 uint64 timeBase = __ppc_get_time_base();
27 uint32 cv = *sConversionFactor;
28 return (timeBase >> 32) * cv + (((timeBase & 0xffffffff) * cv) >> 32);