2 * Copyright 2012, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
6 * François Revol <revol@free.fr>
12 #include <libroot_private.h>
13 #include <real_time_data.h>
15 static vint32
*sConversionFactor
;
18 __arm_setup_system_time(vint32
*cvFactor
)
20 sConversionFactor
= cvFactor
;
25 // remove me when platform code works
27 __arm_get_time_base(void)
29 static uint64 time_dilation_field
= 0;
30 return time_dilation_field
++;
36 uint64 timeBase
= __arm_get_time_base();
38 uint32 cv
= sConversionFactor
? *sConversionFactor
: 0;
39 return (timeBase
>> 32) * cv
+ (((timeBase
& 0xffffffff) * cv
) >> 32);