system/riscv64: Use dtb-based time cv for system_time
* Fixes speedy-system_time in qemu Change-Id: I07ae4d984c09f2f2503bd45acc415c219f3b3f11 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5327 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
6c675bab59
commit
f8ef244100
@@ -59,12 +59,11 @@ arch_cpu_init(kernel_args *args)
|
|||||||
cpu->cache_id[i] = -1;
|
cpu->cache_id[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
uint64 conversionFactor
|
uint64 conversionFactor
|
||||||
= (1LL << 32) * 1000000LL / args->arch_args.timerFrequency;
|
= (1LL << 32) * 1000000LL / args->arch_args.timerFrequency;
|
||||||
|
|
||||||
__riscv64_setup_system_time(conversionFactor);
|
__riscv64_setup_system_time(conversionFactor);
|
||||||
*/
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,12 @@
|
|||||||
status_t
|
status_t
|
||||||
arch_rtc_init(kernel_args *args, struct real_time_data *data)
|
arch_rtc_init(kernel_args *args, struct real_time_data *data)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
data->arch_data.system_time_conversion_factor
|
data->arch_data.system_time_conversion_factor
|
||||||
= (1LL << 32) * 1000000LL / args->arch_args.timerFrequency;
|
= (1LL << 32) * 1000000LL / args->arch_args.timerFrequency;
|
||||||
|
|
||||||
dprintf("timerFrequency: %" B_PRIu64 "\n",
|
dprintf("timerFrequency: %" B_PRIu64 "\n",
|
||||||
args->arch_args.timerFrequency);
|
args->arch_args.timerFrequency);
|
||||||
dprintf("system_time_conversion_factor: %" B_PRIu64 "\n",
|
dprintf("system_time_conversion_factor: %" B_PRIu64 "\n",
|
||||||
data->arch_data.system_time_conversion_factor);
|
data->arch_data.system_time_conversion_factor);
|
||||||
*/
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,17 +31,6 @@ __riscv64_setup_system_time(uint64 cv)
|
|||||||
[[gnu::optimize("omit-frame-pointer")]] bigtime_t
|
[[gnu::optimize("omit-frame-pointer")]] bigtime_t
|
||||||
system_time()
|
system_time()
|
||||||
{
|
{
|
||||||
// TODO: Timer unit conversion needs fixed here
|
|
||||||
// QEMU and SiFive boards use diferent timer frequencies
|
|
||||||
return CpuTime();
|
|
||||||
/*
|
|
||||||
uint64 time = CpuTime();
|
|
||||||
uint64 lo = (uint32)time;
|
|
||||||
uint64 hi = time >> 32;
|
|
||||||
return ((lo * cv_factor) >> 32) + hi * cv_factor;
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
__uint128_t time = static_cast<__uint128_t>(CpuTime()) * cv_factor;
|
__uint128_t time = static_cast<__uint128_t>(CpuTime()) * cv_factor;
|
||||||
return time >> 32;
|
return time >> 32;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user