提交 665ff531 编写于 作者: X Xu Han 提交者: GitHub

Merge pull request #1069 from huangwei/wei/tp-qemu-test-aarch64-tsc_drift

tsc_drift test for aarch64
......@@ -12,6 +12,7 @@
typedef unsigned long long u64;
#if defined(__x86_64__)
u64 rdtsc(void)
{
unsigned tsc_lo, tsc_hi;
......@@ -19,6 +20,16 @@ u64 rdtsc(void)
asm volatile("rdtsc" : "=a"(tsc_lo), "=d"(tsc_hi));
return tsc_lo | (u64)tsc_hi << 32;
}
#elif defined(__aarch64__)
u64 rdtsc(void)
{
u64 tsc;
asm volatile("mrs %0, CNTVCT_EL0" : "=r" (tsc) : : );
return tsc;
}
#endif
int main(void)
{
......
......@@ -4,6 +4,7 @@
type = tsc_drift
drift_threshold = 10
interval = 30
required_cpu_flags = "constant_tsc"
pre_command = "/usr/bin/python shared/scripts/check_cpu_flag.py"
smp_min = 2
i386, x86_64:
required_cpu_flags = "constant_tsc"
pre_command = "/usr/bin/python shared/scripts/check_cpu_flag.py"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册