// SPDX-License-Identifier: MPL-2.0 #ifndef SH_LIB_TSC_H #define SH_LIB_TSC_H #include "std/type.h" #include "std/status.h" #include "cpu/asm.h" typedef sh_uint64 sh_tsc_TSC_VALUE; // Reas TSC register. static inline sh_tsc_TSC_VALUE sh_tsc_read_tsc() { return sh_asm_rdtsc(); } // Init kernel start tsc. Intended for single use only. SH_STATUS sh_tsc_init_tsc(); // Return kernel start tsc. sh_tsc_TSC_VALUE sh_tsc_get_kernel_init_tsc(); // Return kernel current tsc. sh_tsc_TSC_VALUE sh_tsc_get_kernel_current_tsc(); #endif