/* * Copyright 2006, Ingo Weinhold . * Distributed under the terms of the MIT License. */ #include #include #include #include static struct arch_real_time_data *sRealTimeData; void __arch_init_time(struct real_time_data *data, bool setDefaults) { sRealTimeData = &data->arch_data; if (setDefaults) sRealTimeData->system_time_conversion_factor = 1000000000LL; __riscv64_setup_system_time(sRealTimeData->system_time_conversion_factor); } bigtime_t __arch_get_system_time_offset(struct real_time_data *data) { // we don't use atomic_get64 because memory is read-only, maybe // find another way to lock return data->arch_data.system_time_offset; }