18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci#include <linux/types.h> 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#include "../../../util/tsc.h" 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciu64 rdtsc(void) 78c2ecf20Sopenharmony_ci{ 88c2ecf20Sopenharmony_ci unsigned int low, high; 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci asm volatile("rdtsc" : "=a" (low), "=d" (high)); 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci return low | ((u64)high) << 32; 138c2ecf20Sopenharmony_ci} 14