/* * Copyright 2012-2021, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * François Revol */ #include #include #include #include #include #ifdef _KERNEL_MODE #include #endif static uint64_t cv_factor = 0; extern "C" void __riscv64_setup_system_time(uint64 cv) { cv_factor = cv; } [[gnu::optimize("omit-frame-pointer")]] bigtime_t system_time() { __uint128_t time = static_cast<__uint128_t>(CpuTime()) * cv_factor; return time >> 32; }